poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1769399 - in /poi/trunk/src: java/org/apache/poi/ss/formula/functions/LogicalFunction.java scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java
Date Sat, 12 Nov 2016 18:35:39 GMT
Author: kiwiwings
Date: Sat Nov 12 18:35:39 2016
New Revision: 1769399

URL: http://svn.apache.org/viewvc?rev=1769399&view=rev
Log:
SonarCube fixes

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

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/functions/LogicalFunction.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/functions/LogicalFunction.java?rev=1769399&r1=1769398&r2=1769399&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/functions/LogicalFunction.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/functions/LogicalFunction.java Sat Nov 12
18:35:39 2016
@@ -40,12 +40,11 @@ public abstract class LogicalFunction ex
 		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));

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java?rev=1769399&r1=1769398&r2=1769399&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/dev/HWPFLister.java Sat Nov 12 18:35:39
2016
@@ -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" );
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message