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).
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1716044 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dc1acc7ead
commit
84fdda5736
@ -141,8 +141,9 @@ public class XSSFTable extends POIXMLDocumentPart {
|
|||||||
commonTokens = tokens;
|
commonTokens = tokens;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
int maxLenght = commonTokens.length>tokens.length? tokens.length:commonTokens.length;
|
final int maxLength = Math.min(commonTokens.length, tokens.length);
|
||||||
for (int i =0; i<maxLenght;i++) {
|
|
||||||
|
for (int i =0; i<maxLength; i++) {
|
||||||
if (!commonTokens[i].equals(tokens[i])) {
|
if (!commonTokens[i].equals(tokens[i])) {
|
||||||
List<String> subCommonTokens = Arrays.asList(commonTokens).subList(0, i);
|
List<String> subCommonTokens = Arrays.asList(commonTokens).subList(0, i);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user