lkishalmi closed pull request #1037: Allow to open projects without nb-javac on 
supported JDKs.
URL: https://github.com/apache/incubator-netbeans/pull/1037
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/FeatureProjectFactory.java
 
b/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/FeatureProjectFactory.java
index 60caaa8822..6beede35a7 100644
--- 
a/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/FeatureProjectFactory.java
+++ 
b/ergonomics/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/FeatureProjectFactory.java
@@ -26,6 +26,7 @@
 import java.io.InputStream;
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -67,6 +68,7 @@
 import org.netbeans.spi.project.ui.LogicalViewProvider;
 import org.openide.filesystems.FileUtil;
 import org.openide.loaders.DataFolder;
+import org.openide.modules.SpecificationVersion;
 import org.openide.nodes.FilterNode;
 import org.openide.util.RequestProcessor.Task;
 import org.xml.sax.SAXException;
@@ -421,7 +423,8 @@ public void run() {
                 if (toInstall != null && ! toInstall.isEmpty ()) {
                     ModulesInstaller installer = new 
ModulesInstaller(toInstall, findModules, this);
                     installer.getInstallTask ().waitFinished ();
-                } else if (toEnable != null && ! toEnable.isEmpty ()) {
+                }
+                if (toEnable != null && ! toEnable.isEmpty () && error == 
null) {
                     ModulesActivator enabler = new ModulesActivator (toEnable, 
findModules, this);
                     enabler.getEnableTask ().waitFinished ();
                 }
@@ -440,7 +443,24 @@ public void onEnable(ProgressHandle progressHandle) {
             }
 
             public void onError(String message) {
-                error = message;
+                SpecificationVersion jdk = new 
SpecificationVersion(System.getProperty("java.specification.version"));
+                FeatureInfo[] fi = Arrays.copyOf(additional, additional.length 
+ 1);
+                fi[additional.length] = info;
+                boolean required = false;
+
+                for (FeatureInfo i : fi) {
+                    for (FeatureInfo.ExtraModuleInfo mi : i.getExtraModules()) 
{
+                        if (mi.recMinJDK != null && 
jdk.compareTo(mi.recMinJDK) < 0) {
+                            required = true;
+                        }
+                    }
+                    if (i.getExtraModulesRequiredText() != null && 
i.getExtraModulesRecommendedText() == null) {
+                        required = true;
+                    }
+                }
+                if (required) {
+                    error = message;
+                }
             }
         } // end of FeatureOpenHook
     } // end of FeatureNonProject


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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