Summary: | Compiler says a method can be potentially static but this method contains 'this' | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Rémi Forax <forax> | ||||||
Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | Olivier_Thomann, srikanth_sankaran | ||||||
Version: | 3.7 | Flags: | srikanth_sankaran:
review+
|
||||||
Target Milestone: | 3.7 M6 | ||||||||
Hardware: | PC | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Rémi Forax
2011-01-29 19:28:52 EST
Ayush, Please take a look. Created attachment 188029 [details]
proposed fix v1.0 + regression tests
This patch makes sure that the warning is not given for methods where an explicit reference to 'this' takes place.
Running all tests
Srikanth, please review. Thanks! Consistent with the rest of the code in ThisReference.java, you could have used the method isImplicitThis() instead of using its internals. In the test case comment that says "// warn" is misplaced. Otherwise it looks good. Created attachment 188296 [details]
updated patch
patch incorporating above comments
Released in HEAD for 3.7M6 (In reply to comment #5) > Created attachment 188296 [details] > updated patch > > patch incorporating above comments I think that this slight variation is not cover by the proposed patch: public class EclipseImplicitThisBug { class A { } void m() { new A(); // here this is captured to create the non static inner class } } Rémi (In reply to comment #7) > (In reply to comment #5) > > Created attachment 188296 [details] [details] > > updated patch > > > > patch incorporating above comments > > I think that this slight variation is not cover by the proposed patch: > public class EclipseImplicitThisBug { > class A { > } > > void m() { > new A(); // here this is captured to create the non static inner class > } > } > > Rémi Already reported as 335845. https://bugs.eclipse.org/bugs/show_bug.cgi?id=335845 Rémi Verified for 3.7M6. |