Community
Participate
Working Groups
I20080401-0851 (I'm trying to remove ugly old workarounds for bug 27236 to get a reasonable fix for bug 182346). package m; class A{ A(){ } } class B extends A{ B(){ } void m() { new A(); } } Search for occurrences of constructor A(). Results: - MethodReferenceMatch on A() (synthetic) => wrong, should be MethodDeclarationMatch - MethodReferenceMatch on B() (synthetic) => correct - MethodReferenceMatch on new A() => correct The problem is that ConstructorLocator.newDeclarationMatch(..) creates reference matches and that boolean synthetic = call != null && call.isImplicitSuper(); is wrong in this case. Note that the same method is also used to create the correct MethodReferenceMatch on B(), so just changing if (this.pattern.findReferences) { into if (this.pattern.findReferences && !this.pattern.findDeclarations) { will not work.
This bug is blocking my progress on bug 182346. Would it be possible to handle it as P2? As a workaround, I tried to replace the ALL_OCCURRENCES search pattern by an OR pattern from a REFERENCES and a DECLARATIONS pattern. But that didn't give me any match for B any more in the following example: enum A_testEnum02_in { A(1), B(2) { } ; A_testEnum02_in(int i) { } }
Created attachment 175458 [details] Proposed patch Markus, Can you try this patch and let me know if it is good for you.
Created attachment 191426 [details] Proposed patch Updated the patch with HEAD. Modified the test too.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.