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 2022/03/28 04:45:42 UTC

[GitHub] [netbeans] jtulach commented on a change in pull request #3715: [NETBEANS-5829] Use --release instead of downgrading the source level.

jtulach commented on a change in pull request #3715:
URL: https://github.com/apache/netbeans/pull/3715#discussion_r836049959



##########
File path: java/java.source.base/src/org/netbeans/modules/java/source/parsing/JavacParser.java
##########
@@ -1078,6 +1086,23 @@ private static JavacTaskImpl createJavacTask(
         return task;
     }
 
+    private static String useRelease(final String requestedSource, com.sun.tools.javac.code.Source validatedSourceLevel) {
+        if (requestedSource == null || validatedSourceLevel == null) {
+            return null;
+        }
+        com.sun.tools.javac.code.Source sourceLevel = com.sun.tools.javac.code.Source.lookup(requestedSource);
+        if (sourceLevel == null) {

Review comment:
       Working with OpenJDK sources out of the box is an important use-case for NetBeans. By creating the `useRelease` method and adding this `sourceLevel == null` check I am able to open `java.base` from https://github.com/openjdk/jdk/commit/c2c0cb2a4372d78658326461562363de9a1a194f without major errors.




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