]> source.dussan.org Git - poi.git/commitdiff
SonarCube fixes
authorAndreas Beeker <kiwiwings@apache.org>
Sat, 12 Nov 2016 18:35:39 +0000 (18:35 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Sat, 12 Nov 2016 18:35:39 +0000 (18:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1769399 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/ss/formula/functions/LogicalFunction.java
src/scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java

index 298de19264bc8f0ef25efb56bc3bb1be6fe06edb..a0825774b3132cd9cfbecd5a87b8c4207bd1f0e8 100644 (file)
@@ -40,12 +40,11 @@ public abstract class LogicalFunction extends Fixed1ArgFunction {
                try {
                        ve = OperandResolver.getSingleValue(arg0, srcRowIndex, srcColumnIndex);
                } catch (EvaluationException e) {
-                       if (false) {
-                               // Note - it is more usual to propagate error codes straight to the result like this:
-                               return e.getErrorEval();
-                               // but logical functions behave a little differently
-                       }
-                       // this will usually cause a 'FALSE' result except for ISNONTEXT()
+                       // Note - it is more usual to propagate error codes straight to the result like this:
+            // but logical functions behave a little differently
+                       // return e.getErrorEval();
+
+                   // this will usually cause a 'FALSE' result except for ISNONTEXT()
                        ve = e.getErrorEval();
                }
                return BoolEval.valueOf(evaluate(ve));
index 54be13f14e1671e792844cd2395c53d8db829cb9..e89efe7354abdc0796b72a150fa023c5a5ef782b 100644 (file)
@@ -380,27 +380,24 @@ public final class HWPFLister
                 }
             }
 
-            if ( true )
+            String text = new Range( chpx.getStart(), chpx.getEnd(),
+                    _doc.getOverallRange() )
             {
-                String text = new Range( chpx.getStart(), chpx.getEnd(),
-                        _doc.getOverallRange() )
+                public String toString()
                 {
-                    public String toString()
-                    {
-                        return "CHPX range (" + super.toString() + ")";
-                    }
-                }.text();
-                StringBuilder stringBuilder = new StringBuilder();
-                for ( char c : text.toCharArray() )
-                {
-                    if ( c < 30 )
-                        stringBuilder
-                                .append( "\\0x" + Integer.toHexString( c ) );
-                    else
-                        stringBuilder.append( c );
+                    return "CHPX range (" + super.toString() + ")";
                 }
-                System.out.println( stringBuilder );
+            }.text();
+            StringBuilder stringBuilder = new StringBuilder();
+            for ( char c : text.toCharArray() )
+            {
+                if ( c < 30 )
+                    stringBuilder
+                            .append( "\\0x" + Integer.toHexString( c ) );
+                else
+                    stringBuilder.append( c );
             }
+            System.out.println( stringBuilder );
         }
     }
 
@@ -584,11 +581,8 @@ public final class HWPFLister
                 System.out.println( paragraph.getProps() );
             }
 
-            if ( true )
-            {
-                SprmIterator sprmIt = new SprmIterator( papx.getGrpprl(), 2 );
-                dumpSprms( sprmIt, "\t" );
-            }
+            SprmIterator sprmIt = new SprmIterator( papx.getGrpprl(), 2 );
+            dumpSprms( sprmIt, "\t" );
         }
     }