[GitHub] jlahoda commented on a change in pull request #500: COS Synchronization is performed at the end of initial scan.

2018-04-16 Thread GitBox
jlahoda commented on a change in pull request #500: COS Synchronization is 
performed at the end of initial scan.
URL: https://github.com/apache/incubator-netbeans/pull/500#discussion_r181870454
 
 

 ##
 File path: 
java.j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java
 ##
 @@ -883,8 +898,43 @@ private static String relativize(
 start++;
 }
 return file.getAbsolutePath().substring(start);
-}
-
+}
+
+private void enqueueDeferred(final Runnable work) {
+boolean addGuard = false;
+synchronized (this) {
+this.deferred.offer(work);
+if (deferredGuard == 0) {
+ addGuard = true;
+deferredGuard = 1;
+}
+}
+if (addGuard) {
+final JavaSource js = createSource();
+synchronized (this) {
+if (deferredGuard == 1) {
+try {
+js.runWhenScanFinished((cc) -> drainDeferred(), 
true);
 
 Review comment:
   Should deferredGuard be set to 2 here?


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



[GitHub] jlahoda commented on a change in pull request #500: COS Synchronization is performed at the end of initial scan.

2018-04-16 Thread GitBox
jlahoda commented on a change in pull request #500: COS Synchronization is 
performed at the end of initial scan.
URL: https://github.com/apache/incubator-netbeans/pull/500#discussion_r181871244
 
 

 ##
 File path: 
java.j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java
 ##
 @@ -703,7 +713,12 @@ private Boolean performUpdate(@NonNull final Context ctx) 
{
 ex.getMessage()
 });
 }
-});
+};
+if (ctx.isAllFilesIndexing()) {
 
 Review comment:
   Here I wonder: should the work be deferred always? For short scans, that 
should be only a small delay (right?) and for big scans, wouldn't it be 
preferable to do whatever is necessary after the scan is finished?


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:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists