Changeset 9070 in josm


Ignore:
Timestamp:
2015-11-30T08:36:35+01:00 (8 years ago)
Author:
Don-vip
Message:

Sonar - squid:S2293 - The diamond operator ("<>") should be used

Location:
trunk/src/org/openstreetmap/josm
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r9067 r9070  
    188188        cmds.addAll(resolution);
    189189        cmds.add(new DeleteCommand(deletedWays));
    190         final SequenceCommand sequenceCommand = new SequenceCommand(/* for correct i18n of plural forms - see #9110 */
     190        final Command sequenceCommand = new SequenceCommand(/* for correct i18n of plural forms - see #9110 */
    191191                trn("Combine {0} way", "Combine {0} ways", ways.size(), ways.size()), cmds);
    192192
    193         return new Pair<Way, Command>(targetWay, sequenceCommand);
     193        return new Pair<>(targetWay, sequenceCommand);
    194194    }
    195195
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r9059 r9070  
    883883
    884884        // add direction perpendicular to the selected segment
    885         possibleMoveDirections = new ArrayList<ReferenceSegment>();
     885        possibleMoveDirections = new ArrayList<>();
    886886        possibleMoveDirections.add(new ReferenceSegment(new EastNorth(
    887887                initialN1en.getY() - initialN2en.getY(),
  • trunk/src/org/openstreetmap/josm/actions/relation/AbstractRelationAction.java

    r8777 r9070  
    2424            return Collections.<Relation>emptySet();
    2525        } else {
    26             return new SubclassFilteredCollection<OsmPrimitive, Relation>(
    27                     primitives, OsmPrimitive.relationPredicate);
     26            return new SubclassFilteredCollection<>(primitives, OsmPrimitive.relationPredicate);
    2827        }
    2928    }
  • trunk/src/org/openstreetmap/josm/command/DeleteCommand.java

    r9062 r9070  
    368368            return null;
    369369
    370         Set<OsmPrimitive> primitivesToDelete = new HashSet<OsmPrimitive>(selection);
     370        Set<OsmPrimitive> primitivesToDelete = new HashSet<>(selection);
    371371
    372372        Collection<Relation> relationsToDelete = Utils.filteredCollection(primitivesToDelete, Relation.class);
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r9067 r9070  
    18241824                Collection<Map<String, String>> data = getListOfStructs(key, (Collection<Map<String, String>>) null);
    18251825                if (data != null) {
    1826                     List<Map<String, String>> newlist = new ArrayList<Map<String, String>>();
     1826                    List<Map<String, String>> newlist = new ArrayList<>();
    18271827                    boolean modified = false;
    18281828                    for (Map<String, String> map : data) {
    1829                          Map<String, String> newmap = new LinkedHashMap<String, String>();
     1829                         Map<String, String> newmap = new LinkedHashMap<>();
    18301830                         for (Entry<String, String> entry : map.entrySet()) {
    18311831                             String val = entry.getValue();
  • trunk/src/org/openstreetmap/josm/data/cache/CacheEntryAttributes.java

    r8624 r9070  
    2222public class CacheEntryAttributes extends ElementAttributes {
    2323    private static final long serialVersionUID = 1L; //version
    24     private final Map<String, String> attrs = new ConcurrentHashMap<String, String>(RESERVED_KEYS.size());
     24    private final Map<String, String> attrs = new ConcurrentHashMap<>(RESERVED_KEYS.size());
    2525    private static final String NO_TILE_AT_ZOOM = "noTileAtZoom";
    2626    private static final String ETAG = "Etag";
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java

    r9064 r9070  
    169169            }
    170170        }
    171         return new CacheAccess<K, V>(cc);
     171        return new CacheAccess<>(cc);
    172172    }
    173173
  • trunk/src/org/openstreetmap/josm/data/notes/Note.java

    r7509 r9070  
    2121    private Date closedAt;
    2222    private State state;
    23     private List<NoteComment> comments = new ArrayList<NoteComment>();
     23    private List<NoteComment> comments = new ArrayList<>();
    2424
    2525    /**
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java

    r9067 r9070  
    382382    public Command fixError(TestError testError) {
    383383        if (!isFixable(testError)) return null;
    384         Collection<OsmPrimitive> sel = new LinkedList<OsmPrimitive>(testError.getPrimitives());
     384        Collection<OsmPrimitive> sel = new LinkedList<>(testError.getPrimitives());
    385385        Set<Node> nodes = new LinkedHashSet<>(OsmPrimitive.getFilteredList(sel, Node.class));
    386386
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r8958 r9070  
    583583         */
    584584        public Set<TagCheck> getTagCheckDependencies(Collection<TagCheck> schecks) {
    585             Set<TagCheck> result = new HashSet<MapCSSTagChecker.TagCheck>();
     585            Set<TagCheck> result = new HashSet<>();
    586586            Set<String> classes = getClassesIds();
    587587            if (schecks != null && !classes.isEmpty()) {
     
    770770                final OsmPrimitive p = OsmUtils.createPrimitive(i.getKey());
    771771                // Build minimal ordered list of checks to run to test the assertion
    772                 List<Set<TagCheck>> checksToRun = new ArrayList<Set<TagCheck>>();
     772                List<Set<TagCheck>> checksToRun = new ArrayList<>();
    773773                Set<TagCheck> checkDependencies = check.getTagCheckDependencies(schecks);
    774774                if (!checkDependencies.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java

    r8870 r9070  
    302302                }
    303303            }
    304             List<OsmPrimitive> newPrimitives = new ArrayList<OsmPrimitive>(primitives);
     304            List<OsmPrimitive> newPrimitives = new ArrayList<>(primitives);
    305305            newPrimitives.add(0, r);
    306306            error.setPrimitives(newPrimitives);
  • trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java

    r9067 r9070  
    4141    private MultiMap<Way, Way> errorWays;
    4242
    43     private final List<NormalizeRule> rules = new ArrayList<NormalizeRule>();
     43    private final List<NormalizeRule> rules = new ArrayList<>();
    4444
    4545    /**
  • trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java

    r9059 r9070  
    105105    private void buildDialog() {
    106106        model = new NoteTableModel();
    107         displayList = new JList<Note>(model);
     107        displayList = new JList<>(model);
    108108        displayList.setCellRenderer(new NoteRenderer());
    109109        displayList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  • trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java

    r8851 r9070  
    405405            } else {
    406406                // Draw message on several lines
    407                 Map<TextAttribute, Object> map = new HashMap<TextAttribute, Object>();
     407                Map<TextAttribute, Object> map = new HashMap<>();
    408408                map.put(TextAttribute.FAMILY, "Serif");
    409409                map.put(TextAttribute.SIZE, new Float(18.0));
  • trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java

    r8929 r9070  
    131131            }
    132132        } else {
    133             FutureTask<V> task = new FutureTask<V>(callable);
     133            FutureTask<V> task = new FutureTask<>(callable);
    134134            SwingUtilities.invokeLater(task);
    135135            try {
  • trunk/src/org/openstreetmap/josm/io/NoteReader.java

    r9059 r9070  
    7373            case "osm":
    7474                parseMode = NoteParseMode.API;
    75                 notes = new ArrayList<Note>(100);
     75                notes = new ArrayList<>(100);
    7676                return;
    7777            case "osm-notes":
    7878                parseMode = NoteParseMode.DUMP;
    79                 notes = new ArrayList<Note>(10000);
     79                notes = new ArrayList<>(10000);
    8080                return;
    8181            }
  • trunk/src/org/openstreetmap/josm/io/OsmServerLocationReader.java

    r8840 r9070  
    178178            in = getInputStream(url, progressMonitor.createSubTaskMonitor(1, true));
    179179            if (in == null) {
    180                 return new ArrayList<Note>();
     180                return new ArrayList<>();
    181181            }
    182182            progressMonitor.subTask(tr("Downloading OSM notes..."));
  • trunk/src/org/openstreetmap/josm/tools/GeoPropertyIndex.java

    r9059 r9070  
    5757        this.geoProp = geoProp;
    5858        this.maxLevel = maxLevel;
    59         this.root = new GPLevel<T>(0, new BBox(-180, -90, 180, 90), null, this);
     59        this.root = new GPLevel<>(0, new BBox(-180, -90, 180, 90), null, this);
    6060        this.lastLevelUsed = root;
    6161    }
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r9062 r9070  
    331331    public ImageProvider addOverlay(ImageOverlay overlay) {
    332332        if (overlayInfo == null) {
    333             overlayInfo = new LinkedList<ImageOverlay>();
     333            overlayInfo = new LinkedList<>();
    334334        }
    335335        overlayInfo.add(overlay);
  • trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java

    r8855 r9070  
    225225     */
    226226    public static Collection<String> getLanguageCodes(Locale l) {
    227         Collection<String> list = new LinkedList<String>();
     227        Collection<String> list = new LinkedList<>();
    228228        if (l == null)
    229229            l = Locale.getDefault();
  • trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java

    r8514 r9070  
    8080            throw new RuntimeException(ex);
    8181        }
    82         rlCache = new GeoPropertyIndex<Boolean>(new RLTrafficGeoProperty(), 24);
     82        rlCache = new GeoPropertyIndex<>(new RLTrafficGeoProperty(), 24);
    8383    }
    8484}
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r8997 r9070  
    141141
    142142    public static <T> Collection<T> filter(Collection<? extends T> collection, Predicate<? super T> predicate) {
    143         return new FilteredCollection<T>(collection, predicate);
     143        return new FilteredCollection<>(collection, predicate);
    144144    }
    145145
Note: See TracChangeset for help on using the changeset viewer.