Summary: | [1.6][compiler] NullPointerException when trying to synchronize on non-existing outer class instance | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Heiko Böttger <heiko.boettger> | ||||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | Olivier_Thomann, satyam.kandula, srikanth_sankaran | ||||||
Version: | 3.7 | Flags: | srikanth_sankaran:
review+
|
||||||
Target Milestone: | 3.7 M2 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows 7 | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Heiko Böttger
2010-09-09 09:45:15 EDT
Reproduced. Working on it. The problem occurs only in 1.6 mode. In 1.5, the compiler error is properly reported and the compilation aborted. The problem comes from that we tag the outer most method when the problem is detected, but we check the current method (field ignoreFurtherInvestigation) to find out if we should stop the current code generation. This is inconsistent as we detect a problem, but we let the code generation of the current method to proceed. Created attachment 178645 [details]
Proposed fix + regression tests
I made some cleanups in the tests at the same time. So to review, please focus more on the changes in the compiler than the tests themselves.
I try to understand why we are always used the outermost method scope to report the problem.
I think we should always report the problem on the inner most method as this is the one that is checked for the ignoreFurtherInvestigation value.
Srikanth, please review. Created attachment 178650 [details]
Proposed fix + regression tests
Same patch with updated copyrights.
Released for 3.7M2. Updated all existing regression tests and added new regression test in: org.eclipse.jdt.core.tests.compiler.regression.StackMapAttributeTest#test047 Verified for 3.7M2 using build I20100914-0100 Looks good. |