VerifyError caused by LocalVariablesSorter
The LocalVariablesSorter will sometimes produce incorrect frames causing verification error.
The following method, when compiled with the eclipse compiler, will cause VerifyError, if run through the
LocalVariablesSorter:
void sample() throws Exception {
try (BufferedReader reader = new BufferedReader(new StringReader("1\n2\n3\n4\n"))) {
String line;
while ((line = reader.readLine()) != null) {
int columnidx = 0;
Integer.parseInt(line);
}
}
}
the above with "Bad local variable type", if commenting out the parseInt line, then with: "Inconsistent stackmap frames"
It seems the "changed" flag in the LocalVariablesSorter isn't set, even though something is remapped?
See attached zip for sample (includes .class files as compiled with eclipse compiler).