Ignore:
Timestamp:
2014-10-18T23:07:52+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] fix Java 7 / unused code warnings

Location:
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessRulesetReader.java

    r26174 r30737  
    6565                List<String> names;
    6666                if (parent == null) {
    67                     names = new LinkedList<String>();
     67                    names = new LinkedList<>();
    6868                } else {
    6969                    names = parent.getAncestorHierarchy();
     
    7474        }
    7575
    76         private final Collection<AccessClass> accessClasses = new LinkedList<AccessClass>();
    77         private final Collection<Tag> baseTags = new LinkedList<Tag>();
     76        private final Collection<AccessClass> accessClasses = new LinkedList<>();
     77        private final Collection<Tag> baseTags = new LinkedList<>();
    7878
    7979        private static enum Section {NONE, CLASSES, BASETAGS, IMPLICATIONS};
     
    8383
    8484        private ImplicationXMLReader implicationReader = null;
    85         private final List<Implication> implications = new LinkedList<Implication>();
     85        private final List<Implication> implications = new LinkedList<>();
    8686
    8787        /** returns the AccessRuleset that was read */
     
    9696                        }
    9797                    }
    98                     return new LinkedList<String>();
     98                    return new LinkedList<>();
    9999                }
    100100
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/Implication.java

    r23189 r30737  
    3434        if (condition.matches(tags)) {
    3535
    36             Map<String, String> newTagMap = new HashMap<String, String>();
     36            Map<String, String> newTagMap = new HashMap<>();
    3737
    3838            for (Tag tag : tags) {
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/ImplicationXMLReader.java

    r30497 r30737  
    1919public class ImplicationXMLReader {
    2020
    21     private final List<Implication> implications = new LinkedList<Implication>();
     21    private final List<Implication> implications = new LinkedList<>();
    2222
    2323    private static enum State {BEFORE_IMPLICATION, BEFORE_CONDITION, CONDITION, BEFORE_IMPLIES, IMPLIES, AFTER_IMPLIES};
     
    5858
    5959                if ("implies".equals(name)) {
    60                     currentImpliedTags = new LinkedList<Tag>();
     60                    currentImpliedTags = new LinkedList<>();
    6161                    state = State.IMPLIES;
    6262                    return;
     
    137137            throw new SAXException(tr("Some tags have not been closed; now in state {0}", state));
    138138        } else {
    139             return new ArrayList<Implication>(implications);
     139            return new ArrayList<>(implications);
    140140        }
    141141    }
     
    175175        boolean finished;
    176176
    177         private final List<ConditionReader> childReaders = new LinkedList<ConditionReader>();
     177        private final List<ConditionReader> childReaders = new LinkedList<>();
    178178        private ConditionReader currentChildReader = null;
    179179
     
    234234                if (openingName.equals(name)) {
    235235
    236                     List<TagCondition> childConditions = new ArrayList<TagCondition>();
     236                    List<TagCondition> childConditions = new ArrayList<>();
    237237                    for (ConditionReader childReader : childReaders) {
    238238                        childConditions.add(childReader.getCondition());
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/RulesetAccessEvaluator.java

    r23189 r30737  
    126126         */
    127127
    128         Map<String, AccessType> accessTypePerClass = new HashMap<String, AccessType>();
     128        Map<String, AccessType> accessTypePerClass = new HashMap<>();
    129129
    130130        for (String accessClass : accessClasses) {
     
    155155        /* evaluate implied tagging of other tags */
    156156
    157         Map<String, String> tagMap = new HashMap<String, String>();
     157        Map<String, String> tagMap = new HashMap<>();
    158158        for (Tag tag : wayTags) {
    159159            if (!tag.equals(baseTag)) {
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/MapBasedTagGroup.java

    r23189 r30737  
    3434            throw new IllegalArgumentException();
    3535        }
    36         this.tagMap = new HashMap<String, String>();
     36        this.tagMap = new HashMap<>();
    3737        for (Tag tag : tags) {
    3838            if (tag == null) {
     
    4848     */
    4949    public MapBasedTagGroup(Tag... tags) {
    50         this.tagMap = new HashMap<String, String>(tags.length);
     50        this.tagMap = new HashMap<>(tags.length);
    5151        for (Tag tag : tags) {
    5252            if (tag == null) {
     
    8888    public Iterator<Tag> iterator() {
    8989
    90         Collection<Tag> tagCollection = new LinkedList<Tag>();
     90        Collection<Tag> tagCollection = new LinkedList<>();
    9191
    9292        for (String key : tagMap.keySet()) {
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/ConnectorEvaluationGroup.java

    r26174 r30737  
    3030
    3131        this.segments = segments;
    32         this.borderNodes = new ArrayList<SegmentNode>(borderNodes);
     32        this.borderNodes = new ArrayList<>(borderNodes);
    3333    }
    3434
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/EvaluationGroup.java

    r23189 r30737  
    7777                activeRestrictionsAfterSegment(firstSegment, EMPTY_RESTRICTION_LIST, restrictions);
    7878
    79             Collection<Restriction> restrictionsForbiddenAtLastNode = new HashSet<Restriction>();
     79            Collection<Restriction> restrictionsForbiddenAtLastNode = new HashSet<>();
    8080            for (Restriction restriction : restrictions) {
    8181                if (restriction.getTos().contains(lastSegment)) {
     
    110110        }
    111111
    112         Queue<State> stateQueue = new LinkedList<State>();
     112        Queue<State> stateQueue = new LinkedList<>();
    113113        stateQueue.add(createStartingState(firstNode, initiallyActiveRestrictions));
    114114
     
    143143        startingState.activeRestrictions = initiallyActiveRestrictions;
    144144        startingState.segmentHistory = EMPTY_SEGMENT_LIST;
    145         startingState.visitedNodes = new HashSet<SegmentNode>();
     145        startingState.visitedNodes = new HashSet<>();
    146146        startingState.visitedNodes.add(firstNode);
    147147
     
    151151    private List<State> createSubsequentStates(State state, Collection<Restriction> allRestrictions) {
    152152
    153         List<State> subsequentStates = new ArrayList<State>();
     153        List<State> subsequentStates = new ArrayList<>();
    154154
    155155        for (Segment segment : state.currentNode.getOutboundSegments()) {
     
    163163                        segment, state.activeRestrictions, allRestrictions);
    164164
    165                 newState.segmentHistory = new ArrayList<Segment>(state.segmentHistory.size() + 1);
     165                newState.segmentHistory = new ArrayList<>(state.segmentHistory.size() + 1);
    166166                newState.segmentHistory.addAll(state.segmentHistory);
    167167                newState.segmentHistory.add(segment);
     
    169169                newState.currentNode = segment.getNode2();
    170170
    171                 newState.visitedNodes = new HashSet<SegmentNode>(state.visitedNodes);
     171                newState.visitedNodes = new HashSet<>(state.visitedNodes);
    172172                newState.visitedNodes.add(newState.currentNode);
    173173
     
    200200            if (restriction.getFrom() == segment) {
    201201                if (result == EMPTY_RESTRICTION_LIST) {
    202                     result = new ArrayList<Restriction>(restrictions.size());
     202                    result = new ArrayList<>(restrictions.size());
    203203                }
    204204                result.add(restriction);
     
    218218            if (restriction.getVias().contains(segment)) {
    219219                if (result == EMPTY_RESTRICTION_LIST) {
    220                     result = new ArrayList<Restriction>(allRestrictions.size());
     220                    result = new ArrayList<>(allRestrictions.size());
    221221                }
    222222                result.add(restriction);
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/JunctionEvaluationGroup.java

    r26174 r30737  
    8484         * is in the set and whose start node isn't (analogous for outbound segments)       */
    8585
    86         inboundSegments = new ArrayList<Segment>();
    87         outboundSegments = new ArrayList<Segment>();
     86        inboundSegments = new ArrayList<>();
     87        outboundSegments = new ArrayList<>();
    8888
    8989        for (SegmentNode segmentNode : segmentNodes) {
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/TSBasedWayGraph.java

    r29854 r30737  
    3030        private final SegmentNode node;
    3131        private final Segment segment;
    32         private final List<GraphEdge> incomingEdges = new ArrayList<GraphEdge>();
    33         private final List<GraphEdge> outgoingEdges = new ArrayList<GraphEdge>();
     32        private final List<GraphEdge> incomingEdges = new ArrayList<>();
     33        private final List<GraphEdge> outgoingEdges = new ArrayList<>();
    3434        public GraphNodeImpl(SegmentNode node, Segment segment) {
    3535            assert node != null && segment != null;
     
    101101    };
    102102
    103     private final Set<WayGraphObserver> observers = new HashSet<WayGraphObserver>();
     103    private final Set<WayGraphObserver> observers = new HashSet<>();
    104104
    105105    private final TransitionStructure transitionStructure;
     
    147147
    148148        Map<SegmentNode, Set<SegmentNode>> nodeSetMap =
    149             new HashMap<SegmentNode, Set<SegmentNode>>();
     149            new HashMap<>();
    150150
    151151        /* first step: everything that is part of the same restriction goes into the same set */
     
    189189
    190190        Map<Segment, Set<Segment>> segmentSetMap =
    191             new HashMap<Segment, Set<Segment>>();
     191            new HashMap<>();
    192192
    193193        for (Segment segment : transitionStructure.getSegments()) {
     
    218218
    219219        Collection<EvaluationGroup> evaluationGroups =
    220             new ArrayList<EvaluationGroup>(nodeSetMap.size() + segmentSetMap.size());
    221 
    222         Set<Set<SegmentNode>> nodeSets = new HashSet<Set<SegmentNode>>(nodeSetMap.values());
     220            new ArrayList<>(nodeSetMap.size() + segmentSetMap.size());
     221
     222        Set<Set<SegmentNode>> nodeSets = new HashSet<>(nodeSetMap.values());
    223223        for (Set<SegmentNode> nodeSet : nodeSets) {
    224224            evaluationGroups.add(new JunctionEvaluationGroup(nodeSet));
    225225        }
    226226
    227         HashSet<Set<Segment>> hashSets = new HashSet<Set<Segment>>(segmentSetMap.values());
     227        HashSet<Set<Segment>> hashSets = new HashSet<>(segmentSetMap.values());
    228228        for (Set<Segment> segmentSet : hashSets) {
    229             Set<SegmentNode> borderNodes = new HashSet<SegmentNode>();
     229            Set<SegmentNode> borderNodes = new HashSet<>();
    230230            for (Segment segment : segmentSet) {
    231231                if (nodeSetMap.containsKey(segment.getNode1())) {
     
    245245            Collection<EvaluationGroup> evaluationGroups) {
    246246
    247         nodes = new LinkedList<GraphNode>();
    248         edges = new LinkedList<GraphEdge>();
     247        nodes = new LinkedList<>();
     248        edges = new LinkedList<>();
    249249
    250250        //map from Segments to GraphNodes;
    251251        //for those GraphNodes representing an "approaching node on segment" state
    252252        final Map<Segment, GraphNodeImpl> segment2GNMap_approaching =
    253             new HashMap<Segment, GraphNodeImpl>();
     253            new HashMap<>();
    254254
    255255        //map from Segments to GraphNodes;
    256256        //for those GraphNodes representing a "leaving node on segment" state
    257257        final Map<Segment, GraphNodeImpl> segment2GNMap_leaving =
    258             new HashMap<Segment, GraphNodeImpl>();
     258            new HashMap<>();
    259259
    260260        //map from SegmentNodes to GraphNode collections;
    261261        //for those GraphNodes representing an "approaching node on segment" state
    262262        final Map<SegmentNode, Collection<GraphNodeImpl>> segNode2GNMap_approaching =
    263             new HashMap<SegmentNode, Collection<GraphNodeImpl>>();
     263            new HashMap<>();
    264264
    265265        //map from SegmentNodes to GraphNodes collections;
    266266        //for those GraphNodes representing a "leaving node on segment" state
    267267        final Map<SegmentNode, Collection<GraphNodeImpl>> segNode2GNMap_leaving =
    268             new HashMap<SegmentNode, Collection<GraphNodeImpl>>();
     268            new HashMap<>();
    269269
    270270
     
    366366
    367367        Map<GraphEdgePropertyType<?>, Object> properties =
    368             new HashMap<GraphEdgePropertyType<?>, Object>(); //TODO: replace HashMap with List-based solution
     368            new HashMap<>(); //TODO: replace HashMap with List-based solution
    369369
    370370        for (GraphEdgePropertyType<?> propertyType : PROPERTY_TYPES) {
     
    382382
    383383        Map<GraphEdgePropertyType<?>, Object> properties =
    384             new HashMap<GraphEdgePropertyType<?>, Object>(); //TODO: replace HashMap with List-based solution
     384            new HashMap<>(); //TODO: replace HashMap with List-based solution
    385385
    386386        for (GraphEdgePropertyType<?> propertyType : PROPERTY_TYPES) {
     
    411411    private static boolean isConnectedWithExactly2Nodes(SegmentNode node) {
    412412
    413         Set<SegmentNode> connectedNodes = new HashSet<SegmentNode>(2);
     413        Set<SegmentNode> connectedNodes = new HashSet<>(2);
    414414
    415415        for (Segment segment : node.getInboundSegments()) {
     
    430430
    431431        if (!objectSetMap.containsKey(object)) {
    432             Set<T> set = new HashSet<T>();
     432            Set<T> set = new HashSet<>();
    433433            set.add(object);
    434434            objectSetMap.put(object, set);
     
    472472    private static <K, E> void addToCollectionMap(final Map<K, Collection<E>> map, K key, E entry) {
    473473        if (!map.containsKey(key)) {
    474             Collection<E> newCollection = new ArrayList<E>();
     474            Collection<E> newCollection = new ArrayList<>();
    475475            map.put(key, newCollection);
    476476        }
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/GenericTransitionStructure.java

    r29854 r30737  
    3333        Collections.unmodifiableList(new ArrayList<Segment>(0));
    3434    private static final Collection<Restriction> EMPTY_RESTRICTION_COLLECTION =
    35         new ArrayList<Restriction>(0);
     35        new ArrayList<>(0);
    3636
    3737    private static class SegmentNodeImpl implements SegmentNode {
    3838        private final double lat;
    3939        private final double lon;
    40         private final List<Segment> inboundSegments = new LinkedList<Segment>();
    41         private final List<Segment> outboundSegments = new LinkedList<Segment>();
     40        private final List<Segment> inboundSegments = new LinkedList<>();
     41        private final List<Segment> outboundSegments = new LinkedList<>();
    4242        private final Map<RoadPropertyType<?>, Object> properties;
    4343        public SegmentNodeImpl(double lat, double lon, Map<RoadPropertyType<?>, Object> properties) {
     
    148148    }
    149149
    150     private final Set<TransitionStructureObserver> observers = new HashSet<TransitionStructureObserver>();
     150    private final Set<TransitionStructureObserver> observers = new HashSet<>();
    151151
    152152    private final Collection<RoadPropertyType<?>> properties;
     
    160160
    161161    private Collection<SegmentNode> nodes = null;
    162     private Collection<Segment> segments = new LinkedList<Segment>();
    163     private Collection<Restriction> restrictions = new LinkedList<Restriction>();
     162    private Collection<Segment> segments = new LinkedList<>();
     163    private Collection<Restriction> restrictions = new LinkedList<>();
    164164
    165165    public GenericTransitionStructure(
     
    201201            assert dataSource != null;
    202202
    203             accessEvaluator = new RulesetAccessEvaluator<N, W, R, M>(
     203            accessEvaluator = new RulesetAccessEvaluator<>(
    204204                    dataSource,
    205205                    this.ruleset,
     
    230230    protected void updateData() {
    231231
    232         ArrayList<SegmentNode> nodes = new ArrayList<SegmentNode>();
    233         ArrayList<Segment> segments = new ArrayList<Segment>();
    234 
    235         Map<N, SegmentNodeImpl> nodeCreationMap = new HashMap<N, SegmentNodeImpl>();
    236         Map<W, List<Segment>> waySegmentMap = new HashMap<W, List<Segment>>();
     232        ArrayList<SegmentNode> nodes = new ArrayList<>();
     233        ArrayList<Segment> segments = new ArrayList<>();
     234
     235        Map<N, SegmentNodeImpl> nodeCreationMap = new HashMap<>();
     236        Map<W, List<Segment>> waySegmentMap = new HashMap<>();
    237237
    238238        /* create segments (nodes are created only when included in a segment) */
     
    372372        assert relations != null && nodeCreationMap != null && waySegmentMap != null;
    373373
    374         Collection<Restriction> results = new LinkedList<Restriction>();
     374        Collection<Restriction> results = new LinkedList<>();
    375375
    376376        for (R relation : relations) {
     
    404404
    405405        W fromWay = null;
    406         Collection<N> viaNodes = new LinkedList<N>();
    407         Collection<W> viaWays = new LinkedList<W>();
    408         Collection<W> toWays = new LinkedList<W>();
     406        Collection<N> viaNodes = new LinkedList<>();
     407        Collection<W> viaWays = new LinkedList<>();
     408        Collection<W> toWays = new LinkedList<>();
    409409
    410410        for (M member : dataSource.getMembers(relation)) {
     
    442442
    443443        } else {
    444             return new ArrayList<Restriction>(0);
     444            return new ArrayList<>(0);
    445445        }
    446446    }
     
    451451            W fromWay, Collection<N> viaNodes, Collection<W> viaWays, Collection<W> toWays) {
    452452
    453         Collection<SegmentNode> nodesCreatedFromViaNodes = new ArrayList<SegmentNode>(viaNodes.size());
     453        Collection<SegmentNode> nodesCreatedFromViaNodes = new ArrayList<>(viaNodes.size());
    454454        for (N viaNode : viaNodes) {
    455455            if (nodeCreationMap.containsKey(viaNode)) {
     
    483483         * or segments starting and ending with nodes created from via nodes */
    484484
    485         ArrayList<Segment> viaSegments = new ArrayList<Segment>();
     485        ArrayList<Segment> viaSegments = new ArrayList<>();
    486486
    487487        for (W viaWay : viaWays) {
     
    502502
    503503        Set<SegmentNode> nodesCreatedFromViaMembers
    504         = new HashSet<SegmentNode>(nodesCreatedFromViaNodes);
     504        = new HashSet<>(nodesCreatedFromViaNodes);
    505505
    506506        for (W viaWay : viaWays) {
     
    518518
    519519        Segment fromSegment = null;
    520         Collection<Segment> toSegments = new ArrayList<Segment>();
     520        Collection<Segment> toSegments = new ArrayList<>();
    521521
    522522        for (Segment possibleFromSegment : waySegmentMap.get(fromWay)) {
     
    595595        /* create restriction */
    596596
    597         Collection<Restriction> results = new ArrayList<Restriction>(1);
     597        Collection<Restriction> results = new ArrayList<>(1);
    598598        results.add(new RestrictionImpl(fromSegment, viaSegments, toSegments));
    599599        return results;
     
    618618        assert waySegmentMap != null;
    619619
    620         Collection<Restriction> results = new LinkedList<Restriction>();
     620        Collection<Restriction> results = new LinkedList<>();
    621621
    622622        for (N node : nodeCreationMap.keySet()) {
     
    645645    private Map<RoadPropertyType<?>, Object> getWayPropertyMap(W way, boolean forward) {
    646646        Map<RoadPropertyType<?>, Object> propertyValues;
    647         propertyValues = new HashMap<RoadPropertyType<?>, Object>();
     647        propertyValues = new HashMap<>();
    648648        for (RoadPropertyType<?> property : properties) {
    649649            Object value = property.evaluateW(way, forward, accessParameters, dataSource);
     
    661661    private Map<RoadPropertyType<?>, Object> getNodePropertyMap(N node) {
    662662        Map<RoadPropertyType<?>, Object> propertyValues;
    663         propertyValues = new HashMap<RoadPropertyType<?>, Object>();
     663        propertyValues = new HashMap<>();
    664664        for (RoadPropertyType<?> property : properties) {
    665665            Object value = property.evaluateN(node, accessParameters, dataSource);
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/FloatPropertyColorScheme.java

    r23189 r30737  
    3838
    3939        this.propertyClass = propertyClass;
    40         this.colorMap = new HashMap<Float, Color>(colorMap);
     40        this.colorMap = new HashMap<>(colorMap);
    4141        this.defaultColor = defaultColor;
    4242    }
     
    6565    public Color getNodeColor(GraphNode node) {
    6666
    67         List<Color> segmentColors = new ArrayList<Color>();
     67        List<Color> segmentColors = new ArrayList<>();
    6868
    6969
     
    106106        } else {
    107107
    108             LinkedList<Float> valuesWithDefinedColor = new LinkedList<Float>(colorMap.keySet());
     108            LinkedList<Float> valuesWithDefinedColor = new LinkedList<>(colorMap.keySet());
    109109            Collections.sort(valuesWithDefinedColor);
    110110
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/InclineColorScheme.java

    r23189 r30737  
    1515
    1616    static {
    17         COLOR_MAP = new HashMap<Float, Color>();
     17        COLOR_MAP = new HashMap<>();
    1818        COLOR_MAP.put(-30f, Color.BLUE);
    1919        COLOR_MAP.put(0f, Color.WHITE);
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxheightColorScheme.java

    r23189 r30737  
    1515
    1616    static {
    17         COLOR_MAP = new HashMap<Float, Color>();
     17        COLOR_MAP = new HashMap<>();
    1818        COLOR_MAP.put(0f, new Color(0, 0, 50));
    1919        COLOR_MAP.put(10f, new Color(100, 100, 255));
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxspeedColorScheme.java

    r23189 r30737  
    1515
    1616    static {
    17         COLOR_MAP = new HashMap<Float, Color>();
     17        COLOR_MAP = new HashMap<>();
    1818        COLOR_MAP.put(0f, new Color(50, 0, 0));
    1919        COLOR_MAP.put(30f, Color.RED);
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxweightColorScheme.java

    r23189 r30737  
    1515
    1616    static {
    17         COLOR_MAP = new HashMap<Float, Color>();
     17        COLOR_MAP = new HashMap<>();
    1818        COLOR_MAP.put(0f, new Color(0, 0, 50));
    1919        COLOR_MAP.put(20f, new Color(100, 100, 255));
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/GraphViewPlugin.java

    r30145 r30737  
    5757
    5858    static {
    59         PROPERTIES = new LinkedList<RoadPropertyType<?>>();
     59        PROPERTIES = new LinkedList<>();
    6060        PROPERTIES.add(new RoadIncline());
    6161        PROPERTIES.add(new RoadMaxaxleload());
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/data/JOSMDataSource.java

    r23189 r30737  
    3939
    4040    public Iterable<Node> getNodes(Way way) {
    41         return new FilteredOsmPrimitiveIterable<Node>(way.getNodes());
     41        return new FilteredOsmPrimitiveIterable<>(way.getNodes());
    4242    }
    4343
    4444    public Iterable<Node> getNodes() {
    45         return new FilteredOsmPrimitiveIterable<Node>(Main.main.getCurrentDataSet().getNodes());
     45        return new FilteredOsmPrimitiveIterable<>(Main.main.getCurrentDataSet().getNodes());
    4646    }
    4747
     
    5151
    5252    public Iterable<Way> getWays() {
    53         return new FilteredOsmPrimitiveIterable<Way>(Main.main.getCurrentDataSet().getWays());
     53        return new FilteredOsmPrimitiveIterable<>(Main.main.getCurrentDataSet().getWays());
    5454    }
    5555
     
    9797    private static final TagGroup EMPTY_TAG_GROUP;
    9898    static {
    99         Map<String, String> emptyMap = new HashMap<String, String>(0);
     99        Map<String, String> emptyMap = new HashMap<>(0);
    100100        EMPTY_TAG_GROUP = new MapBasedTagGroup(emptyMap);
    101101    }
     
    204204    }
    205205
    206     private final Set<DataSourceObserver> observers = new HashSet<DataSourceObserver>();
     206    private final Set<DataSourceObserver> observers = new HashSet<>();
    207207
    208208    public void addObserver(DataSourceObserver observer) {
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/AccessParameterDialog.java

    r29854 r30737  
    5050
    5151    static {
    52         FLOAT_PROPERTIES = new LinkedHashMap<VehiclePropertyType<Float>, String>();
     52        FLOAT_PROPERTIES = new LinkedHashMap<>();
    5353        FLOAT_PROPERTIES.put(VehiclePropertyTypes.HEIGHT, tr("height (m)"));
    5454        FLOAT_PROPERTIES.put(VehiclePropertyTypes.WIDTH, tr("width (m)"));
     
    132132
    133133        private final Map<AccessType, JCheckBox> accessTypeCheckBoxes =
    134             new EnumMap<AccessType, JCheckBox>(AccessType.class);
     134            new EnumMap<>(AccessType.class);
    135135
    136136        public AccessTypesPanel(PreferenceAccessParameters initialParameters) {
     
    152152        public Collection<AccessType> getUsableAccessTypes() {
    153153
    154             Collection<AccessType> usableAccessTypes = new LinkedList<AccessType>();
     154            Collection<AccessType> usableAccessTypes = new LinkedList<>();
    155155
    156156            for (AccessType accessType : AccessType.values()) {
     
    169169
    170170        private final Map<VehiclePropertyType<Float>, JTextField> floatPropertyTextFields =
    171             new HashMap<VehiclePropertyType<Float>, JTextField>();
     171            new HashMap<>();
    172172
    173173        public VehiclePropertiesPanel(PreferenceAccessParameters initialParameters) {
     
    200200
    201201            Map<VehiclePropertyType<?>, String> vehiclePropertyStrings =
    202                 new HashMap<VehiclePropertyType<?>, String>();
     202                new HashMap<>();
    203203
    204204            for (VehiclePropertyType<Float> vehicleProperty : floatPropertyTextFields.keySet()) {
     
    310310
    311311            Map<VehiclePropertyType<?>, String> vehiclePropertyStrings =
    312                 new HashMap<VehiclePropertyType<?>, String>();
     312                new HashMap<>();
    313313
    314314            String incUpString = inclineUpTextField.getText();
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewDialog.java

    r30532 r30737  
    7373        this.plugin = plugin;
    7474
    75         availableColorSchemes = new LinkedHashMap<String, ColorScheme>();
     75        availableColorSchemes = new LinkedHashMap<>();
    7676
    7777        availableColorSchemes.put(tr("default"),
     
    238238        } else {
    239239
    240             rulesetFiles = new LinkedList<File>();
     240            rulesetFiles = new LinkedList<>();
    241241
    242242            File[] filesInRulesetFolder = preferences.getRulesetFolder().listFiles();
     
    273273
    274274        String activeBookmarkName = preferences.getCurrentParameterBookmarkName();
    275         Set<String> bookmarkNames = new HashSet<String>(preferences.getParameterBookmarks().keySet());
     275        Set<String> bookmarkNames = new HashSet<>(preferences.getParameterBookmarks().keySet());
    276276
    277277        bookmarkComboBox.removeAllItems();
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewPreferenceEditor.java

    r30532 r30737  
    101101
    102102        parameterBookmarks =
    103             new HashMap<String, PreferenceAccessParameters>(preferences.getParameterBookmarks());
     103            new HashMap<>(preferences.getParameterBookmarks());
    104104
    105105    }
     
    349349                    parameterBookmarks.get(selectedBookmarkName);
    350350
    351                 Collection<String> otherBookmarkNames = new LinkedList<String>();
     351                Collection<String> otherBookmarkNames = new LinkedList<>();
    352352                for (String bookmarkName : parameterBookmarks.keySet()) {
    353353                    if (!bookmarkName.equals(selectedBookmarkName)) {
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/GraphViewPreferenceDefaults.java

    r23189 r30737  
    3232
    3333        Map<VehiclePropertyType<?>, String> propertyStringMap =
    34             new HashMap<VehiclePropertyType<?>, String>();
     34            new HashMap<>();
    3535
    3636        try {
     
    4848
    4949            Map<String, PreferenceAccessParameters> result =
    50                 new HashMap<String, PreferenceAccessParameters>();
     50                new HashMap<>();
    5151
    5252            Collection<AccessType> accessTypes =
     
    5656            {
    5757                Map<VehiclePropertyType<?>, String> propertyMap =
    58                     new HashMap<VehiclePropertyType<?>, String>();
     58                    new HashMap<>();
    5959
    6060                PreferenceAccessParameters accessParameters =
     
    6767            {
    6868                Map<VehiclePropertyType<?>, String> propertyMap =
    69                     new HashMap<VehiclePropertyType<?>, String>();
     69                    new HashMap<>();
    7070                propertyMap.put(VehiclePropertyTypes.WEIGHT, "3.5");
    7171
     
    7979            {
    8080                Map<VehiclePropertyType<?>, String> propertyMap =
    81                     new HashMap<VehiclePropertyType<?>, String>();
     81                    new HashMap<>();
    8282
    8383                PreferenceAccessParameters accessParameters =
     
    9090            {
    9191                Map<VehiclePropertyType<?>, String> propertyMap =
    92                     new HashMap<VehiclePropertyType<?>, String>();
     92                    new HashMap<>();
    9393
    9494                PreferenceAccessParameters accessParameters =
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/GraphViewPreferences.java

    r27760 r30737  
    146146
    147147        this.parameterBookmarks =
    148             new HashMap<String, PreferenceAccessParameters>(parameterBookmarks);
     148            new HashMap<>(parameterBookmarks);
    149149    }
    150150
     
    325325
    326326    private static final Map<VehiclePropertyType<?>, String> VEHICLE_PROPERTY_TYPE_NAME_MAP =
    327         new HashMap<VehiclePropertyType<?>, String>();
     327        new HashMap<>();
    328328
    329329
     
    412412
    413413        Map<String, PreferenceAccessParameters> resultMap =
    414             new HashMap<String, PreferenceAccessParameters>();
     414            new HashMap<>();
    415415
    416416        String[] bookmarkStrings = string.split("\\|");
     
    435435
    436436            String[] accessTypeStrings = matcher.group(3).split(",");
    437             Collection<AccessType> accessTypes = new LinkedList<AccessType>();
     437            Collection<AccessType> accessTypes = new LinkedList<>();
    438438            for (String accessTypeString : accessTypeStrings) {
    439439                AccessType accessType = AccessType.valueOf(accessTypeString);
     
    446446            String[] vehiclePropertyStrings = matcher.group(4).split(",");
    447447            Map<VehiclePropertyType<?>, String> vehiclePropertyMap =
    448                 new HashMap<VehiclePropertyType<?>, String>();
     448                new HashMap<>();
    449449
    450450            for (String vehiclePropertyString : vehiclePropertyStrings) {
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/PreferenceAccessParameters.java

    r23189 r30737  
    7979        this.accessClass = accessClass;
    8080
    81         accessTypeUsableMap = new EnumMap<AccessType, Boolean>(AccessType.class);
     81        accessTypeUsableMap = new EnumMap<>(AccessType.class);
    8282        for (AccessType accessType : AccessType.values()) {
    8383            accessTypeUsableMap.put(accessType, usableAccessTypes.contains(accessType));
     
    8787
    8888        this.vehiclePropertyStrings = Collections.unmodifiableMap(
    89                 new HashMap<VehiclePropertyType<?>, String>(vehiclePropertyStrings));
     89                new HashMap<>(vehiclePropertyStrings));
    9090
    91         this.vehiclePropertyValues = new HashMap<VehiclePropertyType<?>, Object>();
     91        this.vehiclePropertyValues = new HashMap<>();
    9292        for (VehiclePropertyType<?> vehiclePropertyType : vehiclePropertyStrings.keySet()) {
    9393            String propertyValueString = vehiclePropertyStrings.get(vehiclePropertyType);
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/VehiclePropertyStringParser.java

    r26465 r30737  
    132132
    133133            String[] surfaces = propertyValueString.split(";\\s*");
    134             Collection<String> surfaceBlacklist = new ArrayList<String>(surfaces.length);
     134            Collection<String> surfaceBlacklist = new ArrayList<>(surfaces.length);
    135135            for (String surface : surfaces) {
    136136                for (char nameChar : surface.toCharArray()) {
Note: See TracChangeset for help on using the changeset viewer.