Ignore:
Timestamp:
2013-09-22T18:36:07+02:00 (6 years ago)
Author:
Don-vip
Message:

Sonar/FindBugs - various bugfixes / violation fixes

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
8 edited
1 moved

Legend:

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

    r6130 r6246  
    132132            if(selectedWays.size() == 1) {
    133133                w = selectedWays.iterator().next();
    134                 if(w.containsNode(n) == false)
     134                if (!w.containsNode(n))
    135135                    // warning
    136136                    return;
  • trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java

    r6084 r6246  
    88import java.awt.event.ActionEvent;
    99import java.awt.event.KeyEvent;
     10import java.util.Arrays;
    1011import java.util.Collection;
     12import java.util.Collections;
    1113import java.util.HashSet;
    1214import java.util.List;
     
    3840public class AutoScaleAction extends JosmAction {
    3941
    40     public static final String[] MODES = {
     42    public static final Collection<String> MODES = Collections.unmodifiableList(Arrays.asList(
    4143        marktr("data"),
    4244        marktr("layer"),
     
    4648        marktr("problem"),
    4749        marktr("previous"),
    48         marktr("next")};
     50        marktr("next")));
    4951
    5052    private final String mode;
  • trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java

    r6130 r6246  
    6363    public static class JoinAreasResult {
    6464
    65         public boolean mergeSuccessful;
    6665        public boolean hasChanges;
    67         public boolean hasRelationProblems;
    6866
    6967        public List<Multipolygon> polygons;
     
    539537
    540538        result.hasChanges = true;
    541         result.mergeSuccessful = true;
    542539        result.polygons = polygons;
    543540        return result;
  • trunk/src/org/openstreetmap/josm/actions/JumpToAction.java

    r6203 r6246  
    6464                  BorderLayout.NORTH);
    6565
    66         class osmURLListener implements DocumentListener {
     66        class OsmURLListener implements DocumentListener {
    6767            @Override public void changedUpdate(DocumentEvent e) { parseURL(); }
    6868            @Override public void insertUpdate(DocumentEvent e) { parseURL(); }
     
    7070        }
    7171
    72         class osmLonLatListener implements DocumentListener {
     72        class OsmLonLatListener implements DocumentListener {
    7373            @Override public void changedUpdate(DocumentEvent e) { updateUrl(false); }
    7474            @Override public void insertUpdate(DocumentEvent e) { updateUrl(false); }
     
    7676        }
    7777
    78         osmLonLatListener x=new osmLonLatListener();
     78        OsmLonLatListener x = new OsmLonLatListener();
    7979        lat.getDocument().addDocumentListener(x);
    8080        lon.getDocument().addDocumentListener(x);
    8181        zm.getDocument().addDocumentListener(x);
    82         url.getDocument().addDocumentListener(new osmURLListener());
     82        url.getDocument().addDocumentListener(new OsmURLListener());
    8383
    8484        JPanel p = new JPanel(new GridBagLayout());
  • trunk/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java

    r6239 r6246  
    2828import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2929
    30 public class Map_Rectifier_WMSmenuAction extends JosmAction {
     30public class MapRectifierWMSmenuAction extends JosmAction {
    3131    /**
    3232     * Class that bundles all required information of a rectifier service
     
    6565    public ArrayList<RectifierService> services = new ArrayList<RectifierService>();
    6666
    67     public Map_Rectifier_WMSmenuAction() {
     67    public MapRectifierWMSmenuAction() {
    6868        super(tr("Rectified Image..."),
    6969                "OLmarker",
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java

    r6244 r6246  
    161161            boolean merge = Main.pref.getBoolean("download.gps.mergeWithLocal", false);
    162162            Layer active = Main.map.mapView.getActiveLayer();
    163             if (active != null && active instanceof GpxLayer && (merge || ((GpxLayer)active).data.fromServer))
     163            if (active instanceof GpxLayer && (merge || ((GpxLayer)active).data.fromServer))
    164164                return (GpxLayer) active;
    165165            for (GpxLayer l : Main.map.mapView.getLayersOfType(GpxLayer.class)) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r6104 r6246  
    179179
    180180        // update selection to reflect which way being modified
    181         if (currentBaseNode != null && getCurrentDataSet() != null && getCurrentDataSet().getSelected().isEmpty() == false) {
     181        if (currentBaseNode != null && getCurrentDataSet() != null && !getCurrentDataSet().getSelected().isEmpty()) {
    182182            Way continueFrom = getWayForNode(currentBaseNode);
    183183            if (alt && continueFrom != null && (!currentBaseNode.isSelected() || continueFrom.isSelected())) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java

    r6107 r6246  
    310310            return;
    311311
    312         if(sanityCheck() == false)
     312        if (!sanityCheck())
    313313            return;
    314314
     
    586586    }
    587587
    588     private String getStringPref(String subKey) {
    589         return getStringPref(subKey, null);
    590     }
    591 
    592588    @Override
    593589    public void preferenceChanged(PreferenceChangeEvent e) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r6215 r6246  
    312312                // only show merge to node cursor if nearby node and that node is currently
    313313                // not being dragged
    314                 final boolean hasTarget = osm != null && osm instanceof Node && !osm.isSelected();
     314                final boolean hasTarget = osm instanceof Node && !osm.isSelected();
    315315                c = hasTarget ? "merge_to_node" : "merge";
    316316                break;
Note: See TracChangeset for help on using the changeset viewer.