junichi11 commented on a change in pull request #2307:
URL: https://github.com/apache/netbeans/pull/2307#discussion_r469733529



##########
File path: 
java/java.source.base/src/org/netbeans/api/java/source/GeneratorUtilities.java
##########
@@ -1142,7 +1143,12 @@ public CompilationUnitTree 
addImports(CompilationUnitTree cut, Set<? extends Ele
                     el = e.getEnclosingElement();
                     break;
                 default:
-                    assert false : "Illegal element kind: " + e.getKind(); 
//NOI18N
+                    if (TreeShims.isRecord(e)) {
+                        if (e.getEnclosingElement().getKind() == 
ElementKind.PACKAGE) {
+                            el = e.getEnclosingElement();
+                        }
+                    } else
+                        assert false : "Illegal element kind: " + e.getKind(); 
//NOI18N

Review comment:
       Please use `{}`.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to