ASTGen: getSimpleNameAt - return null if nothing not found

This commit is contained in:
Jakub Valtar
2016-04-22 01:53:44 +02:00
parent d2c73cf97b
commit 0b1f1b9283

View File

@@ -995,7 +995,8 @@ public class ASTGenerator {
int maxIndex = IntStream.range(0, simpleNames.size())
.filter(i -> coverages[i] >= 0)
.reduce((i, j) -> coverages[i] > coverages[j] ? i : j)
.orElse(0);
.orElse(-1);
if (maxIndex == -1) return null;
result = simpleNames.get(maxIndex);
}
}