Ignore:
Timestamp:
2020-05-17T14:18:22+02:00 (5 years ago)
Author:
simon04
Message:

see #19251 - Java 8: use Stream

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java

    r15586 r16438  
    3333import java.util.concurrent.ExecutionException;
    3434import java.util.concurrent.FutureTask;
     35import java.util.stream.Stream;
    3536
    3637import javax.swing.GrayFilter;
     
    640641            Collection<String> fonts = Arrays.asList(
    641642                    GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames());
    642             for (String f : new String[]{"Khmer UI", "DaunPenh", "MoolBoran"}) {
    643                 if (fonts.contains(f)) {
    644                     setUIFont(f);
    645                     break;
    646                 }
    647             }
     643            Stream.of("Khmer UI", "DaunPenh", "MoolBoran")
     644                    .filter(fonts::contains)
     645                    .findFirst()
     646                    .ifPresent(GuiHelper::setUIFont);
    648647        }
    649648    }
Note: See TracChangeset for help on using the changeset viewer.