Ignore:
Timestamp:
2014-01-31T02:44:56+01:00 (6 years ago)
Author:
Don-vip
Message:

Sonar - fix various issues

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

Legend:

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

    r5450 r6792  
    4343    }
    4444
     45    /**
     46     * Constructs a new {@code AbstractMergeAction}.
     47     */
    4548    public AbstractMergeAction() {
    4649        super();
     
    7477            return null;
    7578
    76         Layer targetLayer = (Layer) layerList.getSelectedItem();
    77         return targetLayer;
     79        return (Layer) layerList.getSelectedItem();
    7880    }
    7981
  • trunk/src/org/openstreetmap/josm/actions/ActionParameter.java

    r5170 r6792  
    4242            return value;
    4343        }
    44 
    4544    }
    4645
     
    5857        @Override
    5958        public SearchSetting readFromString(String s) {
    60             SearchSetting result = SearchSetting.readFromString(s);
    61             return result;
     59            return SearchSetting.readFromString(s);
    6260        }
    6361
     
    6866            return value.writeToString();
    6967        }
    70 
    7168    }
    7269}
  • trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java

    r6765 r6792  
    7474        return update ? tr("Update multipolygon") : tr("Create multipolygon");
    7575    }
    76    
    77     private class CreateUpdateMultipolygonTask implements Runnable {
     76
     77    private static class CreateUpdateMultipolygonTask implements Runnable {
    7878        private final Collection<Way> selectedWays;
    7979        private final Relation multipolygonRelation;
  • trunk/src/org/openstreetmap/josm/actions/ExpertToggleAction.java

    r6327 r6792  
    2626    private static final List<WeakReference<Component>> visibilityToggleListeners = new ArrayList<WeakReference<Component>>();
    2727
    28     private static ExpertToggleAction INSTANCE = new ExpertToggleAction();
     28    private static final ExpertToggleAction INSTANCE = new ExpertToggleAction();
    2929
    3030    private synchronized static void fireExpertModeChanged(boolean isExpert) {
     
    133133    }
    134134
     135    @Override
    135136    protected void notifySelectedState() {
    136137        super.notifySelectedState();
  • trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java

    r6340 r6792  
    2727import org.openstreetmap.josm.gui.ExtendedDialog;
    2828import org.openstreetmap.josm.gui.layer.ImageryLayer;
     29import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
     30import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2931import org.openstreetmap.josm.tools.GBC;
    3032import org.openstreetmap.josm.tools.ImageProvider;
    31 import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
    32 import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3333
    3434public class ImageryAdjustAction extends MapMode implements MouseListener, MouseMotionListener, AWTEventListener{
     
    4242    private MapMode oldMapMode;
    4343
     44    /**
     45     * Constructs a new {@code ImageryAdjustAction} for the given layer.
     46     * @param layer The imagery layer
     47     */
    4448    public ImageryAdjustAction(ImageryLayer layer) {
    4549        super(tr("New offset"), "adjustimg",
     
    5054    }
    5155
    52     @Override public void enterMode() {
     56    @Override
     57    public void enterMode() {
    5358        super.enterMode();
    5459        if (layer == null)
     
    6368        offsetDialog.setVisible(true);
    6469    }
    65    
     70
    6671    protected void addListeners() {
    6772        Main.map.mapView.addMouseListener(this);
     
    7075            Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
    7176        } catch (SecurityException ex) {
    72         }
    73     }
    74 
    75     @Override public void exitMode() {
     77            Main.error(ex);
     78        }
     79    }
     80
     81    @Override
     82    public void exitMode() {
    7683        super.exitMode();
    7784        if (offsetDialog != null) {
     
    8289        removeListeners();
    8390    }
    84    
     91
    8592    protected void removeListeners() {
    8693        try {
    8794            Toolkit.getDefaultToolkit().removeAWTEventListener(this);
    8895        } catch (SecurityException ex) {
     96            Main.error(ex);
    8997        }
    9098        if (Main.isDisplayingMapView()) {
     
    119127    }
    120128
    121     @Override public void mousePressed(MouseEvent e) {
     129    @Override
     130    public void mousePressed(MouseEvent e) {
    122131        if (e.getButton() != MouseEvent.BUTTON1)
    123132            return;
     
    130139    }
    131140
    132     @Override public void mouseDragged(MouseEvent e) {
     141    @Override
     142    public void mouseDragged(MouseEvent e) {
    133143        if (layer == null || prevEastNorth == null) return;
    134144        EastNorth eastNorth =
     
    144154    }
    145155
    146     @Override public void mouseReleased(MouseEvent e) {
     156    @Override
     157    public void mouseReleased(MouseEvent e) {
    147158        Main.map.mapView.repaint();
    148159        Main.map.mapView.resetCursor(this);
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r6546 r6792  
    272272            Toolkit.getDefaultToolkit().removeAWTEventListener(this);
    273273        } catch (SecurityException ex) {
     274            Main.warn(ex);
    274275        }
    275276
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r6380 r6792  
    136136    private final Cursor cursorCreateNodes;
    137137
    138     private class ReferenceSegment {
     138    private static class ReferenceSegment {
    139139        public final EastNorth en;
    140140        public final EastNorth p1;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java

    r6367 r6792  
    252252        boolean oldAlt = alt, oldShift = shift, oldCtrl = ctrl;
    253253        updateKeyModifiers(e);
    254         boolean changed = (oldAlt != alt || oldShift != shift || oldCtrl != ctrl);
    255         return changed;
     254        return (oldAlt != alt || oldShift != shift || oldCtrl != ctrl);
    256255    }
    257256
  • trunk/src/org/openstreetmap/josm/actions/relation/DeleteRelationsAction.java

    r6336 r6792  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.actions.relation;
     3
     4import static org.openstreetmap.josm.tools.I18n.tr;
    35
    46import java.awt.event.ActionEvent;
     
    810import org.openstreetmap.josm.tools.ImageProvider;
    911
    10 import static org.openstreetmap.josm.tools.I18n.tr;
    11 
    12 
    1312/**
    1413 * Action that delete relations
     
    1615 */
    1716public class DeleteRelationsAction extends AbstractRelationAction {
    18     class AbortException extends Exception {}
     17    static class AbortException extends Exception {}
    1918
    2019    /**
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r6674 r6792  
    7777            addMatchFactory(new CoreUnaryMatchFactory());
    7878        }
    79 
    8079    }
    8180
     
    289288     */
    290289    public static class Always extends Match {
    291         public static Always INSTANCE = new Always();
     290        /** The unique instance/ */
     291        public static final Always INSTANCE = new Always();
    292292        @Override public boolean match(OsmPrimitive osm) {
    293293            return true;
  • trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java

    r6699 r6792  
    7272     * Data fix to remove spaces at begin or end of tags
    7373     */
    74     public class FixDataSpace implements FixData {
     74    public static class FixDataSpace implements FixData {
    7575        @Override
    7676        public boolean fixKeys(Map<String, String> keys, OsmPrimitive osm) {
     
    105105     * Data fix to cleanup wrong spelled keys
    106106     */
    107     public class FixDataKey implements FixData {
     107    public static class FixDataKey implements FixData {
    108108        /** key of wrong data */
    109109        String oldKey;
     
    136136     * Data fix to cleanup wrong spelled tags
    137137     */
    138     public class FixDataTag implements FixData {
     138    public static class FixDataTag implements FixData {
    139139        /** key of wrong data */
    140140        String oldKey;
Note: See TracChangeset for help on using the changeset viewer.