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

tzezula 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 efba815  Fixed livelock in APTUtils happening for huge number of 
dependent projects.
     new 502c8c8  Merge pull request #1308 from tzezula/tzezula/apt_livelock
efba815 is described below

commit efba815999651e5b8f54ba44c590cf0b59fa76d0
Author: Tomas Zezula <[email protected]>
AuthorDate: Tue Jun 18 15:56:43 2019 +0200

    Fixed livelock in APTUtils happening for huge number of dependent projects.
---
 .../src/org/netbeans/modules/java/source/indexing/APTUtils.java  | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git 
a/java/java.source.base/src/org/netbeans/modules/java/source/indexing/APTUtils.java
 
b/java/java.source.base/src/org/netbeans/modules/java/source/indexing/APTUtils.java
index 425b520..5da0008 100644
--- 
a/java/java.source.base/src/org/netbeans/modules/java/source/indexing/APTUtils.java
+++ 
b/java/java.source.base/src/org/netbeans/modules/java/source/indexing/APTUtils.java
@@ -105,6 +105,7 @@ public class APTUtils implements ChangeListener, 
PropertyChangeListener {
     private static final boolean DISABLE_CLASSLOADER_CACHE = 
Boolean.getBoolean("java.source.aptutils.disable.classloader.cache");
     private static final int SLIDING_WINDOW = 1000; //1s
     private static final RequestProcessor RP = new 
RequestProcessor(APTUtils.class);
+    private static final RequestProcessor ROOT_CHANGE_RP = new 
RequestProcessor(APTUtils.class);
     private final FileObject root;
     private volatile ClassPath bootPath;
     private volatile ClassPath compilePath;
@@ -298,9 +299,11 @@ public class APTUtils implements ChangeListener, 
PropertyChangeListener {
     public void propertyChange(PropertyChangeEvent evt) {
         if (ClassPath.PROP_ROOTS.equals(evt.getPropertyName())) {
             classLoaderCache = null;
-            if (verifyProcessorPath(root, usedRoots, PROCESSOR_MODULE_PATH) || 
verifyProcessorPath(root, usedRoots, PROCESSOR_PATH)) {
-                slidingRefresh.schedule(SLIDING_WINDOW);
-            }
+            ROOT_CHANGE_RP.execute(()-> {
+                if (verifyProcessorPath(root, usedRoots, 
PROCESSOR_MODULE_PATH) || verifyProcessorPath(root, usedRoots, PROCESSOR_PATH)) 
{
+                    slidingRefresh.schedule(SLIDING_WINDOW);
+                }
+            });
         }
     }
 


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