This is an automated email from the ASF dual-hosted git repository.

neilcsmith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 926fd6e  Delaying ParameterNameProvider registration to time when 
TreeLoader is installed, as installing the ParameterNameProvider prevents the 
TreeLoader installation.
     new 1b37984  Merge pull request #1515 from jlahoda/register-TreeLoader
926fd6e is described below

commit 926fd6eda9a6e86a21af161b93f9f0ca15719f95
Author: Jan Lahoda <[email protected]>
AuthorDate: Wed Sep 18 07:05:13 2019 +0200

    Delaying ParameterNameProvider registration to time when TreeLoader is 
installed, as installing the ParameterNameProvider prevents the TreeLoader 
installation.
---
 .../src/org/netbeans/modules/java/source/parsing/JavacParser.java     | 2 +-
 .../org/netbeans/modules/java/source/nbjavac/parsing/TreeLoader.java  | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git 
a/java/java.source.base/src/org/netbeans/modules/java/source/parsing/JavacParser.java
 
b/java/java.source.base/src/org/netbeans/modules/java/source/parsing/JavacParser.java
index 62f3156..71ca855 100644
--- 
a/java/java.source.base/src/org/netbeans/modules/java/source/parsing/JavacParser.java
+++ 
b/java/java.source.base/src/org/netbeans/modules/java/source/parsing/JavacParser.java
@@ -794,6 +794,7 @@ public class JavacParser extends Parser {
                   .lookupAll(TreeLoaderRegistry.class)
                   .stream()
                   .forEach(r -> r.enhance(javacTask.getContext(), cpInfo, 
detached));
+            ParameterNameProviderImpl.register(javacTask, cpInfo);
             return javacTask;
         }
     }
@@ -962,7 +963,6 @@ public class JavacParser extends Parser {
         }
         NBEnter.preRegister(context);
         NBMemberEnter.preRegister(context, backgroundCompilation);
-        ParameterNameProviderImpl.register(task, cpInfo);
         TIME_LOGGER.log(Level.FINE, "JavaC", context);
         return task;
     }
diff --git 
a/java/java.source.nbjavac/src/org/netbeans/modules/java/source/nbjavac/parsing/TreeLoader.java
 
b/java/java.source.nbjavac/src/org/netbeans/modules/java/source/nbjavac/parsing/TreeLoader.java
index 63d3677..93b0c5a 100644
--- 
a/java/java.source.nbjavac/src/org/netbeans/modules/java/source/nbjavac/parsing/TreeLoader.java
+++ 
b/java/java.source.nbjavac/src/org/netbeans/modules/java/source/nbjavac/parsing/TreeLoader.java
@@ -101,9 +101,7 @@ public class TreeLoader extends LazyTreeLoader {
     private static final ThreadLocal<Boolean> isTreeLoading = new 
ThreadLocal<Boolean>();
 
     public static void preRegister(final Context context, final ClasspathInfo 
cpInfo, final boolean detached) {
-        LazyTreeLoader instance = context.get(lazyTreeLoaderKey);
-        if (instance == null)
-            context.put(lazyTreeLoaderKey, new TreeLoader(context, cpInfo, 
detached));
+        context.put(lazyTreeLoaderKey, new TreeLoader(context, cpInfo, 
detached));
     }
     
     public static TreeLoader instance (final Context ctx) {


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