Ignore:
Timestamp:
2014-04-26T17:39:23+02:00 (11 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/data/osm/OsmPrimitive.java

    r6890 r7005  
    121121    public static <T extends OsmPrimitive>  List<T> getFilteredList(Collection<OsmPrimitive> list, Class<T> type) {
    122122        if (list == null) return Collections.emptyList();
    123         List<T> ret = new LinkedList<T>();
     123        List<T> ret = new LinkedList<>();
    124124        for(OsmPrimitive p: list) {
    125125            if (type.isInstance(p)) {
     
    142142     */
    143143    public static <T extends OsmPrimitive> Set<T> getFilteredSet(Collection<OsmPrimitive> set, Class<T> type) {
    144         Set<T> ret = new LinkedHashSet<T>();
     144        Set<T> ret = new LinkedHashSet<>();
    145145        if (set != null) {
    146146            for(OsmPrimitive p: set) {
     
    161161     */
    162162    public static Set<OsmPrimitive> getReferrer(Collection<? extends OsmPrimitive> primitives) {
    163         HashSet<OsmPrimitive> ret = new HashSet<OsmPrimitive>();
     163        HashSet<OsmPrimitive> ret = new HashSet<>();
    164164        if (primitives == null || primitives.isEmpty()) return ret;
    165165        for (OsmPrimitive p: primitives) {
     
    632632    public static Collection<String> getUninterestingKeys() {
    633633        if (uninteresting == null) {
    634             LinkedList<String> l = new LinkedList<String>(Arrays.asList(
     634            LinkedList<String> l = new LinkedList<>(Arrays.asList(
    635635                "source", "source_ref", "source:", "comment",
    636636                "converted_by", "watch", "watch:",
     
    731731     */
    732732    public Map<String, String> getInterestingTags() {
    733         Map<String, String> result = new HashMap<String, String>();
     733        Map<String, String> result = new HashMap<>();
    734734        String[] keys = this.keys;
    735735        if (keys != null) {
     
    997997        checkDataset();
    998998        Object referrers = this.referrers;
    999         List<OsmPrimitive> result = new ArrayList<OsmPrimitive>();
     999        List<OsmPrimitive> result = new ArrayList<>();
    10001000        if (referrers != null) {
    10011001            if (referrers instanceof OsmPrimitive) {
     
    12981298    public Collection<String> getTemplateKeys() {
    12991299        Collection<String> keySet = keySet();
    1300         List<String> result = new ArrayList<String>(keySet.size() + 2);
     1300        List<String> result = new ArrayList<>(keySet.size() + 2);
    13011301        result.add(SPECIAL_VALUE_ID);
    13021302        result.add(SPECIAL_VALUE_LOCAL_NAME);
     
    13311331     */
    13321332    public static Set<Relation> getParentRelations(Collection<? extends OsmPrimitive> primitives) {
    1333         HashSet<Relation> ret = new HashSet<Relation>();
     1333        HashSet<Relation> ret = new HashSet<>();
    13341334        for (OsmPrimitive w : primitives) {
    13351335            ret.addAll(OsmPrimitive.getFilteredList(w.getReferrers(), Relation.class));
Note: See TracChangeset for help on using the changeset viewer.