poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1716044 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java
Date Tue, 24 Nov 2015 07:05:11 GMT
Author: onealj
Date: Tue Nov 24 07:05:11 2015
New Revision: 1716044

URL: http://svn.apache.org/viewvc?rev=1716044&view=rev
Log:
rewrite ternary expression as simple Math.min call (yes, the ternary expression as written
is equivalent to min, not max, despite the variable being called max. I'll leave that fix
up to the original author).

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java?rev=1716044&r1=1716043&r2=1716044&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java Tue Nov 24 07:05:11
2015
@@ -141,8 +141,9 @@ public class XSSFTable extends POIXMLDoc
                         commonTokens = tokens;
                         
                     } else {
-                        int maxLenght = commonTokens.length>tokens.length? tokens.length:commonTokens.length;
-                        for (int i =0; i<maxLenght;i++) {
+                        final int maxLength = Math.min(commonTokens.length, tokens.length);
+                         
+                        for (int i =0; i<maxLength; i++) {
                             if (!commonTokens[i].equals(tokens[i])) {
                              List<String> subCommonTokens = Arrays.asList(commonTokens).subList(0,
i);
                              



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


Mime
View raw message