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


##########
platform/openide.explorer/src/org/netbeans/modules/openide/explorer/ExplorerActionsImpl.java:
##########
@@ -557,34 +565,15 @@ public void actionPerformed(ActionEvent e) {
             Utilities.disabledActionBeep();
         }
 
+        /*
+        * Returns the current paste types without waiting for a pending
+        * update, so that it is safe to call on the AWT thread from
+        * listeners reacting to action state changes. Use
+        * {@link #actionPerformed} when up-to-date types are required.
+        */
         @Override
         public Object getValue(String s) {
             if ("delegates".equals(s)) { // NOI18N
-                String prev = "";

Review Comment:
   regarding the change request:
   ```diff
                    try {
   +                    if (!tooSlowAwait) {
                        timer.waitFinished(100);
   +                    }
                    } catch (InterruptedException ex) {
   +                    // when the wait for an update is known to time out
   +                    // then make a note and never wait from AWT dispatch 
   +                    // thread again. Until an update is rescheduled
   +                    tooSlowAwait = true;
                        LOG.log(Level.FINE, null, ex);
                    }
   ```
   I think this alone wouldn't work since task impl calls `Object.wait(mills)` 
and `InterruptedException` is only thrown when the wait is actually interrupted 
by something, not on timeout.
   
   Also from a different point of view:
    - the existing code already allows the result to be inaccurate - that is 
why its wait-with-timout and not indefinite wait
    - that is why I believe we actually have a chance to make this completely 
non-blocking (cleanest approach IMO)



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