Ignore:
Timestamp:
2015-05-15T23:49:31+02:00 (9 years ago)
Author:
Don-vip
Message:

fix some Findbugs violations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/CachedLatLon.java

    r8308 r8357  
    99 *
    1010 * This class is convenient to use, but has relatively high memory costs.
    11  * It keeps a pointer to the last known projection in order to detect projection
    12  * changes.
     11 * It keeps a pointer to the last known projection in order to detect projection changes.
    1312 *
    1413 * Node and WayPoint have another, optimized, cache for projected coordinates.
    1514 */
    1615public class CachedLatLon extends LatLon {
     16
     17    private static final long serialVersionUID = 1L;
     18
    1719    private EastNorth eastNorth;
    1820    private transient Projection proj;
    1921
     22    /**
     23     * Constructs a new {@code CachedLatLon}.
     24     * @param lat latitude
     25     * @param lon longitude
     26     */
    2027    public CachedLatLon(double lat, double lon) {
    2128        super(lat, lon);
    2229    }
    2330
     31    /**
     32     * Constructs a new {@code CachedLatLon}.
     33     * @param coor lat/lon
     34     */
    2435    public CachedLatLon(LatLon coor) {
    2536        super(coor.lat(), coor.lon());
     
    2738    }
    2839
     40    /**
     41     * Constructs a new {@code CachedLatLon}.
     42     * @param eastNorth easting/northing
     43     */
    2944    public CachedLatLon(EastNorth eastNorth) {
    3045        super(Main.getProjection().eastNorth2latlon(eastNorth));
     
    3954     */
    4055    public final EastNorth getEastNorth() {
    41         if(proj != Main.getProjection())
    42         {
     56        if (proj != Main.getProjection()) {
    4357            proj = Main.getProjection();
    4458            eastNorth = proj.latlon2eastNorth(this);
     
    4660        return eastNorth;
    4761    }
    48     @Override public String toString() {
     62
     63    @Override
     64    public String toString() {
    4965        return "CachedLatLon[lat="+lat()+",lon="+lon()+"]";
    5066    }
    51 
    52     // Only for Node.get3892DebugInfo()
    53     public Projection getProjection() {
    54         return proj;
    55     }
    5667}
Note: See TracChangeset for help on using the changeset viewer.