Changeset 6231 in josm


Ignore:
Timestamp:
2013-09-11T00:48:32+02:00 (11 years ago)
Author:
Don-vip
Message:

Sonar - Avoid instantiating Integer objects. Call Integer.valueOf() instead (more memory-friendly)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/TigerUtils.java

    r5569 r6231  
    2828    public static Object tagObj(String name) {
    2929        if (tagIsInt(name))
    30             return new Integer(name);
     30            return Integer.valueOf(name);
    3131        return name;
    3232    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java

    r5886 r6231  
    3636    String code;
    3737
     38    /**
     39     * Constructs a new {@code CodeProjectionChoice}.
     40     */
    3841    public CodeProjectionChoice() {
    3942        super(tr("By Code (EPSG)"), "core:code");
     
    7679                        int num1 = Integer.parseInt(matcher1.group(2));
    7780                        int num2 = Integer.parseInt(matcher2.group(2));
    78                         return new Integer(num1).compareTo(num2);
     81                        return Integer.valueOf(num1).compareTo(num2);
    7982                    } else
    8083                        return -1;
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java

    r6221 r6231  
    551551            initAutoCompletionField(textField, key);
    552552            if (length != null && !length.isEmpty()) {
    553                 textField.setMaxChars(new Integer(length));
     553                textField.setMaxChars(Integer.valueOf(length));
    554554            }
    555555            if (usage.unused()){
     
    724724        @Override
    725725        boolean addToPanel(JPanel p, Collection<OsmPrimitive> sel) {
    726             Integer cols = new Integer(columns);
     726            Integer cols = Integer.valueOf(columns);
    727727            int rows = (int) Math.ceil(checks.size()/cols.doubleValue());
    728728            JPanel panel = new JPanel(new GridLayout(rows, cols));
     
    11631163            initAutoCompletionField(tf, key);
    11641164            if (length != null && !length.isEmpty()) {
    1165                 tf.setMaxChars(new Integer(length));
     1165                tf.setMaxChars(Integer.valueOf(length));
    11661166            }
    11671167            AutoCompletionList acList = tf.getAutoCompletionList();
Note: See TracChangeset for help on using the changeset viewer.