mbien commented on PR #9464:
URL: https://github.com/apache/netbeans/pull/9464#issuecomment-4790249130

   I didn't mind the first version since it ran in ~1ms on EDT which is 
probably not noticeable.
   
   The only suggestion I would have had was to change `findFirst()` into 
`findAny()`. Once done, a jackpot rule I had active matched and it could be 
simplified into:
   ```java
                   boolean hasEditor = wman.getModes().stream()
                           .filter(mode -> wman.isEditorMode(mode))
                           .flatMap(m -> 
Stream.of(wman.getOpenedTopComponents(m)))
                           .anyMatch(tc -> 
tc.getLookup().lookup(DataObject.class) != null);
   ```


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