Ignore:
Timestamp:
2013-09-08T05:51:16+02:00 (13 years ago)
Author:
Don-vip
Message:

Sonar - fix various violations

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
3 edited

Legend:

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

    r6142 r6223  
    3838            if(code.matches("[^_]+_[^_]+")) {
    3939                code = code.substring(0,2);
    40                 if(code == "en")
     40                if ("en".equals(code))
    4141                    return null;
    4242            } else {
    4343                return null;
    4444            }
    45         } else if(type == LocaleType.DEFAULTNOTENGLISH && code == "en")
     45        } else if(type == LocaleType.DEFAULTNOTENGLISH && "en".equals(code))
    4646            return null;
    4747        return code.substring(0,1).toUpperCase() + code.substring(1) + ":";
  • trunk/src/org/openstreetmap/josm/tools/MultikeyActionsHandler.java

    r5463 r6223  
    3030
    3131    private static final long DIALOG_DELAY = 1000;
    32     private static final String STATUS_BAR_ID = new String("multikeyShortcut");
     32    private static final String STATUS_BAR_ID = "multikeyShortcut";
    3333
    3434    private Map<MultikeyShortcutAction, MyAction> myActions = new HashMap<MultikeyShortcutAction,MyAction>();
     
    120120    private static MultikeyActionsHandler instance;
    121121
     122    /**
     123     * Replies the unique instance of this class.
     124     * @return The unique instance of this class
     125     */
    122126    public static MultikeyActionsHandler getInstance() {
    123127        if (instance == null) {
     
    203207    }
    204208
     209    /**
     210     * Registers an action and its shortcut
     211     * @param action The action to add
     212     */
    205213    public void addAction(MultikeyShortcutAction action) {
    206         if(action.getMultikeyShortcut() != null) {
     214        if (action.getMultikeyShortcut() != null) {
    207215            MyAction myAction = new MyAction(action);
    208216            myActions.put(action, myAction);
     
    211219    }
    212220
    213     // unregister action and its shortcut completely
     221    /**
     222     * Unregisters an action and its shortcut completely
     223     * @param action The action to remove
     224     */
    214225    public void removeAction(MultikeyShortcutAction action) {
    215226        MyAction a = myActions.get(action);
  • trunk/src/org/openstreetmap/josm/tools/Property.java

    r3300 r6223  
    44/**
    55 * Small interface to define a property with both read and write access.
     6 * @param <O> Object type
     7 * @param <P> Property type
    68 */
    7 public interface Property<ObjectType, PropertyType> {
     9public interface Property<O, P> {
     10   
    811    /**
    912     * Get the value of the property.
     
    1114     * @return the value of the property for the object obj
    1215     */
    13     public PropertyType get(ObjectType obj);
     16    public P get(O obj);
     17   
    1418    /**
    1519     * Set the value of the property for the object.
     
    1721     * @param value the value the property is set to
    1822     */
    19     public void set(ObjectType obj, PropertyType value);
     23    public void set(O obj, P value);
    2024}
Note: See TracChangeset for help on using the changeset viewer.