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 2020/05/20 06:29:56 UTC

[GitHub] [netbeans] sdedic commented on a change in pull request #2143: Adding the OpenJDK support with ability to disable use of ant langtoo…

sdedic commented on a change in pull request #2143:
URL: https://github.com/apache/netbeans/pull/2143#discussion_r427765277



##########
File path: java/java.openjdk.project/src/org/netbeans/modules/java/openjdk/jtreg/ActionProviderImpl.java
##########
@@ -409,12 +409,15 @@ private static boolean newStyleXPatch(FileObject testFile) {
     static String builtClassesDirsForBootClassPath(FileObject testFile) {
         File buildDir = BuildUtils.getBuildTargetDir(testFile);
         Project prj = FileOwnerQuery.getOwner(testFile);
+        Settings settings = prj.getLookup().lookup(Settings.class);
+        boolean useLangtoolsBuild = settings == null || settings.isUseAntBuild();
         List<FileObject> roots = new ArrayList<>();
 
         if (buildDir != null) {
             FileObject repo = prj.getProjectDirectory().getParent().getParent();
             if (repo.getNameExt().equals("langtools") &&
-                ShortcutUtils.getDefault().shouldUseCustomTest(repo.getNameExt(), FileUtil.getRelativePath(repo, testFile))) {
+                ShortcutUtils.getDefault().shouldUseCustomTest(repo.getNameExt(), FileUtil.getRelativePath(repo, testFile)) &&

Review comment:
       Nitpick: maybe a small helper `shouldUseLangtoolsBuild(String repoName, FileObject testFile)` could help to unify this settings lookup + condition: 2 occurrences. Consider when chaning the conditions next time :)

##########
File path: java/java.openjdk.project/src/org/netbeans/modules/java/openjdk/project/ActionProviderImpl.java
##########
@@ -171,8 +171,14 @@ public void invokeAction(String command, Lookup context) throws IllegalArgumentE
             }
         }
         FileObject scriptFO = script;
+        Settings settings = project.getLookup().lookup(Settings.class);
+        Properties props = new Properties();
+        if (settings.isUseAntBuild()) {

Review comment:
       The other `ActionProviderImpl` checks `settings != null` before dereferencing. But a direct dereference was already there in `COMMAND_BUILD_GENERIC_FAST` branch.




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

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