private static void forAll(final /* java.util.function.Consumer<ItemListener> */Function<ItemListener,Void> consumer) {
        for (ItemListener l : all()) {
            try {
                consumer.apply(l);
            } catch (RuntimeException x) {
                LOGGER.log(Level.WARNING, "failed to send event to listener of " + l.getClass(), x);
            }
        }
    }
private static void forAll ( final Function < ItemListener , Void > consumer ) { for ( ItemListener l : all ( ) ) { try { consumer . apply ( l ) ; } catch ( RuntimeException x ) { LOGGER . log ( Level . WARNING , "failed to send event to listener of " + l . getClass ( ) , x ) ; } } }
TODO JENKINS-21224 generalize this to a method perhaps in ExtensionList and use consistently from all listeners