mbien commented on code in PR #7382:
URL: https://github.com/apache/netbeans/pull/7382#discussion_r1604208860


##########
java/java.file.launcher/src/org/netbeans/modules/java/file/launcher/queries/MultiSourceRootProvider.java:
##########
@@ -273,29 +288,84 @@ public void stateChanged(ChangeEvent ce) {
         }
 
         private void updateDelegates() {
+            if (SYNCHRONOUS_UPDATES) {
+                doUpdateDelegates();
+            } else {
+                updateDelegatesTask.schedule(0);
+            }
+        }
+
+        private void doUpdateDelegates() {
             Set<URL> newURLs = new HashSet<>();
             List<PathResourceImplementation> newDelegates = new ArrayList<>();
             List<String> parsed = 
SingleSourceFileUtil.parseLine(delegate.getOptions());
+            File workDirectory = Utilities.toFile(delegate.getWorkDirectory());
+            Set<String> toRemoveFSListeners = new HashSet<>();
+            Set<String> addedFSListeners = new HashSet<>();
+
+            synchronized (this) {
+                toRemoveFSListeners.addAll(directoriesWithListener);
+            }
 
             for (int i = 0; i < parsed.size(); i++) {
-                if (optionKeys.contains(parsed.get(i)) && i + 1 < 
parsed.size()) {
-                    ClassPathSupport.createClassPath(parsed.get(i + 1))
-                        .entries()
-                        .stream()
-                        .map(e -> e.getURL())
-                        .forEach(u -> {
+                String currentOption = parsed.get(i);
+
+                if (optionKeys.contains(currentOption) && i + 1 < 
parsed.size()) {

Review Comment:
   if I see this correctly here on github, `i < parsed.size()` of the `for` 
loop can be changed to `i < parsed.size() - 1` and ` && i + 1 < parsed.size()` 
can be removed from the `if`. You want to skip the last entry, right?



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