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


##########
ide/projectui/src/org/netbeans/modules/project/ui/actions/LookupSensitiveAction.java:
##########
@@ -61,6 +62,15 @@ abstract class LookupSensitiveAction extends BasicAction 
implements Runnable, Lo
 
     private boolean refreshing = false;
 
+    private volatile Lookup pendingContext;

Review Comment:
   Check the original `FileAction`, it already did that to be able to delay the 
refresh.
   
   The reason why you didn't see that on more actions is because it is hidden 
in the java language semantics. E.g `ProjectAction` created a new task with the 
field. Since we re-schedule the same task now it has to read shared memory. 
That shared memory is this `pendingContext` field.
   
   I didn't really come up with this. I generalized it into the base class + 
refactored everything onto the delay task. Instead of cherry picking some 
actions.



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