Ignore:
Timestamp:
2013-09-20T22:44:07+02:00 (13 years ago)
Author:
Don-vip
Message:

Sonar - fix some issues in data.validation.tests

File:
1 edited

Legend:

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

    r6085 r6240  
    3333    protected static final int NAME_TRANSLATION_MISSING = 1502;
    3434
     35    /**
     36     * Constructs a new {@code NameMismatch} test.
     37     */
    3538    public NameMismatch() {
    3639        super(tr("Missing name:* translation"),
     
    5962        for (Entry<String, String> entry : p.getKeys().entrySet()) {
    6063            if (entry.getKey().startsWith("name:")) {
    61                 String name_s = entry.getValue();
    62                 if (name_s != null) {
    63                     names.add(name_s);
     64                String n = entry.getValue();
     65                if (n != null) {
     66                    names.add(n);
    6467                }
    6568            }
     
    7477                    tr("A name is missing, even though name:* exists."),
    7578                    NAME_MISSING, p));
    76         return;
    77     }
     79            return;
     80        }
    7881
    7982        if (names.contains(name)) return;
     
    8285        Check if this is the case. */
    8386
    84         String[] split_names = name.split(" - ");
    85         if (split_names.length == 1) {
     87        String[] splitNames = name.split(" - ");
     88        if (splitNames.length == 1) {
    8689            /* The name is not composed of multiple parts. Complain. */
    8790            missingTranslation(p);
     
    9093
    9194        /* Check that each part corresponds to a translated name:*. */
    92         for (String n : split_names) {
     95        for (String n : splitNames) {
    9396            if (!names.contains(n)) {
    9497                missingTranslation(p);
Note: See TracChangeset for help on using the changeset viewer.