Changeset 10462 in josm


Ignore:
Timestamp:
2016-06-23T02:12:21+02:00 (3 years ago)
Author:
Don-vip
Message:

sonar - Performance - Method passes constant String of length 1 to character overridden method

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r10300 r10462  
    863863    public String getExtendedUrl() {
    864864        return imageryType.getTypeString() + (defaultMaxZoom != 0
    865             ? ('['+(defaultMinZoom != 0 ? (Integer.toString(defaultMinZoom) + ',') : "")+defaultMaxZoom+"]") : "") + ':' + url;
     865            ? ('['+(defaultMinZoom != 0 ? (Integer.toString(defaultMinZoom) + ',') : "")+defaultMaxZoom+']') : "") + ':' + url;
    866866    }
    867867
  • trunk/src/org/openstreetmap/josm/gui/MapViewState.java

    r10458 r10462  
    344344        @Override
    345345        public String toString() {
    346             return "MapViewViewPoint [x=" + x + ", y=" + y + "]";
     346            return "MapViewViewPoint [x=" + x + ", y=" + y + ']';
    347347        }
    348348    }
     
    373373        @Override
    374374        public String toString() {
    375             return "MapViewEastNorthPoint [eastNorth=" + eastNorth + "]";
     375            return "MapViewEastNorthPoint [eastNorth=" + eastNorth + ']';
    376376        }
    377377    }
     
    417417
    418418        /**
    419          * Gets the real bounds that enclose this rectangle. 
     419         * Gets the real bounds that enclose this rectangle.
    420420         * This is computed respecting that the borders of this rectangle may not be a straignt line in latlon coordinates.
    421421         * @return The bounds.
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CacheContentsPanel.java

    r10043 r10462  
    237237                        int row = ret.convertRowIndexToModel(ret.getEditingRow());
    238238                        tableModel.setValueAt("0", row, 1);
    239                         cache.remove(ret.getValueAt(row, 0) + ":");
     239                        cache.remove(ret.getValueAt(row, 0).toString() + ':');
    240240                    }
    241241                });
  • trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java

    r8846 r10462  
    4040            if (locator == null)
    4141                return "";
    42             return "(" + locator.getLineNumber() + ',' + locator.getColumnNumber() + ')';
     42            return new StringBuilder().append('(').append(locator.getLineNumber())
     43                                      .append(',').append(locator.getColumnNumber()).append(')').toString();
    4344        }
    4445
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r10433 r10462  
    893893                    case typeArchive:
    894894                        if (archive != null) {
    895                             cacheName = "zip:"+archive.hashCode()+":"+cacheName;
     895                            cacheName = "zip:"+archive.hashCode()+':'+cacheName;
    896896                            ImageResource ir = cache.get(cacheName);
    897897                            if (ir != null) return ir;
  • trunk/test/unit/org/openstreetmap/josm/gui/MapViewStateTest.java

    r10398 r10462  
    136136        }
    137137    }
     138
     139    /**
     140     * Test {@link MapViewState.MapViewViewPoint#toString()} and {@link MapViewState.MapViewEastNorthPoint#toString()}
     141     */
     142    @Test
     143    public void testToString() {
     144        assertEquals("MapViewViewPoint [x=1.0, y=2.0]",
     145                state.getForView(1, 2).toString());
     146        assertEquals("MapViewEastNorthPoint [eastNorth=EastNorth[e=0.0, n=0.0]]",
     147                state.getPointFor(new EastNorth(0, 0)).toString());
     148    }
    138149}
Note: See TracChangeset for help on using the changeset viewer.