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


##########
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:
   yep it would need some good manual testing. (I am using it atm so i am doing 
my part)
   
   But code inspection showed that NB itself should do fine. I did some initial 
digging but we should do more:
   
   | Path | Before | After | Risk |
   |---|---|---|---|
   | Paste **menu** content | fresh (blocked until update) | current field, 
self-correcting on next state change | menu one RP-tick stale if opened within 
ms of a selection/clipboard change — imperceptible in practice |
   | Paste via **OwnPaste.actionPerformed** (direct) | no flush, used current 
field | **flush added** — strictly fresher | none (one-shot, user-initiated) |
   | Paste via **global PasteAction** (Ctrl+V routing, 
`PasteAction.actionPerformed` line 159) | fresh (blocked) | reads field without 
flush; if stale value is `null` it routes to `OwnPaste.actionPerformed` which 
flushes | **only real window**: paste within ~ms of a selection change while 
*old* non-null types exist → pastes old types. A human can't hit this; a macro 
could |
   | Copy/cut/delete, drag&drop, flavor listener, `setPasteTypes` | — | 
untouched | none |
   



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