You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "junichi11 (via GitHub)" <gi...@apache.org> on 2023/03/17 10:08:01 UTC

[GitHub] [netbeans] junichi11 commented on a diff in pull request #5670: Fix incorrect unused coloring #5551

junichi11 commented on code in PR #5670:
URL: https://github.com/apache/netbeans/pull/5670#discussion_r1140033311


##########
php/php.editor/src/org/netbeans/modules/php/editor/csl/SemanticAnalysis.java:
##########
@@ -595,23 +596,27 @@ public void visit(ClassInstanceCreation node) {
                 // to avoid recognizing $this as an instance of an anonymous class
                 scan(node.ctorParams());
                 addToPath(node);
+                // GH-5551 keep original type info to scnan parent blocks
+                TypeInfo originalTypeInfo = typeInfo;
                 typeInfo = new ClassInstanceCreationTypeInfo(node);
                 scan(node.getAttributes());
                 scan(node.getSuperClass());
                 scan(node.getInterfaces());
-                needToScan = new ArrayList<>();
+                needToScan.put(typeInfo, new ArrayList<>());
                 Block body = node.getBody();
                 if (body != null) {
                     body.accept(this);
 
                     // find all usages in the method bodies
-                    while (!needToScan.isEmpty()) {
-                        Block block = needToScan.remove(0);
+                    while (!needToScan.get(typeInfo).isEmpty()) {
+                        Block block = needToScan.get(typeInfo).remove(0);

Review Comment:
   Use for loop?
   ```java
                   for (Block block : needToScan.get(typeInfo)) {
                       block.accept(this);
                   }
                   needToScan.get(typeInfo).clear();
   
   ```



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
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