Ignore:
Timestamp:
2013-11-03T01:06:23+01:00 (12 years ago)
Author:
Don-vip
Message:

Checkstyle:

  • private constructors for util classes
  • final classes
  • missing "else" statements
  • import cleanup
Location:
trunk/src/org/openstreetmap/josm/tools
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java

    r6310 r6362  
    2222 * @since 547
    2323 */
    24 public class AudioPlayer extends Thread {
     24public final class AudioPlayer extends Thread {
    2525
    2626    private static AudioPlayer audioPlayer = null;
  • trunk/src/org/openstreetmap/josm/tools/AudioUtil.java

    r6070 r6362  
    1717 * @since 1462
    1818 */
    19 public class AudioUtil {
     19public final class AudioUtil {
    2020
     21    private AudioUtil() {
     22        // Hide default constructor for utils classes
     23    }
     24   
    2125    /**
    2226     * Returns calibrated length of recording in seconds.
  • trunk/src/org/openstreetmap/josm/tools/Base64.java

    r3840 r6362  
    44import java.nio.ByteBuffer;
    55
    6 public class Base64 {
     6public final class Base64 {
    77
     8    private Base64() {
     9        // Hide default constructor for utils classes
     10    }
     11   
    812    private static String encDefault = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    913    private static String encUrlSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
  • trunk/src/org/openstreetmap/josm/tools/CheckParameterUtil.java

    r5980 r6362  
    1212 * This utility class provides a collection of static helper methods for checking
    1313 * parameters at run-time.
    14  * @ince 2711
     14 * @since 2711
    1515 */
    16 public class CheckParameterUtil {
     16public final class CheckParameterUtil {
    1717
    18     private CheckParameterUtil(){}
     18    private CheckParameterUtil() {
     19        // Hide default constructor for utils classes
     20    }
    1921
    2022    /**
  • trunk/src/org/openstreetmap/josm/tools/ColorHelper.java

    r6360 r6362  
    77 * Helper to convert from color to html string and back
    88 */
    9 public class ColorHelper {
     9public final class ColorHelper {
    1010
    1111    private ColorHelper() {
  • trunk/src/org/openstreetmap/josm/tools/CopyList.java

    r6084 r6362  
    5656
    5757    // read-only access:
    58     public @Override E get(int index) {
     58    @Override
     59    public E get(int index) {
    5960        rangeCheck(index);
    6061        return array[index];
    6162    }
    6263
    63     public @Override int size() {
     64    @Override
     65    public int size() {
    6466        return size;
    6567    }
    6668
    6769    // modification:
    68     public @Override E set(int index, E element) {
     70    @Override
     71    public E set(int index, E element) {
    6972        rangeCheck(index);
    7073        changeCheck();
     
    7679
    7780    // full resizable semantics:
    78     public @Override void add(int index, E element) {
     81    @Override
     82    public void add(int index, E element) {
    7983        // range check
    8084        ensureCapacity(size+1);
     
    8690    }
    8791
    88     public @Override E remove(int index) {
     92    @Override
     93    public E remove(int index) {
    8994        rangeCheck(index);
    9095        changeCheck();
     
    102107
    103108    // speed optimizations:
    104     public @Override boolean add(E element) {
     109    @Override
     110    public boolean add(E element) {
    105111        ensureCapacity(size+1);
    106112        changeCheck();
     
    109115    }
    110116
    111     public @Override void clear() {
     117    @Override
     118    public void clear() {
    112119        modCount++;
    113120
     
    125132     * @return a clone of this <tt>CopyList</tt> instance
    126133     */
    127     public @Override Object clone() {
     134    @Override
     135    public Object clone() {
    128136        return new CopyList<E>(array, size);
    129137    }
  • trunk/src/org/openstreetmap/josm/tools/DateParser.java

    r2512 r6362  
    1010 * @author Immanuel.Scholz
    1111 */
    12 public class DateParser {
     12public final class DateParser {
     13   
     14    private DateParser() {
     15        // Hide default constructor for utils classes
     16    }
     17   
    1318    public static Date parse(String d) throws ParseException {
    1419        return new PrimaryDateParser().parse(d);
  • trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java

    r6248 r6362  
    3737
    3838@SuppressWarnings("CallToThreadDumpStack")
    39 public class ExceptionUtil {
     39public final class ExceptionUtil {
     40   
    4041    private ExceptionUtil() {
     42        // Hide default constructor for utils classes
    4143    }
    4244
  • trunk/src/org/openstreetmap/josm/tools/ExifReader.java

    r6360 r6362  
    2525 * @since 99
    2626 */
    27 public class ExifReader {
     27public final class ExifReader {
    2828
    2929    private ExifReader() {
  • trunk/src/org/openstreetmap/josm/tools/GBC.java

    r5275 r6362  
    1515 * @author imi
    1616 */
    17 public class GBC extends GridBagConstraints {
     17public final class GBC extends GridBagConstraints {
    1818
    1919    /**
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r6316 r6362  
    3030 * @author viesturs
    3131 */
    32 public class Geometry {
     32public final class Geometry {
     33   
     34    private Geometry() {
     35        // Hide default constructor for utils classes
     36    }
     37   
    3338    public enum PolygonIntersection {FIRST_INSIDE_SECOND, SECOND_INSIDE_FIRST, OUTSIDE, CROSSING}
    3439
  • trunk/src/org/openstreetmap/josm/tools/I18n.java

    r6360 r6362  
    3131 * @author Immanuel.Scholz
    3232 */
    33 public class I18n {
     33public final class I18n {
    3434   
    3535    private I18n() {
  • trunk/src/org/openstreetmap/josm/tools/InputMapUtils.java

    r6070 r6362  
    1616 *
    1717 */
    18 public class InputMapUtils {
    19       public static void unassignCtrlShiftUpDown(JComponent cmp, int condition) {
     18public final class InputMapUtils {
     19   
     20    private InputMapUtils() {
     21        // Hide default constructor for utils classes
     22    }
     23   
     24    public static void unassignCtrlShiftUpDown(JComponent cmp, int condition) {
    2025        InputMap inputMap=SwingUtilities.getUIInputMap(cmp, condition);
    2126        inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_UP,InputEvent.CTRL_MASK|InputEvent.SHIFT_MASK));
     
    2429        inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN,InputEvent.ALT_MASK|InputEvent.SHIFT_MASK));
    2530        SwingUtilities.replaceUIInputMap(cmp,JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,inputMap);
    26       }
     31    }
    2732
    28 
    29       /**
    30        * Enable activating button on Enter (which is replaced with spacebar for certain Look-And-Feels)
    31        */
    32       public static void enableEnter(JButton b) {
     33    /**
     34     * Enable activating button on Enter (which is replaced with spacebar for certain Look-And-Feels)
     35     */
     36    public static void enableEnter(JButton b) {
    3337         b.setFocusable(true);
    3438         b.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enter");
    3539         b.getActionMap().put("enter",b.getAction());
    36       }
     40    }
    3741
    38       public static void addEnterAction(JComponent c, Action a) {
     42    public static void addEnterAction(JComponent c, Action a) {
    3943         c.getActionMap().put("enter", a);
    4044         c.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "enter");
    41       }
     45    }
    4246
    43       public static void addSpacebarAction(JComponent c, Action a) {
     47    public static void addSpacebarAction(JComponent c, Action a) {
    4448         c.getActionMap().put("spacebar", a);
    4549         c.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "spacebar");
    46       }
    47 
     50    }
    4851}
  • trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java

    r6360 r6362  
    44import java.util.Locale;
    55
    6 public class LanguageInfo {
     6public final class LanguageInfo {
    77   
    88    private LanguageInfo() {
  • trunk/src/org/openstreetmap/josm/tools/MultikeyActionsHandler.java

    r6223 r6362  
    2727import org.openstreetmap.josm.tools.MultikeyShortcutAction.MultikeyInfo;
    2828
    29 public class MultikeyActionsHandler {
     29public final class MultikeyActionsHandler {
    3030
    3131    private static final long DIALOG_DELAY = 1000;
  • trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java

    r6360 r6362  
    2020 * @author Imi
    2121 */
    22 public class OpenBrowser {
     22public final class OpenBrowser {
    2323
    2424    private OpenBrowser() {
  • trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java

    r6317 r6362  
    1313import org.openstreetmap.josm.data.coor.LatLon;
    1414
    15 public class OsmUrlToBounds {
     15public final class OsmUrlToBounds {
    1616    private static final String SHORTLINK_PREFIX = "http://osm.org/go/";
     17   
     18    private OsmUrlToBounds() {
     19        // Hide default constructor for utils classes
     20    }
    1721
    1822    public static Bounds parse(String url) {
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java

    r6310 r6362  
    1212import java.io.InputStreamReader;
    1313import java.util.Arrays;
    14 import java.util.List;
    1514
    1615import org.openstreetmap.josm.Main;
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r6316 r6362  
    3434 *
    3535 */
    36 public class Shortcut {
     36public final class Shortcut {
    3737    private String shortText;        // the unique ID of the shortcut
    3838    private String longText;         // a human readable description that will be shown in the preferences
  • trunk/src/org/openstreetmap/josm/tools/TaggingPresetNameTemplateList.java

    r6068 r6362  
    1515 * List of tagging presets with name templates, allows to find appropriate template based on existing primitive
    1616 */
    17 public class TaggingPresetNameTemplateList {
     17public final class TaggingPresetNameTemplateList {
    1818
    1919    private static TaggingPresetNameTemplateList instance;
  • trunk/src/org/openstreetmap/josm/tools/TextTagParser.java

    r6360 r6362  
    2727 * Class that helps to parse tags from arbitrary text
    2828 */
    29 public class TextTagParser {
     29public final class TextTagParser {
    3030   
    3131    // properties need JOSM restart to apply, modified rarely enough
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r6360 r6362  
    4545 * Basic utils, that can be useful in different parts of the program.
    4646 */
    47 public class Utils {
     47public final class Utils {
    4848
    4949    private Utils() {
  • trunk/src/org/openstreetmap/josm/tools/template_engine/CompoundTemplateEntry.java

    r4282 r6362  
    33
    44
    5 public class CompoundTemplateEntry implements TemplateEntry {
     5public final class CompoundTemplateEntry implements TemplateEntry {
    66
    77    public static TemplateEntry fromArray(TemplateEntry... entry) {
Note: See TracChangeset for help on using the changeset viewer.