You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/02/24 07:40:43 UTC

[GitHub] [netbeans] mklaehn commented on a change in pull request #1964: More stabilization fixes for vanilla indexerer - mostly stabilizing b…

mklaehn commented on a change in pull request #1964: More stabilization fixes for vanilla indexerer - mostly stabilizing b…
URL: https://github.com/apache/netbeans/pull/1964#discussion_r383114608
 
 

 ##########
 File path: java/java.source.base/src/org/netbeans/modules/java/source/indexing/VanillaCompileWorker.java
 ##########
 @@ -595,19 +608,56 @@ private void clearAnnotations(SymbolMetadata metadata) {
                 com.sun.tools.javac.util.List<Attribute.Compound> annotations = metadata.getDeclarationAttributes();
                 com.sun.tools.javac.util.List<Attribute.Compound> prev = null;
                 while (annotations.nonEmpty()) {
-                    if (isErroneous(annotations.head.type)) {
+                    if (isAnnotationErroneous(annotations.head)) {
                         if (prev == null) {
                             metadata.reset();
                             metadata.setDeclarationAttributes(annotations.tail);
                         } else {
                             prev.tail = annotations.tail;
                         }
+                    } else {
+                        prev = annotations;
                     }
-                    prev = annotations;
                     annotations = annotations.tail;
                 }
             }
 
+            private boolean isAnnotationErroneous(Attribute annotation) {
+                if (isErroneous(annotation.type)) {
+                    return true;
+                } else if (annotation instanceof Attribute.Array) {
+                    for (Attribute nested : ((Attribute.Array) annotation).values) {
+                        if (isAnnotationErroneous(nested)) {
+                            return true;
+                        }
+                    }
+                    return false;
+                } else if (annotation instanceof Attribute.Class) {
+                    if (isErroneous(((Attribute.Class) annotation).classType)) {
+                        return true;
+                    }
+                    return false;
+                } else if (annotation instanceof Attribute.Compound) {
+                    for (Pair<MethodSymbol, Attribute> p : ((Attribute.Compound) annotation).values) {
+                        if (isAnnotationErroneous(p.snd)) {
+                            return true;
+                        }
+                    }
+                    return false;
+                } else if (annotation instanceof Attribute.Constant) {
+                    return false;
+                } else if (annotation instanceof Attribute.Enum) {
+                    return false;
+                } else if (annotation instanceof Attribute.Enum) {
 
 Review comment:
   This appears to be duplicate

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists