mbien commented on a change in pull request #3396:
URL: https://github.com/apache/netbeans/pull/3396#discussion_r777418802



##########
File path: 
java/java.source.base/src/org/netbeans/modules/java/source/indexing/JavaCustomIndexer.java
##########
@@ -1395,15 +1393,12 @@ private static File dumpHeap(@NonNull final String 
path) {
     private static Pair<Object,Method> heapDumper;
 
     private static String computeJavacVersion() {
-        if (NoJavacHelper.hasNbJavac()) {
-            File nbJavac = 
InstalledFileLocator.getDefault().locate("modules/ext/nb-javac-impl.jar", 
"org.netbeans.modules.nbjavac.impl", false);
-            if (nbJavac != null) {
-                return String.valueOf(nbJavac.lastModified());
+        for (ModuleInfo mi : Lookup.getDefault().lookupAll(ModuleInfo.class)) {
+            if ("org.netbeans.libs.nbjavacapi".equals(mi.getCodeNameBase())) {
+                return mi.getSpecificationVersion().toString();
             }
-            return "-1";
-        } else {
-            return System.getProperty("java.vm.version", "unknown");
         }
+        return System.getProperty("java.version", "unknown");
     }

Review comment:
       please note that the nb-javac module spec version is 
`feature.interim.update` (17.0.1), which is the same as the `java.version` 
property.
   
   This would have the effect of triggering a re-index if a nb-javac update is 
delivered via the plugin portal.
   
   a potential alternative would be simply returning `SourceVersion.latest()` 
which is feature version only (would also handle nb-javac and javac the same).




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

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