lgtm issues

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1904092 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-09-15 17:31:50 +00:00
parent 47bcd74df9
commit 06e2213ac1
3 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ public final class Switch implements FreeRefFunction {
return ErrorEval.NA;
}
for (int i = 1; i < args.length; i = i+2) {
for (int i = 1; i < (args.length - 1); i += 2) {
try {
ValueEval value = OperandResolver.getSingleValue(args[i], ec.getRowIndex(), ec.getColumnIndex());

View File

@ -67,7 +67,7 @@ import org.apache.poi.ss.formula.functions.Countif.ErrorMatcher;
// collect pairs of ranges and criteria
AreaEval[] ae = new AreaEval[(args.length - firstCriteria)/2];
I_MatchPredicate[] mp = new I_MatchPredicate[ae.length];
for(int i = firstCriteria, k=0; i < args.length; i += 2, k++){
for(int i = firstCriteria, k=0; i < (args.length - 1); i += 2, k++){
ae[k] = convertRangeArg(args[i]);
mp[k] = Countif.createCriteriaPredicate(args[i+1], ec.getRowIndex(), ec.getColumnIndex());

View File

@ -148,7 +148,7 @@ public class Roman extends Fixed2ArgFunction {
continue;
}
String[] repl = REPLACEMENTS[i];
for (int j=0; j<repl.length; j+=2) {
for (int j = 0; j < (repl.length - 1); j += 2) {
result = result.replace(repl[j],repl[j+1]);
}
}