Changeset 6378 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2013-11-08T01:39:06+01:00 (10 years ago)
Author:
Don-vip
Message:

Sonar/Findbugs - fix various violations, javadoc

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

Legend:

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

    r6367 r6378  
    7272        public List<Way> innerWays;
    7373
    74         public Relation relation;
    75 
    7674        public Multipolygon(Way way) {
    7775            outerWay = way;
     
    12781276            Multipolygon pol = new Multipolygon(outerWay);
    12791277            pol.innerWays.addAll(innerWays);
    1280             pol.relation = r;
    12811278
    12821279            result.add(pol);
  • trunk/src/org/openstreetmap/josm/data/validation/FixableTestError.java

    r6377 r6378  
     1// License: GPL. See LICENSE file for details.
    12package org.openstreetmap.josm.data.validation;
    23
     
    67import java.util.Collection;
    78
     9/**
     10 * Validation error easily fixable right at its detection. The fix can be given when constructing the error.
     11 * @since 6377
     12 */
    813public class FixableTestError extends TestError {
    914    protected final Command fix;
  • trunk/src/org/openstreetmap/josm/data/validation/TestError.java

    r6264 r6378  
    2828/**
    2929 * Validation error
    30  * @author frsantos
     30 * @since 3669
    3131 */
    3232public class TestError implements Comparable<TestError>, DataSetListener {
     
    5252
    5353    /**
    54      * Constructors
     54     * Constructs a new {@code TestError}.
    5555     * @param tester The tester
    5656     * @param severity The severity of this error
  • trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java

    r6377 r6378  
    164164            try {
    165165                prettifiedValue = (String) ((Invocable) ENGINE).invokeMethod(r, "prettifyValue");
    166             } catch (Exception ignore) {
     166            } catch (Exception e) {
     167                Main.debug(e.getMessage());
    167168            }
    168169            for (final Object i : getList(((Invocable) ENGINE).invokeMethod(r, "getWarnings"))) {
  • trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java

    r6365 r6378  
    200200        setMaxTilesInMemory(Main.pref.getInteger("slippy_map_chooser.max_tiles", 1000));
    201201
    202         List<TileSource> tileSources = getTileSources();
     202        List<TileSource> tileSources = getAllTileSources();
    203203
    204204        iSourceButton = new SourceButton(tileSources);
     
    222222    }
    223223   
    224     private final List<TileSource> getTileSources() {
     224    private List<TileSource> getAllTileSources() {
    225225        List<TileSource> tileSources = new ArrayList<TileSource>();
    226226        for (TileSourceProvider provider: providers) {
     
    400400     */
    401401    public final void refreshTileSources() {
    402         iSourceButton.setSources(getTileSources());
     402        iSourceButton.setSources(getAllTileSources());
    403403    }
    404404}
  • trunk/src/org/openstreetmap/josm/gui/download/BookmarkList.java

    r6365 r6378  
    239239     * Saves all bookmarks to the preferences file
    240240     */
    241     public void save() {
     241    public final void save() {
    242242        LinkedList<Collection<String>> coll = new LinkedList<Collection<String>>();
    243243        for (Object o : ((DefaultListModel)getModel()).toArray()) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapImage.java

    r6374 r6378  
    121121            int w = getWidth(), h = getHeight();
    122122            if (mustRescale(getImage())) {
    123                 w = h = 16;
     123                w = 16;
     124                h = 16;
    124125            }
    125126            return new Rectangle(-w/2, -h/2, w, h);
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    r6335 r6378  
    15021502        private final String pref;
    15031503
    1504         public SourcePrefHelper(String pref, String prefOld) {
     1504        public SourcePrefHelper(String pref) {
    15051505            this.pref = pref;
    15061506        }
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java

    r6246 r6378  
    170170            MapPaintStyles.readFromPreferences();
    171171        }
    172         if (Main.isDisplayingMapView())
    173         {
     172        if (Main.isDisplayingMapView()) {
    174173            MapPaintStyles.getStyles().clearCached();
    175174        }
     
    186185    public static class MapPaintPrefHelper extends SourceEditor.SourcePrefHelper {
    187186
     187        /**
     188         * The unique instance.
     189         */
    188190        public final static MapPaintPrefHelper INSTANCE = new MapPaintPrefHelper();
    189191
     192        /**
     193         * Constructs a new {@code MapPaintPrefHelper}.
     194         */
    190195        public MapPaintPrefHelper() {
    191             super("mappaint.style.entries", "mappaint.style.sources-list");
     196            super("mappaint.style.entries");
    192197        }
    193198
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java

    r6362 r6378  
    283283        if (taggingPresets.isEmpty()) {
    284284            Main.main.menu.presetsMenu.setVisible(false);
    285         }
    286         else
    287         {
     285        } else {
    288286            AutoCompletionManager.cachePresets(taggingPresets);
    289287            HashMap<TaggingPresetMenu,JMenu> submenus = new HashMap<TaggingPresetMenu,JMenu>();
    290             for (final TaggingPreset p : taggingPresets)
    291             {
     288            for (final TaggingPreset p : taggingPresets) {
    292289                JMenu m = p.group != null ? submenus.get(p.group) : Main.main.menu.presetsMenu;
    293290                if (p instanceof TaggingPresetSeparator) {
    294291                    m.add(new JSeparator());
    295                 } else if (p instanceof TaggingPresetMenu)
    296                 {
     292                } else if (p instanceof TaggingPresetMenu) {
    297293                    JMenu submenu = new JMenu(p);
    298294                    submenu.setText(p.getLocaleName());
     
    300296                    submenus.put((TaggingPresetMenu)p, submenu);
    301297                    m.add(submenu);
    302                 }
    303                 else
    304                 {
     298                } else {
    305299                    JMenuItem mi = new JMenuItem(p);
    306300                    mi.setText(p.getLocaleName());
     
    309303            }
    310304        }
    311         if(Main.pref.getBoolean("taggingpreset.sortmenu")) {
     305        if (Main.pref.getBoolean("taggingpreset.sortmenu")) {
    312306            TaggingPresetMenu.sortMenu(Main.main.menu.presetsMenu);
    313307        }
     
    316310    public static class PresetPrefHelper extends SourceEditor.SourcePrefHelper {
    317311
     312        /**
     313         * The unique instance.
     314         */
    318315        public final static PresetPrefHelper INSTANCE = new PresetPrefHelper();
    319316
     317        /**
     318         * Constructs a new {@code PresetPrefHelper}.
     319         */
    320320        public PresetPrefHelper() {
    321             super("taggingpreset.entries", "taggingpreset.sources-list");
     321            super("taggingpreset.entries");
    322322        }
    323323
Note: See TracChangeset for help on using the changeset viewer.