Changeset 11739 in josm


Ignore:
Timestamp:
2017-03-17T23:03:26+01:00 (8 years ago)
Author:
Don-vip
Message:

enable more PMD rules

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java

    r11711 r11739  
    4242        if (targetLayer == null)
    4343            return;
    44         final Object actionName = MergeLayerAction.this.getValue(NAME);
     44        final Object actionName = getValue(NAME);
    4545        Main.worker.submit(() -> {
    4646                final long start = System.currentTimeMillis();
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java

    r11608 r11739  
    204204            if (area != null) {
    205205                for (Way wInner : polygon.getInnerWays()) {
    206                     AreaElement areaInner = ElemStyles.getAreaElemStyle(wInner, false);
    207 
    208                     if (areaInner != null && area.equals(areaInner)) {
     206                    if (area.equals(ElemStyles.getAreaElemStyle(wInner, false))) {
    209207                        errors.add(TestError.builder(this, Severity.OTHER, INNER_STYLE_MISMATCH)
    210208                                .message(tr("With the currently used mappaint style the style for inner way equals the multipolygon style"))
  • trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java

    r10217 r11739  
    239239     */
    240240    public boolean isCurrentUser(String username) {
    241         return username != null && this.userName != null && this.userName.equals(username);
     241        return this.userName != null && this.userName.equals(username);
    242242    }
    243243
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r11620 r11739  
    271271                for (int i = gpxLst.size() - 1; i >= 0; i--) {
    272272                    GpxDataWrapper wrapper = gpxLst.get(i);
    273                     if (wrapper.file != null && sel.equals(wrapper.file)) {
     273                    if (sel.equals(wrapper.file)) {
    274274                        cbGpx.setSelectedIndex(i);
    275275                        if (!sel.getName().equals(wrapper.name)) {
  • trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java

    r11649 r11739  
    228228    private static String makeCollectionNice(Collection<?> value) {
    229229        int lines = 0;
    230         StringBuilder str = new StringBuilder();
     230        StringBuilder str = new StringBuilder(32);
    231231        for (Object e : value) {
    232232            str.append("\n    - ");
     
    246246    public String toString() {
    247247        return "ReportedException [thread=" + caughtOnThread + ", exception=" + getCause()
    248                 + ", methodWarningFrom=" + methodWarningFrom + "]";
     248                + ", methodWarningFrom=" + methodWarningFrom + ']';
    249249    }
    250250
  • trunk/tools/pmd/josm-ruleset.xml

    r11713 r11739  
    2222        <exclude name="MethodArgumentCouldBeFinal"/>
    2323  </rule>
    24   <rule ref="rulesets/java/strictexception.xml"/>
    25   <rule ref="rulesets/java/strings.xml"/>
    26   <rule ref="rulesets/java/typeresolution.xml"/>
     24  <rule ref="rulesets/java/strictexception.xml"/> -->
     25  <rule ref="rulesets/java/strings.xml">
     26        <exclude name="AvoidDuplicateLiterals"/>
     27        <exclude name="ConsecutiveLiteralAppends"/>
     28        <exclude name="AvoidStringBufferField"/>
     29        <exclude name="StringToString"/>
     30        <exclude name="UselessStringValueOf"/>
     31  </rule>
     32  <rule ref="rulesets/java/typeresolution.xml">
     33        <exclude name="LooseCoupling"/>
     34        <exclude name="SignatureDeclareThrowsException"/>
     35  </rule>
     36  <rule ref="rulesets/java/typeresolution.xml/SignatureDeclareThrowsException">
     37    <properties>
     38        <property name="violationSuppressXPath" value="//MethodDeclaration/../Annotation/MarkerAnnotation/Name[@Image='Override']"/>
     39        <property name="IgnoreJUnitCompletely" value="true"/>
     40    </properties>
     41  </rule>
    2742  <rule ref="rulesets/java/unnecessary.xml">
    2843        <exclude name="UselessParentheses"/>
    29   </rule> -->
     44        <exclude name="UselessOverridingMethod"/>
     45  </rule>
    3046  <rule ref="rulesets/java/unusedcode.xml">
    3147        <exclude name="UnusedFormalParameter"/>
Note: See TracChangeset for help on using the changeset viewer.