Changeset 9970 in josm for trunk/src


Ignore:
Timestamp:
2016-03-12T23:18:04+01:00 (8 years ago)
Author:
Don-vip
Message:

sonar - remove useless parentheses

Location:
trunk/src/org/openstreetmap/josm
Files:
20 edited

Legend:

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

    r9473 r9970  
    175175        }
    176176        if (targetNode == null) {
    177             targetNode = (oldestNode != null ? oldestNode : lastNode);
     177            targetNode = oldestNode != null ? oldestNode : lastNode;
    178178        }
    179179        return targetNode;
  • trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java

    r9470 r9970  
    697697            for (OsmPrimitive ref : way.getReferrers()) {
    698698                if (ref instanceof Relation && ref.isUsable()) {
    699                     affectedRelations.add((ref.getDisplayName(DefaultNameFormatter.getInstance())));
     699                    affectedRelations.add(ref.getDisplayName(DefaultNameFormatter.getInstance()));
    700700                }
    701701            }
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ModifiersSpec.java

    r8870 r9970  
    2525        char c = str.charAt(2);
    2626        // @formatter:off
    27         alt   = (a == '?' ? UNKNOWN : (a == 'A' ? ON : OFF));
    28         shift = (s == '?' ? UNKNOWN : (s == 'S' ? ON : OFF));
    29         ctrl  = (c == '?' ? UNKNOWN : (c == 'C' ? ON : OFF));
     27        alt   = a == '?' ? UNKNOWN : (a == 'A' ? ON : OFF);
     28        shift = s == '?' ? UNKNOWN : (s == 'S' ? ON : OFF);
     29        ctrl  = c == '?' ? UNKNOWN : (c == 'C' ? ON : OFF);
    3030        // @formatter:on
    3131    }
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r9246 r9970  
    410410        // We don't want to change to draw tool if the user tries to (de)select
    411411        // stuff but accidentally clicks in an empty area when selection is empty
    412         cancelDrawMode = (shift || ctrl);
     412        cancelDrawMode = shift || ctrl;
    413413        didMouseDrag = false;
    414414        initialMoveThresholdExceeded = false;
     
    11521152                } else {
    11531153                    // setup for iterating a sel group again or a new, different one..
    1154                     nxt = (cycleList.contains(cycleStart)) ? cycleStart : first;
     1154                    nxt = cycleList.contains(cycleStart) ? cycleStart : first;
    11551155                    cycleStart = nxt;
    11561156                }
  • trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java

    r9171 r9970  
    7070                    try {
    7171                        String xml = attributionLoader.updateIfRequiredString();
    72                         List<Attribution> ret = parseAttributionText(new InputSource(new StringReader((xml))));
     72                        List<Attribution> ret = parseAttributionText(new InputSource(new StringReader(xml)));
    7373                        if (attributionDownloadedTask != null) {
    7474                            GuiHelper.runInEDT(attributionDownloadedTask);
  • trunk/src/org/openstreetmap/josm/data/oauth/SignpostAdapters.java

    r9669 r9970  
    77import java.util.Map;
    88
     9import org.openstreetmap.josm.tools.HttpClient;
     10
    911import oauth.signpost.AbstractOAuthConsumer;
    1012import oauth.signpost.AbstractOAuthProvider;
    11 
    12 import org.openstreetmap.josm.tools.HttpClient;
    1313
    1414/**
     
    5454        @Override
    5555        protected HttpRequest wrap(Object request) {
    56             return new HttpRequest(((HttpClient) request));
     56            return new HttpRequest((HttpClient) request);
    5757        }
    5858    }
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r9961 r9970  
    292292    protected OsmPrimitive(long id, int version, boolean allowNegativeId) {
    293293        this(id, allowNegativeId);
    294         this.version = (id > 0 ? version : 0);
     294        this.version = id > 0 ? version : 0;
    295295        setIncomplete(id > 0 && version == 0);
    296296    }
  • trunk/src/org/openstreetmap/josm/data/projection/proj/AlbersEqualArea.java

    r9558 r9970  
    110110        double  cosphi = Math.cos(phi1);
    111111        double  n      = sinphi;
    112         boolean secant = (Math.abs(phi1 - phi2) >= EPSILON);
     112        boolean secant = Math.abs(phi1 - phi2) >= EPSILON;
    113113        double m1 = msfn(sinphi, cosphi);
    114114        double q1 = qsfn(sinphi);
     
    206206        if (e >= EPSILON) {
    207207            final double con = e * sinphi;
    208             return (one_es * (sinphi / (1. - con*con) -
    209                     (0.5/e) * Math.log((1.-con) / (1.+con))));
     208            return one_es * (sinphi / (1. - con*con) -
     209                    (0.5/e) * Math.log((1.-con) / (1.+con)));
    210210        } else {
    211211            return sinphi + sinphi;
  • trunk/src/org/openstreetmap/josm/data/projection/proj/LambertAzimuthalEqualArea.java

    r9636 r9970  
    258258        if (e >= EPSILON) {
    259259            final double con = e * sinphi;
    260             return ((1.0 - e2) * (sinphi / (1.0 - con*con) -
    261                     (0.5 / e) * Math.log((1.0 - con) / (1.0 + con))));
     260            return (1.0 - e2) * (sinphi / (1.0 - con*con) -
     261                    (0.5 / e) * Math.log((1.0 - con) / (1.0 + con)));
    262262        } else {
    263263            return sinphi + sinphi;
  • trunk/src/org/openstreetmap/josm/data/projection/proj/ObliqueMercator.java

    r9558 r9970  
    381381                u = AB * x;
    382382            } else {
    383                 u = ArB * Math.atan2((S * cosgamma0 + V * singamma0), temp);
     383                u = ArB * Math.atan2(S * cosgamma0 + V * singamma0, temp);
    384384            }
    385385        } else {
     
    408408            y = Math.pow(E / Math.sqrt((1. + Up) / (1. - Up)), 1.0 / B);  //calculate t
    409409            y = cphi2(y);
    410             x = -Math.atan2((Sp * cosgamma0 - Vp * singamma0), Math.cos(BrA * u)) / B;
     410            x = -Math.atan2(Sp * cosgamma0 - Vp * singamma0, Math.cos(BrA * u)) / B;
    411411        }
    412412        return new double[] {y, x};
  • trunk/src/org/openstreetmap/josm/data/projection/proj/PolarStereographic.java

    r9559 r9970  
    161161            if (Math.abs(phi-phi0) < ITERATION_TOLERANCE) {
    162162                x = (Math.abs(rho) < EPSILON) ? 0.0 : Math.atan2(x, -y);
    163                 y = (southPole) ? -phi : phi;
     163                y = southPole ? -phi : phi;
    164164                break;
    165165            }
  • trunk/src/org/openstreetmap/josm/data/projection/proj/TransverseMercator.java

    r9558 r9970  
    137137
    138138        /* NOTE: meridinal distance at latitudeOfOrigin is always 0 */
    139         y = (mlfn(y, sinphi, cosphi) - ml0 +
     139        y = mlfn(y, sinphi, cosphi) - ml0 +
    140140            sinphi * al * x *
    141141            FC2 * (1.0 +
    142142            FC4 * als * (5.0 - t + n*(9.0 + 4.0*n) +
    143143            FC6 * als * (61.0 + t * (t - 58.0) + n*(270.0 - 330.0*t) +
    144             FC8 * als * (1385.0 + t * (t*(543.0 - t) - 3111.0))))));
     144            FC8 * als * (1385.0 + t * (t*(543.0 - t) - 3111.0)))));
    145145
    146146        x = al*(FC1 + FC3 * als*(1.0 - t + n +
  • trunk/src/org/openstreetmap/josm/data/validation/util/Entities.java

    r8848 r9970  
    393393                        }
    394394                        String value = mapNameToValue.get(entityContent);
    395                         entityValue = (value == null ? -1 : Integer.parseInt(value));
     395                        entityValue = value == null ? -1 : Integer.parseInt(value);
    396396                    }
    397397                }
  • trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java

    r9918 r9970  
    230230
    231231        if (msg instanceof String) {
    232             msg = new JMultilineLabel(((String) msg), true);
     232            msg = new JMultilineLabel((String) msg, true);
    233233        }
    234234
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r9969 r9970  
    991991                if (nextKeyIndex == rows[rows.length-1]) {
    992992                    // no gap found, pick next or previous key in list
    993                     nextKeyIndex = (nextKeyIndex + 1 < rowCount ? nextKeyIndex + 1 : rows[0] - 1);
     993                    nextKeyIndex = nextKeyIndex + 1 < rowCount ? nextKeyIndex + 1 : rows[0] - 1;
    994994                } else {
    995995                    // gap found
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java

    r9246 r9970  
    7777                if (!RelationSortUtils.isOneway(m) && lastWct != null) {
    7878                    wct.direction = determineDirection(i-1, lastWct.direction, i);
    79                     wct.linkPrev = (wct.direction != NONE);
     79                    wct.linkPrev = wct.direction != NONE;
    8080                }
    8181            }
  • trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java

    r9231 r9970  
    388388                Rectangle splitChildBounds = splitChild.getBounds();
    389389                double minSplitChildWidth = minimumNodeSize(splitChild).getWidth();
    390                 double splitChildWeight = (onlyShrinkWeightedComponents)
     390                double splitChildWeight = onlyShrinkWeightedComponents
    391391                ? splitChild.getWeight()
    392392                        : (splitChildBounds.getWidth() / totalWidth);
     
    434434                Rectangle splitChildBounds = splitChild.getBounds();
    435435                double minSplitChildHeight = minimumNodeSize(splitChild).getHeight();
    436                 double splitChildWeight = (onlyShrinkWeightedComponents)
     436                double splitChildWeight = onlyShrinkWeightedComponents
    437437                ? splitChild.getWeight()
    438438                        : (splitChildBounds.getHeight() / totalHeight);
     
    499499                    layout2(splitChild, newSplitChildBounds);
    500500                } else if ((availableWidth > 0.0) && (splitChildWeight > 0.0)) {
    501                     double allocatedWidth = (splitChild.equals(lastWeightedChild))
     501                    double allocatedWidth = splitChild.equals(lastWeightedChild)
    502502                    ? availableWidth
    503503                            : Math.rint(splitChildWeight * extraWidth);
     
    537537                    layout2(splitChild, newSplitChildBounds);
    538538                } else if ((availableHeight > 0.0) && (splitChildWeight > 0.0)) {
    539                     double allocatedHeight = (splitChild.equals(lastWeightedChild))
     539                    double allocatedHeight = splitChild.equals(lastWeightedChild)
    540540                    ? availableHeight
    541541                            : Math.rint(splitChildWeight * extraHeight);
     
    616616                    Node splitChild = splitChildren.next();
    617617                    Divider dividerChild =
    618                         (splitChildren.hasNext()) ? (Divider) (splitChildren.next()) : null;
     618                        splitChildren.hasNext() ? (Divider) (splitChildren.next()) : null;
    619619
    620620                    double childWidth = 0.0;
     
    650650                    Node splitChild = splitChildren.next();
    651651                    Divider dividerChild =
    652                         (splitChildren.hasNext()) ? (Divider) (splitChildren.next()) : null;
     652                        splitChildren.hasNext() ? (Divider) splitChildren.next() : null;
    653653
    654654                        double childHeight = 0.0;
     
    762762        if (root instanceof Divider) {
    763763            Divider divider = (Divider) root;
    764             return (divider.getBounds().contains(x, y)) ? divider : null;
     764            return divider.getBounds().contains(x, y) ? divider : null;
    765765        } else if (root instanceof Split) {
    766766            Split split = (Split) root;
  • trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitPane.java

    r8840 r9970  
    336336            MultiSplitLayout.Divider divider = getMultiSplitLayout().dividerAt(x, y);
    337337            if (divider != null) {
    338                 cursorID  = (divider.isVertical()) ?
     338                cursorID  = divider.isVertical() ?
    339339                    Cursor.E_RESIZE_CURSOR :
    340340                    Cursor.N_RESIZE_CURSOR;
  • trunk/src/org/openstreetmap/josm/io/OsmWriter.java

    r9310 r9970  
    5656        super(out);
    5757        this.osmConform = osmConform;
    58         this.version = (version == null ? DEFAULT_API_VERSION : version);
     58        this.version = version == null ? DEFAULT_API_VERSION : version;
    5959    }
    6060
  • trunk/src/org/openstreetmap/josm/tools/ExifReader.java

    r9697 r9970  
    190190                throw new IllegalArgumentException("deg, min and sec are NaN");
    191191
    192             value = (Double.isNaN(deg) ? 0 : deg + (Double.isNaN(min) ? 0 : (min / 60)) + (Double.isNaN(sec) ? 0 : (sec / 3600)));
     192            value = Double.isNaN(deg) ? 0 : deg + (Double.isNaN(min) ? 0 : (min / 60)) + (Double.isNaN(sec) ? 0 : (sec / 3600));
    193193
    194194            if (dirGps.getString(gpsTagRef).charAt(0) == cRef) {
Note: See TracChangeset for help on using the changeset viewer.