pedro-w commented on issue #8614: URL: https://github.com/apache/netbeans/issues/8614#issuecomment-2998073024
This is the same kind of issue as #8560 actually - the addition of `getModule()` to the API. I applied this patch ``` diff --git a/java/java.source.base/src/org/netbeans/modules/java/source/JavaSourceUtilImpl.java b/java/java.source.base/src/org/netbeans/modules/java/source/JavaSourceUtilImpl.java index ddb82083e4..7611aa0fb0 100644 --- a/java/java.source.base/src/org/netbeans/modules/java/source/JavaSourceUtilImpl.java +++ b/java/java.source.base/src/org/netbeans/modules/java/source/JavaSourceUtilImpl.java @@ -290,12 +290,12 @@ public final class JavaSourceUtilImpl extends org.netbeans.modules.java.preproce public String parseModuleName() throws IOException { cc.toPhase(JavaSource.Phase.PARSED); final CompilationUnitTree cu = cc.getCompilationUnit(); - for (Tree decl : cu.getTypeDecls()) { - if (decl.getKind() == Tree.Kind.MODULE) { - return ((ModuleTree) decl).getName().toString(); - } + ModuleTree decl = cu.getModule(); + if (decl != null) { + return decl.getName().toString(); + } else { + return null; } - return null; } @Override ``` and *almost* all the tests in the "Java Common Project API" will pass, apart from one failure which I can't see where it comes from:  -- 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-unsubscr...@netbeans.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists