From ff2db380fbc668a2dba33fe49b8ac75279f25753 Mon Sep 17 00:00:00 2001 From: Rob Stryker Date: Mon, 18 Nov 2024 15:53:31 -0500 Subject: [PATCH] Fix testEnum05 Signed-off-by: Rob Stryker --- .../org/eclipse/jdt/internal/javac/dom/JavacTypeBinding.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacTypeBinding.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacTypeBinding.java index 55cfbdb5af4..9cfcf1465d3 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacTypeBinding.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacTypeBinding.java @@ -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; @@ -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); }