Skip to content

Commit

Permalink
Implement remaining methods in JavacVariableBinding
Browse files Browse the repository at this point in the history
Signed-off-by: David Thompson <davthomp@redhat.com>
  • Loading branch information
datho7561 authored and mickaelistria committed Apr 12, 2024
1 parent d064f7d commit 6798c8b
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6798c8b

Please sign in to comment.