Ignore:
Timestamp:
2015-06-02T16:41:37+02:00 (9 years ago)
Author:
Don-vip
Message:

remove extra whitespaces

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

Legend:

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

    r8308 r8444  
    6969
    7070    private static final String cDms60 = cDmsSecondFormatter.format(60.0);
    71     private static final String cDms00 = cDmsSecondFormatter.format( 0.0);
     71    private static final String cDms00 = cDmsSecondFormatter.format(0.0);
    7272    private static final String cDm60 = cDmMinuteFormatter.format(60.0);
    73     private static final String cDm00 = cDmMinuteFormatter.format( 0.0);
     73    private static final String cDm00 = cDmMinuteFormatter.format(0.0);
    7474
    7575    /**
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java

    r8418 r8444  
    150150        for (ImageryInfo def : defaultLayers) {
    151151            // temporary migration code, so all user preferences will get updated with new settings from JOSM site (can be removed ~Dez. 2015)
    152             if (def.getNoTileHeaders() != null || def.getTileSize() > 0 || def.getMetadataHeaders() != null ) {
     152            if (def.getNoTileHeaders() != null || def.getTileSize() > 0 || def.getMetadataHeaders() != null) {
    153153                for (ImageryInfo i: layers) {
    154154                    if (isSimilar(def,  i)) {
  • trunk/src/org/openstreetmap/josm/data/osm/ChangesetCache.java

    r8338 r8444  
    134134        DefaultChangesetCacheEvent e = new DefaultChangesetCacheEvent(this);
    135135        remove(id, e);
    136         if (! e.isEmpty()) {
     136        if (!e.isEmpty()) {
    137137            fireChangesetCacheEvent(e);
    138138        }
     
    160160            remove(cs.getId(), evt);
    161161        }
    162         if (! evt.isEmpty()) {
     162        if (!evt.isEmpty()) {
    163163            fireChangesetCacheEvent(evt);
    164164        }
  • trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java

    r8338 r8444  
    7979     */
    8080    protected void mergePrimitive(OsmPrimitive source, Collection<? extends OsmPrimitive> candidates) {
    81         if (!source.isNew() ) {
     81        if (!source.isNew()) {
    8282            // try to merge onto a matching primitive with the same defined id
    8383            //
     
    319319            throw new DataIntegrityProblemException(tr("Conflict in ''visible'' attribute for object of type {0} with id {1}",
    320320                    target.getType(), target.getId()));
    321         else if (target.isDeleted() && ! source.isDeleted() && target.getVersion() == source.getVersion()) {
     321        else if (target.isDeleted() && !source.isDeleted() && target.getVersion() == source.getVersion()) {
    322322            // same version, but target is deleted. Assume target takes precedence
    323323            // otherwise too many conflicts when refreshing from the server
     
    331331                }
    332332            }
    333         } else if (! target.isModified() && source.isDeleted()) {
     333        } else if (!target.isModified() && source.isDeleted()) {
    334334            // target not modified. We can assume that source is the most recent version,
    335335            // so mark it to be deleted.
    336336            //
    337337            objectsToDelete.add(target);
    338         } else if (! target.isModified() && source.isModified()) {
     338        } else if (!target.isModified() && source.isModified()) {
    339339            // target not modified. We can assume that source is the most recent version.
    340340            // clone it into target.
    341341            target.mergeFrom(source);
    342342            objectsWithChildrenToMerge.add(source.getPrimitiveId());
    343         } else if (! target.isModified() && !source.isModified() && target.getVersion() == source.getVersion()) {
     343        } else if (!target.isModified() && !source.isModified() && target.getVersion() == source.getVersion()) {
    344344            // both not modified. Merge nevertheless.
    345345            // This helps when updating "empty" relations, see #4295
    346346            target.mergeFrom(source);
    347347            objectsWithChildrenToMerge.add(source.getPrimitiveId());
    348         } else if (! target.isModified() && !source.isModified() && target.getVersion() < source.getVersion()) {
     348        } else if (!target.isModified() && !source.isModified() && target.getVersion() < source.getVersion()) {
    349349            // my not modified but other is newer. clone other onto mine.
    350350            //
    351351            target.mergeFrom(source);
    352352            objectsWithChildrenToMerge.add(source.getPrimitiveId());
    353         } else if (target.isModified() && ! source.isModified() && target.getVersion() == source.getVersion()) {
     353        } else if (target.isModified() && !source.isModified() && target.getVersion() == source.getVersion()) {
    354354            // target is same as source but target is modified
    355355            // => keep target and reset modified flag if target and source are semantically equal
     
    362362            //
    363363            addConflict(target,source);
    364         } else if (! target.hasEqualSemanticAttributes(source)) {
     364        } else if (!target.hasEqualSemanticAttributes(source)) {
    365365            // target is modified and is not semantically equal with source. Can't automatically
    366366            // resolve the differences
  • trunk/src/org/openstreetmap/josm/data/osm/Node.java

    r8365 r8444  
    281281        if (!(other instanceof Node))
    282282            return false;
    283         if (! super.hasEqualSemanticAttributes(other))
     283        if (!super.hasEqualSemanticAttributes(other))
    284284            return false;
    285285        Node n = (Node)other;
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r8419 r8444  
    966966        } else if (referrers instanceof OsmPrimitive) {
    967967            if (referrers != referrer) {
    968                 referrers = new OsmPrimitive[] { (OsmPrimitive)referrers, referrer };
     968                referrers = new OsmPrimitive[] {(OsmPrimitive)referrers, referrer};
    969969            }
    970970        } else {
     
    11441144            if (other.isNew() ^ isNew())
    11451145                throw new DataIntegrityProblemException(tr("Cannot merge because either of the participating primitives is new and the other is not"));
    1146             if (! other.isNew() && other.getId() != id)
     1146            if (!other.isNew() && other.getId() != id)
    11471147                throw new DataIntegrityProblemException(tr("Cannot merge primitives with different ids. This id is {0}, the other is {1}", id, other.getId()));
    11481148
  • trunk/src/org/openstreetmap/josm/data/osm/Relation.java

    r8390 r8444  
    292292        if (!(other instanceof Relation))
    293293            return false;
    294         if (! super.hasEqualSemanticAttributes(other))
     294        if (!super.hasEqualSemanticAttributes(other))
    295295            return false;
    296296        Relation r = (Relation)other;
  • trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java

    r8415 r8444  
    341341                continue;
    342342            }
    343             if (! containsKey(key)) return false;
     343            if (!containsKey(key)) return false;
    344344        }
    345345        return true;
     
    399399        if (key == null) return false;
    400400        Set<String> values = getTagsFor(key).getValues();
    401         return values.size() == 1 && ! values.contains("");
     401        return values.size() == 1 && !values.contains("");
    402402    }
    403403
     
    607607    public void applyTo(Tagged primitive) {
    608608        if (primitive == null) return;
    609         if (! isApplicableToPrimitive())
     609        if (!isApplicableToPrimitive())
    610610            throw new IllegalStateException(tr("Tag collection cannot be applied to a primitive because there are keys with multiple values."));
    611611        for (Tag tag: tags) {
     
    628628    public void applyTo(Collection<? extends Tagged> primitives) {
    629629        if (primitives == null) return;
    630         if (! isApplicableToPrimitive())
     630        if (!isApplicableToPrimitive())
    631631            throw new IllegalStateException(tr("Tag collection cannot be applied to a primitive because there are keys with multiple values."));
    632632        for (Tagged primitive: primitives) {
     
    645645    public void replaceTagsOf(Tagged primitive) {
    646646        if (primitive == null) return;
    647         if (! isApplicableToPrimitive())
     647        if (!isApplicableToPrimitive())
    648648            throw new IllegalStateException(tr("Tag collection cannot be applied to a primitive because there are keys with multiple values."));
    649649        primitive.removeAll();
     
    663663    public void replaceTagsOf(Collection<? extends Tagged> primitives) {
    664664        if (primitives == null) return;
    665         if (! isApplicableToPrimitive())
     665        if (!isApplicableToPrimitive())
    666666            throw new IllegalStateException(tr("Tag collection cannot be applied to a primitive because there are keys with multiple values."));
    667667        for (Tagged primitive: primitives) {
  • trunk/src/org/openstreetmap/josm/data/osm/User.java

    r8395 r8444  
    213213    @Override
    214214    public boolean equals(Object obj) {
    215         if (! (obj instanceof User))
     215        if (!(obj instanceof User))
    216216            return false;
    217217        User other = (User) obj;
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r8419 r8444  
    336336        if (!(other instanceof Way))
    337337            return false;
    338         if (! super.hasEqualSemanticAttributes(other))
     338        if (!super.hasEqualSemanticAttributes(other))
    339339            return false;
    340340        Way w = (Way)other;
    341341        if (getNodesCount() != w.getNodesCount()) return false;
    342         for (int i=0;i<getNodesCount();i++) {
    343             if (! getNode(i).hasEqualSemanticAttributes(w.getNode(i)))
     342        for (int i=0; i<getNodesCount(); i++) {
     343            if (!getNode(i).hasEqualSemanticAttributes(w.getNode(i)))
    344344                return false;
    345345        }
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/LineClip.java

    r8419 r8444  
    6060     * @return true, if line is visible in the given clip region
    6161     */
    62     private boolean cohenSutherland( long x1, long y1, long x2, long y2, long xmin, long ymin, long xmax, long ymax) {
     62    private boolean cohenSutherland(long x1, long y1, long x2, long y2, long xmin, long ymin, long xmax, long ymax) {
    6363        int outcode0, outcode1, outcodeOut;
    6464        boolean accept = false;
     
    6969
    7070        do {
    71             if ((outcode0 | outcode1) == 0 ) {
     71            if ((outcode0 | outcode1) == 0) {
    7272                accept = true;
    7373                done = true;
    74             } else if ( (outcode0 & outcode1) > 0 ) {
     74            } else if ((outcode0 & outcode1) > 0) {
    7575                done = true;
    7676            } else {
    7777                long x = 0, y = 0;
    7878                outcodeOut = outcode0 != 0 ? outcode0: outcode1;
    79                 if ( (outcodeOut & OUT_TOP) > 0 ) {
     79                if ((outcodeOut & OUT_TOP) > 0) {
    8080                    x = x1 + (x2 - x1) * (ymax - y1)/(y2 - y1);
    8181                    y = ymax;
    82                 } else if ((outcodeOut & OUT_BOTTOM) > 0 ) {
     82                } else if ((outcodeOut & OUT_BOTTOM) > 0) {
    8383                    x = x1 + (x2 - x1) * (ymin - y1)/(y2 - y1);
    8484                    y = ymin;
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java

    r8415 r8444  
    127127            Main.error(tr("Activating the standard map renderer instead."));
    128128            activateDefault();
    129         } else if (! AbstractMapRenderer.class.isAssignableFrom(c)) {
     129        } else if (!AbstractMapRenderer.class.isAssignableFrom(c)) {
    130130            Main.error(tr("Can''t activate map renderer class ''{0}'', because it isn''t a subclass of ''{1}''.", rendererClassName, AbstractMapRenderer.class.getName()));
    131131            Main.error(tr("Activating the standard map renderer instead."));
     
    133133        } else {
    134134            Class<? extends AbstractMapRenderer> renderer = c.asSubclass(AbstractMapRenderer.class);
    135             if (! isRegistered(renderer)) {
     135            if (!isRegistered(renderer)) {
    136136                Main.error(tr("Can''t activate map renderer class ''{0}'', because it isn''t registered as map renderer.", rendererClassName));
    137137                Main.error(tr("Activating the standard map renderer instead."));
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r8419 r8444  
    591591                x -= textWidth / 2;
    592592            } else if (bs.hAlign == HorizontalTextAlignment.LEFT) {
    593                 x -= - box.x + 4 + textWidth;
     593                x -= -box.x + 4 + textWidth;
    594594            } else throw new AssertionError();
    595595        }
     
    643643                break;
    644644            case CENTER:
    645                 dy1 = - imgHeight / 2;
     645                dy1 = -imgHeight / 2;
    646646                dy2 = imgHeight + dy1;
    647647                break;
     
    13411341
    13421342                                    // scale such that border is 1 px
    1343                                     final double fac = - (onewayReversed ? -1 : 1) * onewaySize * (1 + sinPHI) / (sinPHI * cosPHI);
     1343                                    final double fac = -(onewayReversed ? -1 : 1) * onewaySize * (1 + sinPHI) / (sinPHI * cosPHI);
    13441344                                    final double sx = nx * fac;
    13451345                                    final double sy = ny * fac;
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java

    r8419 r8444  
    433433
    434434                path.lineTo(p2.x + (int) Math.round(cosPHI * sx - sinPHI * sy), p2.y + (int) Math.round(sinPHI * sx + cosPHI * sy));
    435                 path.moveTo(p2.x + (int) Math.round(cosPHI * sx + sinPHI * sy), p2.y + (int) Math.round(- sinPHI * sx + cosPHI * sy));
     435                path.moveTo(p2.x + (int) Math.round(cosPHI * sx + sinPHI * sy), p2.y + (int) Math.round(-sinPHI * sx + cosPHI * sy));
    436436                path.lineTo(p2.x, p2.y);
    437437            }
  • trunk/src/org/openstreetmap/josm/data/projection/datum/SevenParameterDatum.java

    r6069 r8444  
    5050        double y = dy + xyz[1]*(1+s) + xyz[0]*rz - xyz[2]*rx;
    5151        double z = dz + xyz[2]*(1+s) + xyz[1]*rx - xyz[0]*ry;
    52         return Ellipsoid.WGS84.cart2LatLon(new double[] { x, y, z });
     52        return Ellipsoid.WGS84.cart2LatLon(new double[] {x, y, z});
    5353    }
    5454
     
    5959        double y = (1-s)*(-dy + xyz[1] + ((-dx+xyz[0])*(-rz) - (-dz+xyz[2])*(-rx)));
    6060        double z = (1-s)*(-dz + xyz[2] + ((-dy+xyz[1])*(-rx) - (-dx+xyz[0])*(-ry)));
    61         return this.ellps.cart2LatLon(new double[] { x, y, z });
     61        return this.ellps.cart2LatLon(new double[] {x, y, z});
    6262    }
    63 
    6463}
  • trunk/src/org/openstreetmap/josm/data/projection/proj/LambertConformalConic.java

    r8346 r8444  
    153153    public double[] project(double phi, double lambda) {
    154154        double sinphi = sin(phi);
    155         double L = (0.5*log((1+sinphi)/(1-sinphi))) - e/2*log((1+e*sinphi)/(1-e*sinphi));
    156         double r = f*exp(-n*L);
     155        double l = (0.5*log((1+sinphi)/(1-sinphi))) - e/2*log((1+e*sinphi)/(1-e*sinphi));
     156        double r = f*exp(-n*l);
    157157        double gamma = n*lambda;
    158         double X = r*sin(gamma);
    159         double Y = r0 - r*cos(gamma);
    160         return new double[] { X, Y };
     158        double x = r*sin(gamma);
     159        double y = r0 - r*cos(gamma);
     160        return new double[] {x, y};
    161161    }
    162162
     
    168168        double latIso = (-1/n) * log(abs(r/f));
    169169        double phi = ellps.latitude(latIso, e, epsilon);
    170         return new double[] { phi, lambda };
     170        return new double[] {phi, lambda};
    171171    }
    172172
  • trunk/src/org/openstreetmap/josm/data/projection/proj/LonLat.java

    r7937 r8444  
    3030    @Override
    3131    public double[] project(double lat_rad, double lon_rad) {
    32         return new double[] { Math.toDegrees(lon_rad) / a, Math.toDegrees(lat_rad) / a };
     32        return new double[] {Math.toDegrees(lon_rad) / a, Math.toDegrees(lat_rad) / a};
    3333    }
    3434
    3535    @Override
    3636    public double[] invproject(double east, double north) {
    37         return new double[] { Math.toRadians(north * a), Math.toRadians(east * a) };
     37        return new double[] {Math.toRadians(north * a), Math.toRadians(east * a)};
    3838    }
    3939}
  • trunk/src/org/openstreetmap/josm/data/projection/proj/Mercator.java

    r6362 r8444  
    3232    @Override
    3333    public double[] project(double lat_rad, double lon_rad) {
    34         return new double[] { lon_rad, log(tan(PI/4 + lat_rad/2)) };
     34        return new double[] {lon_rad, log(tan(PI/4 + lat_rad/2))};
    3535    }
    3636
    3737    @Override
    3838    public double[] invproject(double east, double north) {
    39         return new double[] { atan(sinh(north)), east };
     39        return new double[] {atan(sinh(north)), east};
    4040    }
    41 
    4241}
  • trunk/src/org/openstreetmap/josm/data/projection/proj/SwissObliqueMercator.java

    r8378 r8444  
    8181        double x = kR / 2 * log((1 + sin(bb)) / (1 - sin(bb)));
    8282
    83         return new double[] { y, x };
     83        return new double[] {y, x};
    8484    }
    8585
     
    107107            phi = 2 * atan(exp(s)) - PI / 2;
    108108        }
    109         return new double[] { phi, lambda };
     109        return new double[] {phi, lambda};
    110110    }
    111111}
  • trunk/src/org/openstreetmap/josm/data/validation/PaintVisitor.java

    r8380 r8444  
    162162        int deg = (int) Math.toDegrees(t);
    163163        if (selected) {
    164             int[] x = new int[] { (int) (p1.x + cosT), (int) (p2.x + cosT),
    165                                   (int) (p2.x - cosT), (int) (p1.x - cosT) };
    166             int[] y = new int[] { (int) (p1.y - sinT), (int) (p2.y - sinT),
    167                                   (int) (p2.y + sinT), (int) (p1.y + sinT) };
     164            int[] x = new int[] {(int) (p1.x + cosT), (int) (p2.x + cosT),
     165                                 (int) (p2.x - cosT), (int) (p1.x - cosT)};
     166            int[] y = new int[] {(int) (p1.y - sinT), (int) (p2.y - sinT),
     167                                 (int) (p2.y + sinT), (int) (p1.y + sinT)};
    168168            g.fillPolygon(x, y, 4);
    169169            g.fillArc(p1.x - 5, p1.y - 5, 10, 10, deg,  180);
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java

    r8378 r8444  
    195195            if (duplicated.size() > 1) {
    196196                TestError testError = new TestError(this, Severity.ERROR, tr("Duplicated relations"), DUPLICATE_RELATION, duplicated);
    197                 errors.add( testError );
     197                errors.add(testError);
    198198            }
    199199        }
     
    202202            if (duplicated.size() > 1) {
    203203                TestError testError = new TestError(this, Severity.WARNING, tr("Relations with same members"), SAME_RELATION, duplicated);
    204                 errors.add( testError );
     204                errors.add(testError);
    205205            }
    206206        }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java

    r8382 r8444  
    6969    private boolean parentMultipolygonConcernsArea(OsmPrimitive p) {
    7070        for (Relation r : OsmPrimitive.getFilteredList(p.getReferrers(), Relation.class)) {
    71             if (r.concernsArea() ) {
     71            if (r.concernsArea()) {
    7272                return true;
    7373            }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r8438 r8444  
    248248
    249249        if (errorSources.length() > 0)
    250             throw new IOException( tr("Could not access data file(s):\n{0}", errorSources) );
     250            throw new IOException(tr("Could not access data file(s):\n{0}", errorSources));
    251251    }
    252252
  • trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java

    r8378 r8444  
    4444    public static final Set<String> NAMED_WAYS = new HashSet<>();
    4545    static {
    46         NAMED_WAYS.add( "motorway" );
    47         NAMED_WAYS.add( "trunk" );
    48         NAMED_WAYS.add( "primary" );
    49         NAMED_WAYS.add( "secondary" );
    50         NAMED_WAYS.add( "tertiary" );
    51         NAMED_WAYS.add( "residential" );
    52         NAMED_WAYS.add( "pedestrian" );
     46        NAMED_WAYS.add("motorway");
     47        NAMED_WAYS.add("trunk");
     48        NAMED_WAYS.add("primary");
     49        NAMED_WAYS.add("secondary");
     50        NAMED_WAYS.add("tertiary");
     51        NAMED_WAYS.add("residential");
     52        NAMED_WAYS.add("pedestrian");
    5353    }
    5454
     
    5656    public static final Set<String> WHITELIST = new HashSet<>();
    5757    static {
    58         WHITELIST.add( "outer" );
    59         WHITELIST.add( "inner" );
    60         WHITELIST.add( "perimeter" );
    61         WHITELIST.add( "edge" );
    62         WHITELIST.add( "outline" );
     58        WHITELIST.add("outer");
     59        WHITELIST.add("inner");
     60        WHITELIST.add("perimeter");
     61        WHITELIST.add("edge");
     62        WHITELIST.add("outline");
    6363    }
    6464
  • trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java

    r8378 r8444  
    6464        if (!cellNodes.contains(cell)) {
    6565            cellNodes.add(cell);
    66             ways = cellWays.get( cell );
     66            ways = cellWays.get(cell);
    6767            if (ways == null) {
    6868                ways = new ArrayList<>();
     
    157157        long maxSteps = (gridX1 - gridX0) + Math.abs(gridY1 - gridY0) + 1;
    158158        while ((gridX0 <= gridX1 && (gridY0 - gridY1)*stepY <= 0) && maxSteps-- > 0) {
    159             cells.add( new Point2D.Double(gridX0, gridY0));
     159            cells.add(new Point2D.Double(gridX0, gridY0));
    160160
    161161            // Is the cross between the segment and next vertical line nearer than the cross with next horizontal line?
Note: See TracChangeset for help on using the changeset viewer.