Ignore:
Timestamp:
2017-01-12T01:24:40+01:00 (3 years ago)
Author:
Don-vip
Message:

sonar - fb-contrib:SEO_SUBOPTIMAL_EXPRESSION_ORDER - Performance - Method orders expressions in a conditional in a sub optimal way

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
6 edited

Legend:

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

    r11402 r11452  
    414414                } else
    415415                    continue;
    416                 if (candidateWay.equals(lastWay) && candidateComingToHead)
     416                if (candidateComingToHead && candidateWay.equals(lastWay))
    417417                    continue;
    418418
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r11343 r11452  
    252252            list.addListSelectionListener(e -> {
    253253                final Way selected = list.getSelectedValue();
    254                 if (Main.isDisplayingMapView() && selected != null && selected.getNodesCount() > 1) {
     254                if (selected != null && Main.isDisplayingMapView() && selected.getNodesCount() > 1) {
    255255                    final Collection<WaySegment> segments = new ArrayList<>(selected.getNodesCount() - 1);
    256256                    final Iterator<Node> it = selected.getNodes().iterator();
  • trunk/src/org/openstreetmap/josm/actions/audio/AudioPlayPauseAction.java

    r8510 r11452  
    3636        URL url = AudioPlayer.url();
    3737        try {
    38             if (AudioPlayer.paused() && url != null) {
     38            if (url != null && AudioPlayer.paused()) {
    3939                AudioPlayer.play(url);
    4040            } else if (AudioPlayer.playing()) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r10936 r11452  
    229229        // update selection to reflect which way being modified
    230230        OsmDataLayer editLayer = getLayerManager().getEditLayer();
    231         if (getCurrentBaseNode() != null && editLayer != null && !editLayer.data.selectionEmpty()) {
     231        if (editLayer != null && getCurrentBaseNode() != null && !editLayer.data.selectionEmpty()) {
    232232            DataSet currentDataSet = editLayer.data;
    233233            Way continueFrom = getWayForNode(getCurrentBaseNode());
     
    11241124
    11251125        // This happens when nothing is selected, but we still want to highlight the "target node"
    1126         if (mouseOnExistingNode == null && getLayerManager().getEditDataSet().selectionEmpty() && mousePos != null) {
     1126        if (mouseOnExistingNode == null && mousePos != null && getLayerManager().getEditDataSet().selectionEmpty()) {
    11271127            mouseOnExistingNode = Main.map.mapView.getNearestNode(mousePos, OsmPrimitive::isSelectable);
    11281128        }
     
    11611161        if (Main.map.mapView == null || mousePos == null
    11621162                // don't draw line if we don't know where from or where to
    1163                 || getCurrentBaseNode() == null || currentMouseEastNorth == null
     1163                || currentMouseEastNorth == null || getCurrentBaseNode() == null
    11641164                // don't draw line if mouse is outside window
    11651165                || !Main.map.mapView.getBounds().contains(mousePos))
     
    12381238         * Check whether a connection will be made
    12391239         */
    1240         if (getCurrentBaseNode() != null && !wayIsFinished) {
     1240        if (!wayIsFinished && getCurrentBaseNode() != null) {
    12411241            if (alt) {
    12421242                rv.append(' ').append(tr("Start new way from last node."));
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r11385 r11452  
    586586
    587587            // Select Draw Tool if no selection has been made
    588             if (getLayerManager().getEditDataSet().selectionEmpty() && !cancelDrawMode) {
     588            if (!cancelDrawMode && getLayerManager().getEditDataSet().selectionEmpty()) {
    589589                Main.map.selectDrawTool(true);
    590590                updateStatusLine();
     
    639639    @Override
    640640    public void doKeyPressed(KeyEvent e) {
    641         if (!Main.isDisplayingMapView() ||
    642                 !repeatedKeySwitchLassoOption || !getShortcut().isEvent(e)) return;
     641        if (!repeatedKeySwitchLassoOption || !Main.isDisplayingMapView() || !getShortcut().isEvent(e))
     642            return;
    643643        if (Main.isDebugEnabled()) {
    644644            Main.debug(getClass().getName()+" consuming event "+e);
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r11446 r11452  
    776776                    mapCSSSearch == that.mapCSSSearch &&
    777777                    allElements == that.allElements &&
    778                     Objects.equals(text, that.text) &&
    779                     mode == that.mode;
     778                    mode == that.mode &&
     779                    Objects.equals(text, that.text);
    780780        }
    781781
Note: See TracChangeset for help on using the changeset viewer.