Changeset 33286 in osm for applications/viewer


Ignore:
Timestamp:
2017-05-01T16:56:02+02:00 (8 years ago)
Author:
donvip
Message:

sonar - fix various issues

Location:
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Coordinate.java

    r31792 r33286  
    7676        }
    7777        final Coordinate other = (Coordinate) obj;
    78         if (!Objects.equals(this.data, other.data)) {
    79             return false;
    80         }
    81         return true;
     78        return Objects.equals(this.data, other.data);
    8279    }
    8380}
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapPolygonImpl.java

    r31792 r33286  
    2222    private List<? extends ICoordinate> points;
    2323
    24     public MapPolygonImpl(ICoordinate ... points) {
     24    public MapPolygonImpl(ICoordinate... points) {
    2525        this(null, null, points);
    2626    }
     
    3434    }
    3535
    36     public MapPolygonImpl(String name, ICoordinate ... points) {
     36    public MapPolygonImpl(String name, ICoordinate... points) {
    3737        this(null, name, points);
    3838    }
     
    4646    }
    4747
    48     public MapPolygonImpl(Layer layer, String name, ICoordinate ... points) {
     48    public MapPolygonImpl(Layer layer, String name, ICoordinate... points) {
    4949        this(layer, name, Arrays.asList(points), getDefaultStyle());
    5050    }
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Projected.java

    r33285 r33286  
    6767        }
    6868        final Projected other = (Projected) obj;
    69         if (!Objects.equals(this.data, other.data)) {
    70             return false;
    71         }
    72         return true;
     69        return Objects.equals(this.data, other.data);
    7370    }
    7471}
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java

    r33219 r33286  
    44import java.awt.Graphics;
    55import java.awt.Graphics2D;
    6 import java.awt.Point;
    76import java.awt.geom.AffineTransform;
    87import java.awt.image.BufferedImage;
     
    303302    @Override
    304303    public String toString() {
    305         StringBuilder sb = new StringBuilder("Tile ").append(key);
     304        StringBuilder sb = new StringBuilder(35).append("Tile ").append(key);
    306305        if (loading) {
    307306            sb.append(" [LOADING...]");
     
    352351        if (zoom != other.zoom)
    353352            return false;
    354         if (!getTileSource().equals(other.getTileSource())) {
    355             return false;
    356         }
    357         return true;
     353        return getTileSource().equals(other.getTileSource());
    358354    }
    359355
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TMSTileSource.java

    r33207 r33286  
    9191        double mercatorWidth = 2 * Math.PI * OsmMercator.EARTH_RADIUS;
    9292        double f = mercatorWidth * getTileSize() / osmMercator.getMaxPixels(zoom);
    93         return new TileXY((p.getEast() + mercatorWidth / 2) / f , (-p.getNorth() + mercatorWidth / 2) / f);
     93        return new TileXY((p.getEast() + mercatorWidth / 2) / f, (-p.getNorth() + mercatorWidth / 2) / f);
    9494    }
    9595
Note: See TracChangeset for help on using the changeset viewer.