]> source.dussan.org Git - poi.git/commitdiff
rewrite ternary expression as simple Math.min call (yes, the ternary expression as...
authorJaven O'Neal <onealj@apache.org>
Tue, 24 Nov 2015 07:05:11 +0000 (07:05 +0000)
committerJaven O'Neal <onealj@apache.org>
Tue, 24 Nov 2015 07:05:11 +0000 (07:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1716044 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFTable.java

index 39adc25f6d18a17466538c1d44b08dde01795e38..8419de6e46253728d0f117dde2233764d7f9bf84 100644 (file)
@@ -141,8 +141,9 @@ public class XSSFTable extends POIXMLDocumentPart {
                         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);