Ignore:
Timestamp:
2024-06-11T23:53:20+02:00 (4 months ago)
Author:
taylor.smock
Message:

Cleanup some new PMD warnings from PMD 7.x

I haven't updated to PMD 7.x in ivy/maven yet since I still have 83 PMD violations
to go through, and I don't know (yet) if any of them were supposed to be ignored
by the xpath expressions in tools/pmd/josm-ruleset.xml.

I may re-enable some of the PMD checks I've temporarily disabled prior to committing
the update for PMD.

Additionally cleanup some SonarLint issues in the modified files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/template_engine/Variable.java

    r16488 r19101  
    6262    @Override
    6363    public boolean isValid(TemplateEngineDataProvider dataProvider) {
    64         if (special && SPECIAL_VALUE_EVERYTHING.equals(variableName))
    65             return true;
    66         else
    67             return dataProvider.getTemplateValue(variableName, special) != null;
     64        return (special && SPECIAL_VALUE_EVERYTHING.equals(variableName))
     65            || dataProvider.getTemplateValue(variableName, special) != null;
    6866    }
    6967
     
    9492            return false;
    9593        Variable other = (Variable) obj;
    96         if (special != other.special)
    97             return false;
    98         if (variableName == null) {
    99             if (other.variableName != null)
    100                 return false;
    101         } else if (!variableName.equals(other.variableName))
    102             return false;
    103         return true;
     94        return this.special == other.special && Objects.equals(this.variableName, other.variableName);
    10495    }
    10596}
Note: See TracChangeset for help on using the changeset viewer.