Ignore:
Timestamp:
2015-05-11T10:52:33+02:00 (9 years ago)
Author:
Don-vip
Message:

code style - Useless parentheses around expressions should be removed to prevent any misunderstanding

Location:
trunk/src/org/openstreetmap/josm/data
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java

    r8318 r8345  
    5252        File cacheDir = new File(Main.pref.getCacheDirectory(), "jcs");
    5353
    54         if ((!cacheDir.exists() && !cacheDir.mkdirs()))
     54        if (!cacheDir.exists() && !cacheDir.mkdirs())
    5555            throw new IOException("Cannot access cache directory");
    5656
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java

    r8344 r8345  
    439439        urlConn.setRequestMethod("HEAD");
    440440        long lastModified = urlConn.getLastModified();
    441         return (
    442                 (attributes.getEtag() != null && attributes.getEtag().equals(urlConn.getRequestProperty("ETag"))) ||
    443                 (lastModified != 0 && lastModified <= attributes.getLastModification())
    444                 );
     441        return (attributes.getEtag() != null && attributes.getEtag().equals(urlConn.getRequestProperty("ETag"))) ||
     442               (lastModified != 0 && lastModified <= attributes.getLastModification());
    445443    }
    446444
  • trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java

    r8308 r8345  
    132132     */
    133133    public boolean equalsEpsilon(EastNorth other, double e) {
    134         return (Math.abs(x - other.x) < e && Math.abs(y - other.y) < e);
     134        return Math.abs(x - other.x) < e && Math.abs(y - other.y) < e;
    135135    }
    136136}
  • trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java

    r7509 r8345  
    99
    1010    public static final int NR_LEVELS = 24;
    11     public static final double WORLD_PARTS = (1 << NR_LEVELS);
     11    public static final double WORLD_PARTS = 1 << NR_LEVELS;
    1212
    1313    public static final int TILES_PER_LEVEL_SHIFT = 2; // Has to be 2. Other parts of QuadBuckets code rely on it
     
    5353        for (i = NR_LEVELS-1; i >= 0; i--)
    5454        {
    55             long xbit = ((x >> i) & 1);
    56             long ybit = ((y >> i) & 1);
     55            long xbit = (x >> i) & 1;
     56            long ybit = (y >> i) & 1;
    5757            tile <<= 2;
    5858            // Note that x is the MSB
  • trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java

    r8308 r8345  
    360360    public synchronized boolean hasExactMatch(Projection projection, double pixelPerDegree, double east, double north) {
    361361        ProjectionEntries projectionEntries = getProjectionEntries(projection);
    362         CacheEntry entry = findEntry(projectionEntries, pixelPerDegree, east, north);
    363         return (entry != null);
     362        return findEntry(projectionEntries, pixelPerDegree, east, north) != null;
    364363    }
    365364
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r8338 r8345  
    519519     */
    520520    public boolean isDisabledAndHidden() {
    521         return (((flags & FLAG_DISABLED) != 0) && ((flags & FLAG_HIDE_IF_DISABLED) != 0));
     521        return ((flags & FLAG_DISABLED) != 0) && ((flags & FLAG_HIDE_IF_DISABLED) != 0);
    522522    }
    523523
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r8338 r8345  
    363363        boolean locked = writeLock();
    364364        try {
    365             boolean closed = (lastNode() == n && firstNode() == n);
     365            boolean closed = lastNode() == n && firstNode() == n;
    366366            int i;
    367367            List<Node> copy = getNodes();
     
    391391        boolean locked = writeLock();
    392392        try {
    393             boolean closed = (lastNode() == firstNode() && selection.contains(lastNode()));
     393            boolean closed = lastNode() == firstNode() && selection.contains(lastNode());
    394394            List<Node> copy = new ArrayList<>();
    395395
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java

    r8291 r8345  
    184184        double xd = Math.abs(p1.getX()-p2.getX());
    185185        double yd = Math.abs(p1.getY()-p2.getY());
    186         return (xd+yd > space);
     186        return xd + yd > space;
    187187    }
    188188
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r8342 r8345  
    866866            return;
    867867        g.setColor(highlightColorTransparent);
    868         float w = (line.getLineWidth() + highlightLineWidth);
     868        float w = line.getLineWidth() + highlightLineWidth;
    869869        if (useWiderHighlight) w+=widerHighlight;
    870870        while(w >= line.getLineWidth()) {
     
    995995         */
    996996        double distanceFromVia=14;
    997         double dx = (pFrom.x >= pVia.x) ? (pFrom.x - pVia.x) : (pVia.x - pFrom.x);
    998         double dy = (pFrom.y >= pVia.y) ? (pFrom.y - pVia.y) : (pVia.y - pFrom.y);
     997        double dx = pFrom.x >= pVia.x ? pFrom.x - pVia.x : pVia.x - pFrom.x;
     998        double dy = pFrom.y >= pVia.y ? pFrom.y - pVia.y : pVia.y - pFrom.y;
    999999
    10001000        double fromAngle;
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java

    r8325 r8345  
    264264            }
    265265
    266             final int size = max((ds.isSelected(n) ? selectedNodeSize : 0),
    267                     (isNodeTagged(n) ? taggedNodeSize : 0),
    268                     (n.isConnectionNode() ? connectionNodeSize : 0),
     266            final int size = max(ds.isSelected(n) ? selectedNodeSize : 0,
     267                    isNodeTagged(n) ? taggedNodeSize : 0,
     268                    n.isConnectionNode() ? connectionNodeSize : 0,
    269269                    unselectedNodeSize);
    270270
  • trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java

    r8332 r8345  
    276276
    277277    public boolean isLoaded() {
    278         return (topLevelSubGrid != null);
     278        return topLevelSubGrid != null;
    279279    }
    280280
  • trunk/src/org/openstreetmap/josm/data/projection/proj/LambertConformalConic.java

    r6883 r8345  
    129129    protected double t(double lat_rad) {
    130130        return tan(PI/4 - lat_rad / 2.0)
    131             / pow(( (1.0 - e * sin(lat_rad)) / (1.0 + e * sin(lat_rad))) , e/2);
     131            / pow((1.0 - e * sin(lat_rad)) / (1.0 + e * sin(lat_rad)), e/2);
    132132    }
    133133
  • trunk/src/org/openstreetmap/josm/data/projection/proj/TransverseMercator.java

    r6362 r8345  
    229229
    230230        /* Precalculate epsilon */
    231         double epsilon = (315.0 * pow(n, 4.0) / 512.0);
     231        double epsilon = 315.0 * pow(n, 4.0) / 512.0;
    232232
    233233        /* Now calculate the sum of the series and return */
     
    276276
    277277        /* Precalculate epsilon_ (Eq. 10.22) */
    278         double epsilon_ = (1097.0 * pow(n, 4.0) / 512.0);
     278        double epsilon_ = 1097.0 * pow(n, 4.0) / 512.0;
    279279
    280280        /* Now calculate the sum of the series (Eq. 10.21) */
     
    284284            + (epsilon_ * sin(8.0 * y_));
    285285    }
    286 
    287286}
  • trunk/src/org/openstreetmap/josm/data/validation/routines/DomainValidator.java

    r8290 r8345  
    170170     */
    171171    public boolean isValidInfrastructureTld(String iTld) {
    172         return Arrays.binarySearch(INFRASTRUCTURE_TLDS, (chompLeadingDot(iTld.toLowerCase()))) >= 0;
     172        return Arrays.binarySearch(INFRASTRUCTURE_TLDS, chompLeadingDot(iTld.toLowerCase())) >= 0;
    173173    }
    174174
  • trunk/src/org/openstreetmap/josm/data/validation/routines/RegexValidator.java

    r7937 r8345  
    107107        }
    108108        patterns = new Pattern[regexs.length];
    109         int flags =  (caseSensitive ? 0: Pattern.CASE_INSENSITIVE);
     109        int flags = caseSensitive ? 0: Pattern.CASE_INSENSITIVE;
    110110        for (int i = 0; i < regexs.length; i++) {
    111111            if (regexs[i] == null || regexs[i].length() == 0) {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/Coastlines.java

    r8342 r8345  
    237237    public boolean isFixable(TestError testError) {
    238238        if (testError.getTester() instanceof Coastlines)
    239             return (testError.getCode() == REVERSED_COASTLINE);
     239            return testError.getCode() == REVERSED_COASTLINE;
    240240
    241241        return false;
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java

    r8338 r8345  
    309309            }
    310310        }
    311         return (relationsWithRelations <= 1);
     311        return relationsWithRelations <= 1;
    312312    }
    313313}
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java

    r8338 r8345  
    323323            }
    324324        }
    325         return (waysWithRelations <= 1);
     325        return waysWithRelations <= 1;
    326326    }
    327327}
Note: See TracChangeset for help on using the changeset viewer.