File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac/dom Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,11 @@ public IAnnotationBinding[] getAnnotations() {
146146 if ( methodSymbol == null ) {
147147 return new IAnnotationBinding [0 ];
148148 }
149- return methodSymbol .getAnnotationMirrors ().stream ().map (ann -> this .resolver .bindings .getAnnotationBinding (ann , this )).toArray (IAnnotationBinding []::new );
149+ var anns = methodSymbol .getAnnotationMirrors ().stream ();
150+ if (!this .resolver .isRecoveringBindings ()) {
151+ anns = anns .filter (ann -> !ann .type .isErroneous ());
152+ }
153+ return anns .map (ann -> this .resolver .bindings .getAnnotationBinding (ann , this )).toArray (IAnnotationBinding []::new );
150154 }
151155
152156 @ Override
Original file line number Diff line number Diff line change @@ -93,9 +93,14 @@ public IAnnotationBinding[] getAnnotations() {
9393 .map (IMethodBinding ::getAnnotations )
9494 .orElseGet (() -> new IAnnotationBinding [0 ]);
9595 }
96- return this .variableSymbol .getAnnotationMirrors ().stream ()
97- .map (am -> this .resolver .bindings .getAnnotationBinding (am , this ))
98- .toArray (IAnnotationBinding []::new );
96+ if (variableSymbol == null ) {
97+ return new IAnnotationBinding [0 ];
98+ }
99+ var anns = this .variableSymbol .getAnnotationMirrors ().stream ();
100+ if (!this .resolver .isRecoveringBindings ()) {
101+ anns = anns .filter (ann -> !ann .type .isErroneous ());
102+ }
103+ return anns .map (ann -> this .resolver .bindings .getAnnotationBinding (ann , this )).toArray (IAnnotationBinding []::new );
99104 }
100105
101106 @ Override
You can’t perform that action at this time.
0 commit comments