Skip to content

Commit

Permalink
Fix testEnum05
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed Nov 18, 2024
1 parent 8c5cdf6 commit ff2db38
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
Expand Down Expand Up @@ -198,6 +199,8 @@ public IJavaElement getJavaElement() {
if (getDeclaringMethod() != null && getDeclaringMethod().getJavaElement() instanceof IMethod method) {
// TODO find proper occurenceCount (eg checking the source range)
return method.getType("", 1);
} else if( getDeclaringMember() instanceof IBinding gdm && gdm != null && gdm.getJavaElement() instanceof IField field) {
return field.getType("", 1);
} else if (getDeclaringClass() != null && getDeclaringClass().getJavaElement() instanceof IType type) {
return type.getType("", 1);
}
Expand Down

0 comments on commit ff2db38

Please sign in to comment.