Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reim-Infer chokes on static or block initializers #6

Open
GoogleCodeExporter opened this issue May 18, 2015 · 2 comments
Open

Reim-Infer chokes on static or block initializers #6

GoogleCodeExporter opened this issue May 18, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create a Java file blah.java with the following contents:
public class blah {
  int a;
  {
    a = 1;
  }
}
2. Run binary/javai-reim blah.java

What is the expected output? What do you see instead?
java.lang.Error: Reim processor threw unexpected exception when processing 
blah.java


What version of the product are you using? On what operating system?
trunk from svn. Linux (Fedora 19) OpenJDK 1.7.0_51

Please provide any additional information below.
The reason is in checkers/inference/reim/ReimVisitor.java, checkMutable calls 
TreeUtils.enclosingMethod(getCurrentPath()).
Unfortunately, getCurrentPath() will not contain a METHOD element in case of 
static and non-static block initializers. The nesting will be
EXPRESSION > BLOCK > CLASS.

Original issue reported on code.google.com by [email protected] on 6 Mar 2014 at 10:53

@GoogleCodeExporter
Copy link
Author

Reim processor would not throw the exception under JDK 6.
Please run binary/javai-reim2 under JDK 7.
Thanks!

Original comment by [email protected] on 8 Mar 2015 at 12:08

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 8 Mar 2015 at 3:52

  • Changed state: Accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant