You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class A {
public class BaseTargetClass {}
public class OriginalClass {
public int data = 60;
public void memberMethod() {}
public class NestedOriginalClass extends BaseTargetClass {
void setup() {
new BaseTargetClass() {
int j = 1;
void methodToBePulledUp() {
j = 2;
methodHelper();
}
void methodHelper() {
System.out.println("Helper Method in Anonymous Class: " + data);
}
};
}
}
}
}
A search for fields or methods of methodToBePulledUp() will result in an empty result. This is because the logic in MethodLocator and FieldLocator classes cannot find the type by name.
This logic is required by the JDT UI refactoring code to find accessed fields and methods of members that are being moved.
The text was updated successfully, but these errors were encountered:
jjohnstn
changed the title
SearchEngine.searchDeclarationsOfSentMessages() does not work for anonymous or local classes
SearchEngine searchDeclarationsOfSentMessages()/searchDeclarationsOfAccessedFields() does not work for anonymous or local classes
Nov 14, 2024
jjohnstn
added a commit
to jjohnstn/eclipse.jdt.core-1
that referenced
this issue
Nov 14, 2024
- Fix FieldLocator.reportDeclaration() and
MethodLocator.reportDeclaration() to find the anonymous or local
type for the declaration rather than to return
- add new tests to JavaSearchBugsTests
- fixeseclipse-jdt#3308
In the following example:
A search for fields or methods of methodToBePulledUp() will result in an empty result. This is because the logic in MethodLocator and FieldLocator classes cannot find the type by name.
This logic is required by the JDT UI refactoring code to find accessed fields and methods of members that are being moved.
The text was updated successfully, but these errors were encountered: