Ignore:
Timestamp:
2014-04-26T17:39:23+02:00 (10 years ago)
Author:
Don-vip
Message:

see #8465 - use diamond operator where applicable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java

    r6889 r7005  
    2525    private final List<StyleList> data;
    2626
    27     private static final Storage<StyleCache> internPool = new Storage<StyleCache>(); // TODO: clean up the intern pool from time to time (after purge or layer removal)
     27    private static final Storage<StyleCache> internPool = new Storage<>(); // TODO: clean up the intern pool from time to time (after purge or layer removal)
    2828
    2929    public static final StyleCache EMPTY_STYLECACHE = (new StyleCache()).intern();
    3030
    3131    private StyleCache() {
    32         bd = new ArrayList<Double>();
     32        bd = new ArrayList<>();
    3333        bd.add(0.0);
    3434        bd.add(Double.POSITIVE_INFINITY);
    35         data = new ArrayList<StyleList>();
     35        data = new ArrayList<>();
    3636        data.add(null);
    3737    }
    3838
    3939    private StyleCache(StyleCache s) {
    40         bd = new ArrayList<Double>(s.bd);
    41         data = new ArrayList<StyleList>(s.data);
     40        bd = new ArrayList<>(s.bd);
     41        data = new ArrayList<>(s.data);
    4242    }
    4343
     
    4545     * List of Styles, immutable
    4646     */
    47     public static class StyleList implements Iterable<ElemStyle>
    48     {
     47    public static class StyleList implements Iterable<ElemStyle> {
    4948        private List<ElemStyle> lst;
    5049
     50        /**
     51         * Constructs a new {@code StyleList}.
     52         */
    5153        public StyleList() {
    52             lst = new ArrayList<ElemStyle>();
     54            lst = new ArrayList<>();
    5355        }
    5456
    5557        public StyleList(ElemStyle... init) {
    56             lst = new ArrayList<ElemStyle>(Arrays.asList(init));
     58            lst = new ArrayList<>(Arrays.asList(init));
    5759        }
    5860
    5961        public StyleList(Collection<ElemStyle> sl) {
    60             lst = new ArrayList<ElemStyle>(sl);
     62            lst = new ArrayList<>(sl);
    6163        }
    6264
    6365        public StyleList(StyleList sl, ElemStyle s) {
    64             lst = new ArrayList<ElemStyle>(sl.lst);
     66            lst = new ArrayList<>(sl.lst);
    6567            lst.add(s);
    6668        }
     
    121123        for (int i=0; i<data.size(); ++i) {
    122124            if (bd.get(i) < scale && scale <= bd.get(i+1)) {
    123                 return new Pair<StyleList, Range>(data.get(i), new Range(bd.get(i), bd.get(i+1)));
     125                return new Pair<>(data.get(i), new Range(bd.get(i), bd.get(i+1)));
    124126            }
    125127        }
Note: See TracChangeset for help on using the changeset viewer.