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/preferences/SourceEditor.java

    r7001 r7005  
    127127        DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
    128128        this.availableSourcesModel = new AvailableSourcesListModel(selectionModel);
    129         this.lstAvailableSources = new JList<ExtendedSourceEntry>(availableSourcesModel);
     129        this.lstAvailableSources = new JList<>(availableSourcesModel);
    130130        this.lstAvailableSources.setSelectionModel(selectionModel);
    131131        this.lstAvailableSources.setCellRenderer(new SourceEntryListCellRenderer());
     
    446446
    447447        public AvailableSourcesListModel(DefaultListSelectionModel selectionModel) {
    448             data = new ArrayList<ExtendedSourceEntry>();
     448            data = new ArrayList<>();
    449449            this.selectionModel = selectionModel;
    450450        }
     
    483483
    484484        public List<ExtendedSourceEntry> getSelected() {
    485             List<ExtendedSourceEntry> ret = new ArrayList<ExtendedSourceEntry>();
     485            List<ExtendedSourceEntry> ret = new ArrayList<>();
    486486            for(int i=0; i<data.size();i++) {
    487487                if (selectionModel.isSelectedIndex(i)) {
     
    499499        public ActiveSourcesModel(DefaultListSelectionModel selectionModel) {
    500500            this.selectionModel = selectionModel;
    501             this.data = new ArrayList<SourceEntry>();
     501            this.data = new ArrayList<>();
    502502        }
    503503
     
    575575
    576576        public void removeIdxs(Collection<Integer> idxs) {
    577             List<SourceEntry> newData = new ArrayList<SourceEntry>();
     577            List<SourceEntry> newData = new ArrayList<>();
    578578            for (int i=0; i<data.size(); ++i) {
    579579                if (!idxs.contains(i)) {
     
    601601
    602602        public List<SourceEntry> getSources() {
    603             return new ArrayList<SourceEntry>(data);
     603            return new ArrayList<>(data);
    604604        }
    605605
     
    983983            int josmVersion = Version.getInstance().getVersion();
    984984            if (josmVersion != Version.JOSM_UNKNOWN_VERSION) {
    985                 Collection<String> messages = new ArrayList<String>();
     985                Collection<String> messages = new ArrayList<>();
    986986                for (ExtendedSourceEntry entry : sources) {
    987987                    if (entry.minJosmVersion != null && entry.minJosmVersion > josmVersion) {
     
    10541054        public IconPathTableModel(DefaultListSelectionModel selectionModel) {
    10551055            this.selectionModel = selectionModel;
    1056             this.data = new ArrayList<String>();
     1056            this.data = new ArrayList<>();
    10571057        }
    10581058
     
    11451145
    11461146        public List<String> getIconPaths() {
    1147             return new ArrayList<String>(data);
     1147            return new ArrayList<>(data);
    11481148        }
    11491149    }
     
    12371237        private BufferedReader reader;
    12381238        private boolean canceled;
    1239         private final List<ExtendedSourceEntry> sources = new ArrayList<ExtendedSourceEntry>();
     1239        private final List<ExtendedSourceEntry> sources = new ArrayList<>();
    12401240
    12411241        public SourceLoader(String url, List<SourceProvider> sourceProviders) {
     
    14231423        public FileOrUrlCellEditor(boolean isFile) {
    14241424            this.isFile = isFile;
    1425             listeners = new CopyOnWriteArrayList<CellEditorListener>();
     1425            listeners = new CopyOnWriteArrayList<>();
    14261426            build();
    14271427        }
     
    15751575                return new ArrayList<SourceEntry>(getDefault());
    15761576
    1577             List<SourceEntry> entries = new ArrayList<SourceEntry>();
     1577            List<SourceEntry> entries = new ArrayList<>();
    15781578            for (Map<String, String> sourcePref : src) {
    1579                 SourceEntry e = deserialize(new HashMap<String, String>(sourcePref));
     1579                SourceEntry e = deserialize(new HashMap<>(sourcePref));
    15801580                if (e != null) {
    15811581                    entries.add(e);
     
    15861586
    15871587        public boolean put(Collection<? extends SourceEntry> entries) {
    1588             Collection<Map<String, String>> setting = new ArrayList<Map<String, String>>(entries.size());
     1588            Collection<Map<String, String>> setting = new ArrayList<>(entries.size());
    15891589            for (SourceEntry e : entries) {
    15901590                setting.add(serialize(e));
     
    15981598         */
    15991599        public final Set<String> getActiveUrls() {
    1600             Set<String> urls = new HashSet<String>();
     1600            Set<String> urls = new HashSet<>();
    16011601            for (SourceEntry e : get()) {
    16021602                if (e.active) {
Note: See TracChangeset for help on using the changeset viewer.