Closed dodie closed 5 years ago
Create more tests to verify the example classes introduced with #80 to see if they are instrumented correctly.
public boolean hello(boolean b) {
try {
if (b) {
return false;
}
String string = "a";
return true;
} finally {
System.out.println("Hey");
}
}
I suspect that the special constructs that this ticket is about causes an inappropriate recording will happen to the string
variable when b is true.
I've tested the snipped from my previous comment, and it does not cause inappropriate recording to happen, because the return statement generates an iload
and and an ireturn
statement, while the variable recording in inserted for store statements and methods calls only.
So, as far as I know, these variables does not cause side effects, so it's safe to keep them,
lineNumberToFirstOccurrenceOfVariables
andvarAccesses
inScopeExtractorMethodVisitor
are required for some try-finally constructs to work correctly.Investigate if it's possible to remove it, or it's indeed necessary to have these exceptional access tracking.