Changeset 7986 in josm


Ignore:
Timestamp:
2015-01-25T03:15:10+01:00 (10 years ago)
Author:
Don-vip
Message:

fix #10945 - restore warning at INFO level when relations all have the same name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java

    r7947 r7986  
    5858        }
    5959        public AddressError(int code, Collection<OsmPrimitive> collection, String message, String description, String englishDescription) {
    60             super(Addresses.this, Severity.WARNING, message, description, englishDescription, code, collection);
     60            this(code, Severity.WARNING, collection, message, description, englishDescription);
     61        }
     62        public AddressError(int code, Severity severity, Collection<OsmPrimitive> collection, String message, String description,
     63                String englishDescription) {
     64            super(Addresses.this, severity, message, description, englishDescription, code, collection);
    6165        }
    6266    }
     
    7882        }
    7983        if (list.size() > 1) {
    80             // no warning if several relations have the same name, see #10945
     84            Severity level;
     85            // warning level only if several relations have different names, see #10945
    8186            final String name = list.get(0).get("name");
    8287            if (name == null || Utils.filter(list, new Predicate<Relation>() {
     
    8691                }
    8792            }).size() < list.size()) {
    88                 List<OsmPrimitive> errorList = new ArrayList<OsmPrimitive>(list);
    89                 errorList.add(0, p);
    90                 errors.add(new AddressError(MULTIPLE_STREET_RELATIONS, errorList, tr("Multiple associatedStreet relations")));
    91             }
     93                level = Severity.WARNING;
     94            } else {
     95                level = Severity.OTHER;
     96            }
     97            List<OsmPrimitive> errorList = new ArrayList<OsmPrimitive>(list);
     98            errorList.add(0, p);
     99            errors.add(new AddressError(MULTIPLE_STREET_RELATIONS, level, errorList,
     100                    tr("Multiple associatedStreet relations"), null, null));
    92101        }
    93102        return list;
Note: See TracChangeset for help on using the changeset viewer.