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



##########
File path: 
java/java.source.base/src/org/netbeans/modules/java/source/NoJavacHelper.java
##########
@@ -18,99 +18,34 @@
  */
 package org.netbeans.modules.java.source;
 
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.security.ProtectionDomain;
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import javax.lang.model.SourceVersion;
-import org.objectweb.asm.ClassWriter;
-import org.objectweb.asm.Opcodes;
-import org.openide.modules.OnStart;
 
 /**
  *
  * @author lahvac
  */
 public class NoJavacHelper {
 
-    private static final AtomicReference<Boolean> hasWorkingJavac = new 
AtomicReference<>();
-    public static boolean hasWorkingJavac() {
-        Boolean res = hasWorkingJavac.get();
-        if (res != null) {
-            return res;
-        }
+    private static final boolean hasWorkingJavac;
+
+    static {
+        boolean res;
         try {
             SourceVersion.valueOf("RELEASE_17");
             res = true;
         } catch (IllegalArgumentException ex) {
-            //OK
             res = false;
         }
-        hasWorkingJavac.compareAndSet(null, res);
-        return hasWorkingJavac.get();
+        hasWorkingJavac = res;
     }
 
-    public static boolean hasNbJavac() {
-        try {
-            Class.forName("com.sun.tools.javac.comp.Repair");
-            return true;
-        } catch (ClassNotFoundException ex) {
-            //OK
-            return false;
-        }
+    public static boolean hasWorkingJavac() {
+        return hasWorkingJavac;
     }
 
-    @OnStart
-    public static class FixClasses implements Runnable {

Review comment:
       roger, lets keep it.




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