From 6798c8b889f6ef3f8509db38b1bcf4a8c88202ae Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 12 Apr 2024 13:56:52 -0400 Subject: [PATCH] Implement remaining methods in JavacVariableBinding Signed-off-by: David Thompson --- .../jdt/internal/javac/dom/JavacVariableBinding.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacVariableBinding.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacVariableBinding.java index 83da17a79d6..639cac743e5 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacVariableBinding.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom/JavacVariableBinding.java @@ -21,6 +21,7 @@ import org.eclipse.jdt.core.dom.JavacBindingResolver; import com.sun.tools.javac.code.Flags; +import com.sun.tools.javac.code.Kinds; import com.sun.tools.javac.code.Symbol; import com.sun.tools.javac.code.Symbol.ClassSymbol; import com.sun.tools.javac.code.Symbol.MethodSymbol; @@ -39,8 +40,9 @@ public JavacVariableBinding(VarSymbol sym, JavacBindingResolver resolver) { @Override public IAnnotationBinding[] getAnnotations() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'getAnnotations'"); + return this.variableSymbol.getAnnotationMirrors().stream() + .map(am -> new JavacAnnotationBinding(am, resolver, this)) + .toArray(IAnnotationBinding[]::new); } @Override @@ -60,8 +62,7 @@ public boolean isDeprecated() { @Override public boolean isRecovered() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'isRecovered'"); + return this.variableSymbol.kind == Kinds.Kind.ERR; } @Override