Changeset 8345 in josm for trunk


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
Files:
68 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/Main.java

    r8342 r8345  
    963963
    964964        geometry = WindowGeometry.mainWindow("gui.geometry",
    965             (args.containsKey(Option.GEOMETRY) ? args.get(Option.GEOMETRY).iterator().next() : null),
     965            args.containsKey(Option.GEOMETRY) ? args.get(Option.GEOMETRY).iterator().next() : null,
    966966            !args.containsKey(Option.NO_MAXIMIZE) && Main.pref.getBoolean("gui.maximized", false));
    967967    }
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r8342 r8345  
    9595    protected ImageryInfo getWMSLayerInfo() {
    9696        try {
    97             assert (ImageryType.WMS_ENDPOINT.equals(info.getImageryType()));
     97            assert ImageryType.WMS_ENDPOINT.equals(info.getImageryType());
    9898            final WMSImagery wms = new WMSImagery();
    9999            wms.attemptGetCapabilities(info.getUrl());
  • trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java

    r8338 r8345  
    249249                JOptionPane.showMessageDialog(
    250250                        Main.parent,
    251                         ("selection".equals(mode) ? tr("Nothing selected to zoom to.") : tr("No conflicts to zoom to")),
     251                        "selection".equals(mode) ? tr("Nothing selected to zoom to.") : tr("No conflicts to zoom to"),
    252252                        tr("Information"),
    253253                        JOptionPane.INFORMATION_MESSAGE);
  • trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java

    r8248 r8345  
    194194            dialog.setButtonIcons(new String[] {"save_as", "cancel"});
    195195            dialog.showDialog();
    196             return (dialog.getValue() == 1);
     196            return dialog.getValue() == 1;
    197197        }
    198198        return true;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r8342 r8345  
    11251125
    11261126        double cx = center.getX(), cy = center.getY();
    1127         double k = (mirror ? -1 : 1);
     1127        double k = mirror ? -1 : 1;
    11281128        Point2D ra1 = new Point2D.Double(cx + raoffsetx, cy + raoffsety);
    11291129        Point2D ra3 = new Point2D.Double(cx - raoffsety*k, cy + raoffsetx*k);
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java

    r8318 r8345  
    412412                        for (Pair<Node, Node> wpp : wpps) {
    413413                            ++i;
    414                             if ((wpp.a.equals(candidateSegment.getFirstNode())
    415                                     && wpp.b.equals(candidateSegment.getSecondNode()) || (wpp.b.equals(candidateSegment.getFirstNode()) && wpp.a.equals(candidateSegment.getSecondNode())))) {
     414                            boolean ab = wpp.a.equals(candidateSegment.getFirstNode())
     415                                    && wpp.b.equals(candidateSegment.getSecondNode());
     416                            boolean ba = wpp.b.equals(candidateSegment.getFirstNode())
     417                                    && wpp.a.equals(candidateSegment.getSecondNode());
     418                            if (ab || ba) {
    416419                                virtualSegments.add(new WaySegment(w, i));
    417420                            }
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ModifiersSpec.java

    r6889 r8345  
    2020     */
    2121    public ModifiersSpec(String str) {
    22         assert (str.length() == 3);
     22        assert str.length() == 3;
    2323        char a = str.charAt(0);
    2424        char s = str.charAt(1);
     
    4646
    4747    private boolean match(final int a, final int knownValue) {
    48         assert (knownValue == ON | knownValue == OFF);
     48        assert knownValue == ON | knownValue == OFF;
    4949        return a == knownValue || a == UNKNOWN;
    5050    }
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java

    r8308 r8345  
    245245        boolean oldAlt = alt, oldShift = shift, oldCtrl = ctrl;
    246246        updateKeyModifiers(modifiers);
    247         return (oldAlt != alt || oldShift != shift || oldCtrl != ctrl);
     247        return oldAlt != alt || oldShift != shift || oldCtrl != ctrl;
    248248    }
    249249
     
    288288            ((Boolean) this.getValue("active"));
    289289        // @formatter:on
    290         assert (areWeSane); // mad == bad
     290        assert areWeSane; // mad == bad
    291291        return areWeSane;
    292292    }
     
    498498    //// We keep the source ways and the selection in sync so the user can see the source way's tags
    499499    private void addSourceWay(Way w) {
    500         assert (sourceWays != null);
     500        assert sourceWays != null;
    501501        getCurrentDataSet().addSelected(w);
    502502        w.setHighlighted(true);
     
    505505
    506506    private void removeSourceWay(Way w) {
    507         assert (sourceWays != null);
     507        assert sourceWays != null;
    508508        getCurrentDataSet().clearSelection(w);
    509509        w.setHighlighted(false);
     
    512512
    513513    private void clearSourceWays() {
    514         assert (sourceWays != null);
     514        assert sourceWays != null;
    515515        getCurrentDataSet().clearSelection(sourceWays);
    516516        for (Way w : sourceWays) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r8343 r8345  
    953953            else if (mode == Mode.MOVE && (System.currentTimeMillis() - mouseDownTime >= initialMoveDelay)) {
    954954                final boolean canMerge = getCurrentDataSet()!=null && !getCurrentDataSet().getSelectedNodes().isEmpty();
    955                 final String mergeHelp = canMerge ? (" " + tr("Ctrl to merge with nearest node.")) : "";
     955                final String mergeHelp = canMerge ? " " + tr("Ctrl to merge with nearest node.") : "";
    956956                return tr("Release the mouse button to stop moving.") + mergeHelp;
    957957            } else if (mode == Mode.ROTATE)
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r8338 r8345  
    601601                    /*case sensitive*/  trc("search", "CS") :
    602602                        /*case insensitive*/  trc("search", "CI");
    603                     String rx = regexSearch ? (", " +
    604                             /*regex search*/ trc("search", "RX")) : "";
    605                     String all = allElements ? (", " +
    606                             /*all elements*/ trc("search", "A")) : "";
     603                    String rx = regexSearch ? ", " +
     604                            /*regex search*/ trc("search", "RX") : "";
     605                    String all = allElements ? ", " +
     606                            /*all elements*/ trc("search", "A") : "";
    607607                    return "\"" + text + "\" (" + cs + rx + all + ", " + mode + ")";
    608608        }
     
    613613                return false;
    614614            SearchSetting o = (SearchSetting) other;
    615             return (o.caseSensitive == this.caseSensitive
     615            return o.caseSensitive == this.caseSensitive
    616616                    && o.regexSearch == this.regexSearch
    617617                    && o.allElements == this.allElements
    618618                    && o.mode.equals(this.mode)
    619                     && o.text.equals(this.text));
     619                    && o.text.equals(this.text);
    620620        }
    621621
  • 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}
  • trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java

    r7005 r8345  
    162162        MessagePanel pnl = new MessagePanel(message, isInBulkOperation(preferenceKey));
    163163        ret = JOptionPane.showConfirmDialog(parent, pnl, title, optionType, messageType);
    164         if ((isYesOrNo(ret))) {
     164        if (isYesOrNo(ret)) {
    165165            pnl.getNotShowAgain().store(preferenceKey, ret);
    166166        }
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r8342 r8345  
    12921292    public static double perDist(Point2D pt, Point2D a, Point2D b) {
    12931293        if (pt != null && a != null && b != null) {
    1294             double pd = (
     1294            double pd =
    12951295                    (a.getX()-pt.getX())*(b.getX()-a.getX()) -
    1296                     (a.getY()-pt.getY())*(b.getY()-a.getY()) );
     1296                    (a.getY()-pt.getY())*(b.getY()-a.getY());
    12971297            return Math.abs(pd) / a.distance(b);
    12981298        }
     
    13101310    public static Point2D project(Point2D pt, Point2D a, Point2D b) {
    13111311        if (pt != null && a != null && b != null) {
    1312             double r = ((
     1312            double r = (
    13131313                    (pt.getX()-a.getX())*(b.getX()-a.getX()) +
    13141314                    (pt.getY()-a.getY())*(b.getY()-a.getY()) )
    1315                     / a.distanceSq(b));
     1315                    / a.distanceSq(b);
    13161316            return project(r, a, b);
    13171317        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java

    r8342 r8345  
    157157                    final int ph = dlg.getPreferredHeight();
    158158                    final int ah = dlg.getSize().height;
    159                     dlg.setPreferredSize(new Dimension(Integer.MAX_VALUE, (ah < 20 ? ph : ah)));
     159                    dlg.setPreferredSize(new Dimension(Integer.MAX_VALUE, ah < 20 ? ph : ah));
    160160                }
    161161            }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r8308 r8345  
    147147        for(int i=0; i < 10; i++) {
    148148            visibilityToggleShortcuts[i] = Shortcut.registerShortcut("subwindow:layers:toggleLayer" + (i+1),
    149                     tr("Toggle visibility of layer: {0}", (i+1)), k[i], Shortcut.ALT);
     149                    tr("Toggle visibility of layer: {0}", i+1), k[i], Shortcut.ALT);
    150150            visibilityToggleActions[i] = new ToggleLayerIndexVisibility(i);
    151151            Main.registerActionShortcut(visibilityToggleActions[i], visibilityToggleShortcuts[i]);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r8342 r8345  
    325325                    return this;
    326326                Component c = super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
    327                 boolean isDisabledAndHidden = (((Relation)table.getValueAt(row, 0))).isDisabledAndHidden();
     327                boolean isDisabledAndHidden = ((Relation)table.getValueAt(row, 0)).isDisabledAndHidden();
    328328                if (c instanceof JLabel) {
    329329                    JLabel label = (JLabel) c;
     
    341341                    boolean isSelected, boolean hasFocus, int row, int column) {
    342342                Component c = super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
    343                 boolean isDisabledAndHidden = (((Relation)table.getValueAt(row, 0))).isDisabledAndHidden();
     343                boolean isDisabledAndHidden = ((Relation)table.getValueAt(row, 0)).isDisabledAndHidden();
    344344                if (c instanceof JLabel) {
    345345                    JLabel label = (JLabel)c;
     
    795795                int row = tagTable.rowAtPoint(e.getPoint());
    796796                if (row > -1) {
    797                     boolean focusOnKey = (tagTable.columnAtPoint(e.getPoint()) == 0);
     797                    boolean focusOnKey = tagTable.columnAtPoint(e.getPoint()) == 0;
    798798                    editHelper.editTag(row, focusOnKey);
    799799                } else {
     
    942942            int rowCount = membershipTable.getRowCount();
    943943            if (rowCount > 1) {
    944                 nextRelation = (Relation)membershipData.getValueAt((row + 1 < rowCount ? row + 1 : row - 1), 0);
     944                nextRelation = (Relation)membershipData.getValueAt(row + 1 < rowCount ? row + 1 : row - 1, 0);
    945945            }
    946946
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRenderer.java

    r8342 r8345  
    186186        }
    187187
    188         if ((arrow != null)) {
     188        if (arrow != null) {
    189189            g.drawImage(arrow, xoff+xowloop-3, (y1 + y2) / 2 - 2, null);
    190190        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java

    r8338 r8345  
    8686
    8787            Way w = m.getWay();
    88             if ((RelationSortUtils.roundaboutType(w) != NONE)) {
     88            if (RelationSortUtils.roundaboutType(w) != NONE) {
    8989                for (Node nd : w.getNodes()) {
    9090                    addPair(nd, i);
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java

    r8332 r8345  
    226226            else
    227227                // reload if the history object of the selected object is not in the cache yet
    228                 return (!p.isNew() && h.getByVersion(p.getUniqueId()) == null);
     228                return !p.isNew() && h.getByVersion(p.getUniqueId()) == null;
    229229        }
    230230    };
  • trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java

    r8264 r8345  
    149149            for (int x = 0; x < 2; x++) {
    150150                Dimension d = toolTip.getUI().getPreferredSize(toolTip);
    151                 d.width = Math.min(d.width, (mv.getWidth() / 2));
     151                d.width = Math.min(d.width, mv.getWidth() / 2);
    152152                if (d.width > 0 && d.height > 0) {
    153153                    toolTip.setSize(d);
  • trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java

    r8344 r8345  
    310310                        try {
    311311                            String xml = attributionLoader.updateIfRequiredString();
    312                             return parseAttributionText(new InputSource(new StringReader((xml))));
     312                            return parseAttributionText(new InputSource(new StringReader(xml)));
    313313                        } catch (IOException ex) {
    314314                            Main.warn("Could not connect to Bing API. Will retry in " + waitTimeSec + " seconds.");
     
    749749     */
    750750    Tile getTile(int x, int y, int zoom) {
    751         int max = (1 << zoom);
     751        int max = 1 << zoom;
    752752        if (x < 0 || x >= max || y < 0 || y >= max)
    753753            return null;
     
    794794    @Override
    795795    public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
    796         boolean done = ((infoflags & (ERROR | FRAMEBITS | ALLBITS)) != 0);
     796        boolean done = (infoflags & (ERROR | FRAMEBITS | ALLBITS)) != 0;
    797797        needRedraw = true;
    798798        if (Main.isDebugEnabled()) {
  • trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java

    r7005 r8345  
    7373                Object tn = errorMessages.nextElement().getUserObject();
    7474                if (tn instanceof TestError) {
    75                     paintVisitor.visit(((TestError) tn));
     75                    paintVisitor.visit((TestError) tn);
    7676                }
    7777            }
  • trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java

    r8308 r8345  
    394394     */
    395395    public int getBaseImageWidth() {
    396         int overlap = PROP_OVERLAP.get() ? (PROP_OVERLAP_EAST.get() * imageSize / 100) : 0;
     396        int overlap = PROP_OVERLAP.get() ? PROP_OVERLAP_EAST.get() * imageSize / 100 : 0;
    397397        return imageSize + overlap;
    398398    }
     
    403403     */
    404404    public int getBaseImageHeight() {
    405         int overlap = PROP_OVERLAP.get() ? (PROP_OVERLAP_NORTH.get() * imageSize / 100) : 0;
     405        int overlap = PROP_OVERLAP.get() ? PROP_OVERLAP_NORTH.get() * imageSize / 100 : 0;
    406406        return imageSize + overlap;
    407407    }
     
    10811081    @Override
    10821082    public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
    1083         boolean done = ((infoflags & (ERROR | FRAMEBITS | ALLBITS)) != 0);
     1083        boolean done = (infoflags & (ERROR | FRAMEBITS | ALLBITS)) != 0;
    10841084        Main.map.repaint(done ? 0 : 100);
    10851085        return !done;
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r8318 r8345  
    144144            FileFilter filter = new FileFilter(){
    145145                @Override public boolean accept(File f) {
    146                     return (f.isDirectory()
     146                    return f.isDirectory()
    147147                            || f .getName().toLowerCase().endsWith(".gpx")
    148                             || f.getName().toLowerCase().endsWith(".gpx.gz"));
     148                            || f.getName().toLowerCase().endsWith(".gpx.gz");
    149149                }
    150150                @Override public String getDescription() {
     
    11801180        // Time between the track point and the previous one, 5 sec if first point, i.e. photos take
    11811181        // 5 sec before the first track point can be assumed to be take at the starting position
    1182         long interval = prevWpTime > 0 ? (Math.abs(curWpTime - prevWpTime)) : 5*1000;
     1182        long interval = prevWpTime > 0 ? Math.abs(curWpTime - prevWpTime) : 5*1000;
    11831183        int ret = 0;
    11841184
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java

    r8308 r8345  
    324324                checkPointInVisibleRect(p, visibleRect);
    325325                Rectangle rect = new Rectangle(
    326                         (p.x < mousePointInImg.x ? p.x : mousePointInImg.x),
    327                         (p.y < mousePointInImg.y ? p.y : mousePointInImg.y),
    328                         (p.x < mousePointInImg.x ? mousePointInImg.x - p.x : p.x - mousePointInImg.x),
    329                         (p.y < mousePointInImg.y ? mousePointInImg.y - p.y : p.y - mousePointInImg.y));
     326                        p.x < mousePointInImg.x ? p.x : mousePointInImg.x,
     327                        p.y < mousePointInImg.y ? p.y : mousePointInImg.y,
     328                        p.x < mousePointInImg.x ? mousePointInImg.x - p.x : p.x - mousePointInImg.x,
     329                        p.y < mousePointInImg.y ? mousePointInImg.y - p.y : p.y - mousePointInImg.y);
    330330                checkVisibleRectSize(image, rect);
    331331                checkVisibleRectPos(image, rect);
  • trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java

    r8260 r8345  
    8383        public String toString() {
    8484            return "symbol=" + symbol + " size=" + size +
    85                     (stroke != null ? (" stroke=" + stroke + " strokeColor=" + strokeColor) : "") +
    86                     (fillColor != null ? (" fillColor=" + fillColor) : "");
     85                    (stroke != null ? " stroke=" + stroke + " strokeColor=" + strokeColor : "") +
     86                    (fillColor != null ? " fillColor=" + fillColor : "");
    8787        }
    8888    }
     
    325325                }
    326326
    327                 final int size = Utils.max((selected ? settings.getSelectedNodeSize() : 0),
    328                         (n.isTagged() ? settings.getTaggedNodeSize() : 0),
    329                         (isConnection ? settings.getConnectionNodeSize() : 0),
     327                final int size = Utils.max(selected ? settings.getSelectedNodeSize() : 0,
     328                        n.isTagged() ? settings.getTaggedNodeSize() : 0,
     329                        isConnection ? settings.getConnectionNodeSize() : 0,
    330330                        settings.getUnselectedNodeSize());
    331331
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java

    r8338 r8345  
    536536
    537537        for (MapCSSRule r : rules) {
    538             if ((r.selector instanceof GeneralSelector)) {
     538            if (r.selector instanceof GeneralSelector) {
    539539                GeneralSelector gs = (GeneralSelector) r.selector;
    540540                if (gs.getBase().equals("setting")) {
     
    578578
    579579        for (MapCSSRule r : rules) {
    580             if ((r.selector instanceof GeneralSelector)) {
     580            if (r.selector instanceof GeneralSelector) {
    581581                GeneralSelector gs = (GeneralSelector) r.selector;
    582582                if (gs.getBase().equals(type)) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java

    r8342 r8345  
    651651        @Override
    652652        public String toString() {
    653             return base + (Range.ZERO_TO_INFINITY.equals(range) ? "" : range) + Utils.join("", conds) + (subpart != null ? ("::" + subpart) : "");
     653            return base + (Range.ZERO_TO_INFINITY.equals(range) ? "" : range) + Utils.join("", conds)
     654                    + (subpart != null ? "::" + subpart : "");
    654655        }
    655656    }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java

    r8342 r8345  
    303303
    304304        if (osm instanceof Node || (osm instanceof Relation && "restriction".equals(osm.get("type")))) {
    305             IconPrototype icon = getNode(osm, (useMinMaxScale ? scale : null), mc);
     305            IconPrototype icon = getNode(osm, useMinMaxScale ? scale : null, mc);
    306306            if (icon != null) {
    307307                def.put(ICON_IMAGE, icon.icon);
     
    318318        } else if (osm instanceof Way || (osm instanceof Relation && ((Relation)osm).isMultipolygon())) {
    319319            WayPrototypesRecord p = new WayPrototypesRecord();
    320             get(osm, pretendWayIsClosed || !(osm instanceof Way) || ((Way) osm).isClosed(), p, (useMinMaxScale ? scale : null), mc);
     320            get(osm, pretendWayIsClosed || !(osm instanceof Way) || ((Way) osm).isClosed(), p, useMinMaxScale ? scale : null, mc);
    321321            if (p.line != null) {
    322322                def.put(WIDTH, new Float(p.line.getWidth()));
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r8342 r8345  
    322322        @Override
    323323        public int getRowCount() {
    324             int adaptable = ((currentAction.getAction() instanceof AdaptableAction) ? 2 : 0);
     324            int adaptable = (currentAction.getAction() instanceof AdaptableAction) ? 2 : 0;
    325325            if (currentAction.isSeparator() || !(currentAction.getAction() instanceof ParameterizedAction))
    326326                return adaptable;
     
    903903        for (MenuElement item : menuElement.getSubElements()) {
    904904            if (item instanceof JMenuItem) {
    905                 JMenuItem menuItem = ((JMenuItem)item);
     905                JMenuItem menuItem = (JMenuItem)item;
    906906                if (menuItem.getAction() != null) {
    907907                    Action action = menuItem.getAction();
  • trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java

    r8308 r8345  
    361361            try {
    362362                final TableRowSorter<? extends TableModel> sorter =
    363                     ((TableRowSorter<? extends TableModel> )shortcutTable.getRowSorter());
     363                    (TableRowSorter<? extends TableModel> )shortcutTable.getRowSorter();
    364364                if (expr == null) {
    365365                    sorter.setRowFilter(null);
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java

    r8308 r8345  
    183183        AutoCompletionList acList = new AutoCompletionList();
    184184
    185         TagCellEditor editor = ((TagCellEditor) tagTable.getColumnModel().getColumn(0).getCellEditor());
     185        TagCellEditor editor = (TagCellEditor) tagTable.getColumnModel().getColumn(0).getCellEditor();
    186186        editor.setAutoCompletionManager(autocomplete);
    187187        editor.setAutoCompletionList(acList);
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r8338 r8345  
    108108        putValue(Action.NAME, getName());
    109109        putValue("toolbar", "tagging_" + getRawName());
    110         putValue(OPTIONAL_TOOLTIP_TEXT, (group != null ?
     110        putValue(OPTIONAL_TOOLTIP_TEXT, group != null ?
    111111                tr("Use preset ''{0}'' of group ''{1}''", getLocaleName(), group.getName()) :
    112                     tr("Use preset ''{0}''", getLocaleName())));
     112                    tr("Use preset ''{0}''", getLocaleName()));
    113113    }
    114114
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetMenu.java

    r7119 r8345  
    4242        putValue(Action.NAME, getName());
    4343        /** Tooltips should be shown for the toolbar buttons, but not in the menu. */
    44         putValue(OPTIONAL_TOOLTIP_TEXT, (group != null ?
     44        putValue(OPTIONAL_TOOLTIP_TEXT, group != null ?
    4545                tr("Preset group {1} / {0}", getLocaleName(), group.getName()) :
    46                     tr("Preset group {0}", getLocaleName())));
     46                    tr("Preset group {0}", getLocaleName()));
    4747        putValue("toolbar", "tagginggroup_" + getRawName());
    4848    }
  • trunk/src/org/openstreetmap/josm/gui/util/AdvancedKeyPressDetector.java

    r8338 r8345  
    126126            if (timer.isRunning()) {
    127127                timer.stop();
    128             } else if (set.add((e.getKeyCode())) && enabled) {
     128            } else if (set.add(e.getKeyCode()) && enabled) {
    129129                synchronized (this) {
    130130                    if (isFocusInMainWindow()) {
  • trunk/src/org/openstreetmap/josm/gui/widgets/FileChooserManager.java

    r7937 r8345  
    7272        this.lastDirProperty = lastDirProperty == null || lastDirProperty.isEmpty() ? "lastDirectory" : lastDirProperty;
    7373        this.curDir = Main.pref.get(this.lastDirProperty).isEmpty() ?
    74                 (defaultDir == null || defaultDir.isEmpty() ? "." : defaultDir)
     74                defaultDir == null || defaultDir.isEmpty() ? "." : defaultDir
    7575                : Main.pref.get(this.lastDirProperty);
    7676    }
  • trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java

    r8342 r8345  
    560560            Split split = (Split)root;
    561561            boolean grow = split.isRowLayout()
    562             ? (split.getBounds().width <= bounds.width)
     562            ? split.getBounds().width <= bounds.width
    563563                    : (split.getBounds().height <= bounds.height);
    564564            if (grow) {
     
    11221122
    11231123    private static void parseAttribute(String name, StreamTokenizer st, Node node) throws Exception {
    1124         if ((st.nextToken() != '=')) {
     1124        if (st.nextToken() != '=') {
    11251125            throwParseException(st, "expected '=' after " + name);
    11261126        }
  • trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java

    r8319 r8345  
    5050        String url = "trackpoints?bbox="+b.getMinLon()+","+b.getMinLat()+","+b.getMaxLon()+","+b.getMaxLat()+"&page=";
    5151        for (int i = 0;!done;++i) {
    52             progressMonitor.subTask(tr("Downloading points {0} to {1}...", i * 5000, ((i + 1) * 5000)));
     52            progressMonitor.subTask(tr("Downloading points {0} to {1}...", i * 5000, (i + 1) * 5000));
    5353            try (InputStream in = getInputStream(url+i, progressMonitor.createSubTaskMonitor(1, true))) {
    5454                if (in == null) {
  • trunk/src/org/openstreetmap/josm/io/CacheFiles.java

    r8338 r8345  
    375375        if(CacheFiles.EXPIRE_NEVER == this.expire)
    376376            return false;
    377         return (file.lastModified() < (System.currentTimeMillis() - expire*1000));
     377        return file.lastModified() < (System.currentTimeMillis() - expire*1000);
    378378    }
    379379}
  • trunk/src/org/openstreetmap/josm/io/Capabilities.java

    r8338 r8345  
    7373        Map<String, String> e = capabilities.get(element);
    7474        if (e == null) return false;
    75         return (e.get(attribute) != null);
     75        return e.get(attribute) != null;
    7676    }
    7777
  • trunk/src/org/openstreetmap/josm/io/GpxReader.java

    r8287 r8345  
    551551                String message = e.getMessage();
    552552                if (e instanceof SAXParseException) {
    553                     SAXParseException spe = ((SAXParseException)e);
     553                    SAXParseException spe = (SAXParseException)e;
    554554                    message += " " + tr("(at line {0}, column {1})", spe.getLineNumber(), spe.getColumnNumber());
    555555                }
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r8304 r8345  
    420420        CheckParameterUtil.ensureParameterNotNull(changeset, "changeset");
    421421        try {
    422             progressMonitor.beginTask((tr("Creating changeset...")));
     422            progressMonitor.beginTask(tr("Creating changeset..."));
    423423            initialize(progressMonitor);
    424424            String ret = "";
     
    430430                throw new OsmTransferException(tr("Unexpected format of ID replied by the server. Got ''{0}''.", ret));
    431431            }
    432             progressMonitor.setCustomText((tr("Successfully opened changeset {0}",changeset.getId())));
     432            progressMonitor.setCustomText(tr("Successfully opened changeset {0}",changeset.getId()));
    433433        } finally {
    434434            progressMonitor.finishTask();
  • trunk/src/org/openstreetmap/josm/io/OsmWriter.java

    r7575 r8345  
    9090    protected static final Comparator<OsmPrimitive> byIdComparator = new Comparator<OsmPrimitive>() {
    9191        @Override public int compare(OsmPrimitive o1, OsmPrimitive o2) {
    92             return (o1.getUniqueId()<o2.getUniqueId() ? -1 : (o1.getUniqueId()==o2.getUniqueId() ? 0 : 1));
     92            return o1.getUniqueId()<o2.getUniqueId() ? -1 : (o1.getUniqueId()==o2.getUniqueId() ? 0 : 1);
    9393        }
    9494    };
  • trunk/src/org/openstreetmap/josm/io/UTFInputStreamReader.java

    r7509 r8345  
    5454
    5555        if (unread > 0) {
    56             pushbackStream.unread(bom, (n - unread), unread);
     56            pushbackStream.unread(bom, n - unread, unread);
    5757        } else if (unread < -1) {
    5858            pushbackStream.unread(bom, 0, 0);
  • trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java

    r7659 r8345  
    247247        }
    248248
    249         if ((!request.isReal() && !layer.hasAutoDownload())){
     249        if (!request.isReal() && !layer.hasAutoDownload()){
    250250            request.finish(State.NOT_IN_CACHE, null, null);
    251251            return true;
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r8338 r8345  
    13671367            }), GBC.eol());
    13681368
    1369             JosmTextArea description = new JosmTextArea((info.description == null ? tr("no description available")
    1370                     : info.description));
     1369            JosmTextArea description = new JosmTextArea(info.description == null ? tr("no description available")
     1370                    : info.description);
    13711371            description.setEditable(false);
    13721372            description.setFont(new JLabel().getFont().deriveFont(Font.ITALIC));
  • trunk/src/org/openstreetmap/josm/tools/ColorHelper.java

    r6830 r8345  
    3232                    Integer.parseInt(html.substring(2,4),16),
    3333                    Integer.parseInt(html.substring(4,6),16),
    34                     (html.length() == 8 ? Integer.parseInt(html.substring(6,8),16) : 255));
     34                    html.length() == 8 ? Integer.parseInt(html.substring(6,8),16) : 255);
    3535        } catch (NumberFormatException e) {
    3636            return null;
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r8342 r8345  
    449449        CheckParameterUtil.ensureValidCoordinates(secondNode, "secondNode");
    450450
    451         double dy1 = (firstNode.getY() - commonNode.getY());
    452         double dy2 = (secondNode.getY() - commonNode.getY());
    453         double dx1 = (firstNode.getX() - commonNode.getX());
    454         double dx2 = (secondNode.getX() - commonNode.getX());
     451        double dy1 = firstNode.getY() - commonNode.getY();
     452        double dy2 = secondNode.getY() - commonNode.getY();
     453        double dx1 = firstNode.getX() - commonNode.getX();
     454        double dx2 = secondNode.getX() - commonNode.getX();
    455455
    456456        return dy1 * dx2 - dx1 * dy2 > 0;
     
    651651        dlat = lat2 - lat1;
    652652
    653         double a = (Math.pow(Math.sin(dlat/2), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(dlon/2), 2));
     653        double a = Math.pow(Math.sin(dlat/2), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(dlon/2), 2);
    654654        double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
    655655        return 6367000 * c;
     
    668668        dlat = lat2 - lat1;
    669669
    670         double a = (Math.pow(Math.sin(dlat/2), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(dlon/2), 2));
     670        double a = Math.pow(Math.sin(dlat/2), 2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(dlon/2), 2);
    671671        double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
    672672        return 6367000 * c;
  • trunk/src/org/openstreetmap/josm/tools/I18n.java

    r8292 r8345  
    694694        switch(pluralMode) {
    695695        case MODE_NOTONE: /* bg, da, de, el, en, en_GB, es, et, eu, fi, gl, is, it, iw_IL, nb, nl, sv */
    696             return ((n != 1) ? 1 : 0);
     696            return (n != 1) ? 1 : 0;
    697697        case MODE_NONE: /* id, ja, km, tr, zh_CN, zh_TW */
    698698            return 0;
    699699        case MODE_GREATERONE: /* fr, pt_BR */
    700             return ((n > 1) ? 1 : 0);
     700            return (n > 1) ? 1 : 0;
    701701        case MODE_CS:
    702             return ((n == 1) ? 0 : (((n >= 2) && (n <= 4)) ? 1 : 2));
     702            return (n == 1) ? 0 : (((n >= 2) && (n <= 4)) ? 1 : 2);
    703703        //case MODE_AR:
    704704        //    return ((n == 0) ? 0 : ((n == 1) ? 1 : ((n == 2) ? 2 : ((((n % 100) >= 3)
    705705        //            && ((n % 100) <= 10)) ? 3 : ((((n % 100) >= 11) && ((n % 100) <= 99)) ? 4 : 5)))));
    706706        case MODE_PL:
    707             return ((n == 1) ? 0 : (((((n % 10) >= 2) && ((n % 10) <= 4))
    708                     && (((n % 100) < 10) || ((n % 100) >= 20))) ? 1 : 2));
     707            return (n == 1) ? 0 : (((((n % 10) >= 2) && ((n % 10) <= 4))
     708                    && (((n % 100) < 10) || ((n % 100) >= 20))) ? 1 : 2);
    709709        //case MODE_RO:
    710710        //    return ((n == 1) ? 0 : ((((n % 100) > 19) || (((n % 100) == 0) && (n != 0))) ? 2 : 1));
    711711        case MODE_LT:
    712             return (((n % 10) == 1) && ((n % 100) != 11) ? 0 : (((n % 10) >= 2)
    713                     && (((n % 100) < 10) || ((n % 100) >= 20)) ? 1 : 2));
     712            return ((n % 10) == 1) && ((n % 100) != 11) ? 0 : (((n % 10) >= 2)
     713                    && (((n % 100) < 10) || ((n % 100) >= 20)) ? 1 : 2);
    714714        case MODE_RU:
    715             return ((((n % 10) == 1) && ((n % 100) != 11)) ? 0 : (((((n % 10) >= 2)
    716                     && ((n % 10) <= 4)) && (((n % 100) < 10) || ((n % 100) >= 20))) ? 1 : 2));
     715            return (((n % 10) == 1) && ((n % 100) != 11)) ? 0 : (((((n % 10) >= 2)
     716                    && ((n % 10) <= 4)) && (((n % 100) < 10) || ((n % 100) >= 20))) ? 1 : 2);
    717717        case MODE_SK:
    718             return ((n == 1) ? 1 : (((n >= 2) && (n <= 4)) ? 2 : 0));
     718            return (n == 1) ? 1 : (((n >= 2) && (n <= 4)) ? 2 : 0);
    719719        //case MODE_SL:
    720720        //    return (((n % 100) == 1) ? 1 : (((n % 100) == 2) ? 2 : ((((n % 100) == 3)
  • trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java

    r8338 r8345  
    291291    public static String getURL(double dlat, double dlon, int zoom) {
    292292        // Truncate lat and lon to something more sensible
    293         int decimals = (int) Math.pow(10, (zoom / 3));
    294         double lat = (Math.round(dlat * decimals));
     293        int decimals = (int) Math.pow(10, zoom / 3);
     294        double lat = Math.round(dlat * decimals);
    295295        lat /= decimals;
    296         double lon = (Math.round(dlon * decimals));
     296        double lon = Math.round(dlon * decimals);
    297297        lon /= decimals;
    298298        return Main.getOSMWebsite() + "/#map="+zoom+"/"+lat+"/"+lon;
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r8338 r8345  
    148148    // create a shortcut object from an string as saved in the preferences
    149149    private Shortcut(String prefString) {
    150         List<String> s = (new ArrayList<>(Main.pref.getCollection(prefString)));
     150        List<String> s = new ArrayList<>(Main.pref.getCollection(prefString));
    151151        this.shortText = prefString.substring(15);
    152152        this.longText = s.get(0);
Note: See TracChangeset for help on using the changeset viewer.