neilcsmith-net commented on code in PR #6872:
URL: https://github.com/apache/netbeans/pull/6872#discussion_r1443690927
##########
enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/ui/AddServerLocationPanel.java:
##########
@@ -44,25 +42,15 @@ public class AddServerLocationPanel implements
WizardDescriptor.FinishablePanel,
private AddServerLocationVisualPanel component;
private WizardDescriptor wizard;
- private final transient Set listeners = ConcurrentHashMap.newKeySet(2);
+ private final transient Set<ChangeListener> listeners =
ConcurrentHashMap.newKeySet(2);
public AddServerLocationPanel(WildflyInstantiatingIterator
instantiatingIterator) {
this.instantiatingIterator = instantiatingIterator;
}
@Override
public void stateChanged(ChangeEvent ev) {
- fireChangeEvent(ev);
- }
-
- private void fireChangeEvent(ChangeEvent ev) {
- Iterator it;
- synchronized (listeners) {
- it = new HashSet(listeners).iterator();
- }
- while (it.hasNext()) {
- ((ChangeListener) it.next()).stateChanged(ev);
- }
+ listeners.iterator().forEachRemaining(l -> l.stateChanged(ev));
Review Comment:
Agree entirely! Only caught my eye because of your comment above. However,
performance isn't the relevant bit - having things changing or firing listeners
off of the EDT is usually a big flashing warning sign.
As for the multi-file regressions, personally I'm in favour of reverting and
rethinking after freeze, but waiting to see where that goes ...
--
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