diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 1ae9bccfb..32e5f731c 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -2381,7 +2381,7 @@ public class Base { // on macosx, setting the destructive property places this option // away from the others at the lefthand side pane.putClientProperty("Quaqua.OptionPane.destructiveOption", - new Integer(2)); + Integer.valueOf(2)); JDialog dialog = pane.createDialog(editor, null); dialog.setVisible(true); diff --git a/app/src/processing/app/Preferences.java b/app/src/processing/app/Preferences.java index b536bccfe..1a47fd35f 100644 --- a/app/src/processing/app/Preferences.java +++ b/app/src/processing/app/Preferences.java @@ -237,7 +237,7 @@ public class Preferences { static public boolean getBoolean(String attribute) { String value = get(attribute); //, null); - return (new Boolean(value)).booleanValue(); + return Boolean.parseBoolean(value); /* supposedly not needed, because anything besides 'true' diff --git a/app/src/processing/mode/java/JavaEditor.java b/app/src/processing/mode/java/JavaEditor.java index 9bc5dec90..1da4f0031 100644 --- a/app/src/processing/mode/java/JavaEditor.java +++ b/app/src/processing/mode/java/JavaEditor.java @@ -577,7 +577,7 @@ public class JavaEditor extends Editor { Object value = optionPane.getValue(); if (value.equals(options[0])) { return jmode.handleExportApplication(sketch); - } else if (value.equals(options[1]) || value.equals(new Integer(-1))) { + } else if (value.equals(options[1]) || value.equals(Integer.valueOf(-1))) { // closed window by hitting Cancel or ESC statusNotice("Export to Application canceled."); } @@ -832,4 +832,4 @@ public class JavaEditor extends Editor { //jmode.handleStop(); handleStop(); } -} \ No newline at end of file +} diff --git a/core/methods/demo/PApplet.java b/core/methods/demo/PApplet.java index b2a09c1bb..ada9f3b48 100644 --- a/core/methods/demo/PApplet.java +++ b/core/methods/demo/PApplet.java @@ -5959,7 +5959,7 @@ public class PApplet extends Applet * @return true if 'what' is "true" or "TRUE", false otherwise */ static final public boolean parseBoolean(String what) { - return new Boolean(what).booleanValue(); + return Boolean.parseBoolean(what); } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @@ -6017,7 +6017,7 @@ public class PApplet extends Applet static final public boolean[] parseBoolean(String what[]) { boolean outgoing[] = new boolean[what.length]; for (int i = 0; i < what.length; i++) { - outgoing[i] = new Boolean(what[i]).booleanValue(); + outgoing[i] = Boolean.parseBoolean(what[i]); } return outgoing; } diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index ad25e8014..46f91331e 100755 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -9260,7 +9260,7 @@ public class PApplet extends Applet * @return true if 'what' is "true" or "TRUE", false otherwise */ static final public boolean parseBoolean(String what) { - return new Boolean(what).booleanValue(); + return Boolean.parseBoolean(what); } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @@ -9320,7 +9320,7 @@ public class PApplet extends Applet static final public boolean[] parseBoolean(String what[]) { boolean outgoing[] = new boolean[what.length]; for (int i = 0; i < what.length; i++) { - outgoing[i] = new Boolean(what[i]).booleanValue(); + outgoing[i] = Boolean.parseBoolean(what[i]); } return outgoing; } diff --git a/core/src/processing/core/PShapeOBJ.java b/core/src/processing/core/PShapeOBJ.java index c64031cc5..eeb367a02 100644 --- a/core/src/processing/core/PShapeOBJ.java +++ b/core/src/processing/core/PShapeOBJ.java @@ -335,7 +335,7 @@ public class PShapeOBJ extends PShape { // Starting new material. String mtlname = parts[1]; currentMtl = new OBJMaterial(mtlname); - materialsHash.put(mtlname, new Integer(materials.size())); + materialsHash.put(mtlname, Integer.valueOf(materials.size())); materials.add(currentMtl); } else if (parts[0].equals("map_Kd") && parts.length > 1) { // Loading texture map. diff --git a/core/src/processing/data/FloatDict.java b/core/src/processing/data/FloatDict.java index ec6fd9bd0..9647dfd67 100644 --- a/core/src/processing/data/FloatDict.java +++ b/core/src/processing/data/FloatDict.java @@ -493,7 +493,7 @@ public class FloatDict { keys = PApplet.expand(keys); values = PApplet.expand(values); } - indices.put(what, new Integer(count)); + indices.put(what, Integer.valueOf(count)); keys[count] = what; values[count] = much; count++; @@ -540,8 +540,8 @@ public class FloatDict { keys[b] = tkey; values[b] = tvalue; - indices.put(keys[a], new Integer(a)); - indices.put(keys[b], new Integer(b)); + indices.put(keys[a], Integer.valueOf(a)); + indices.put(keys[b], Integer.valueOf(b)); } diff --git a/core/src/processing/data/IntDict.java b/core/src/processing/data/IntDict.java index 022d9195f..cd65f0de4 100644 --- a/core/src/processing/data/IntDict.java +++ b/core/src/processing/data/IntDict.java @@ -486,7 +486,7 @@ public class IntDict { keys = PApplet.expand(keys); values = PApplet.expand(values); } - indices.put(what, new Integer(count)); + indices.put(what, Integer.valueOf(count)); keys[count] = what; values[count] = much; count++; @@ -532,8 +532,8 @@ public class IntDict { keys[b] = tkey; values[b] = tvalue; - indices.put(keys[a], new Integer(a)); - indices.put(keys[b], new Integer(b)); + indices.put(keys[a], Integer.valueOf(a)); + indices.put(keys[b], Integer.valueOf(b)); } diff --git a/core/src/processing/data/JSONArray.java b/core/src/processing/data/JSONArray.java index 0e665c805..35430da60 100644 --- a/core/src/processing/data/JSONArray.java +++ b/core/src/processing/data/JSONArray.java @@ -168,7 +168,7 @@ public class JSONArray { public JSONArray(IntList list) { myArrayList = new ArrayList(); for (int item : list.values()) { - myArrayList.add(new Integer(item)); + myArrayList.add(Integer.valueOf(item)); } } @@ -718,7 +718,7 @@ public class JSONArray { * @return this. */ public JSONArray append(int value) { - this.append(new Integer(value)); + this.append(Integer.valueOf(value)); return this; } @@ -731,7 +731,7 @@ public class JSONArray { * @return this. */ public JSONArray append(long value) { - this.append(new Long(value)); + this.append(Long.valueOf(value)); return this; } @@ -758,7 +758,7 @@ public class JSONArray { * @return this. */ public JSONArray append(double value) { - Double d = new Double(value); + Double d = value; JSONObject.testValidity(d); this.append(d); return this; @@ -884,7 +884,7 @@ public class JSONArray { * @see JSONArray#setBoolean(int, boolean) */ public JSONArray setInt(int index, int value) { - this.set(index, new Integer(value)); + this.set(index, Integer.valueOf(value)); return this; } @@ -899,7 +899,7 @@ public class JSONArray { * @throws JSONException If the index is negative. */ public JSONArray setLong(int index, long value) { - return set(index, new Long(value)); + return set(index, Long.valueOf(value)); } @@ -936,7 +936,7 @@ public class JSONArray { * not finite. */ public JSONArray setDouble(int index, double value) { - return set(index, new Double(value)); + return set(index, Double.valueOf(value)); } diff --git a/core/src/processing/data/JSONObject.java b/core/src/processing/data/JSONObject.java index 69add3837..705ee3ff8 100644 --- a/core/src/processing/data/JSONObject.java +++ b/core/src/processing/data/JSONObject.java @@ -1168,7 +1168,7 @@ public class JSONObject { * @see JSONObject#setBoolean(String, boolean) */ public JSONObject setInt(String key, int value) { - this.put(key, new Integer(value)); + this.put(key, Integer.valueOf(value)); return this; } @@ -1182,7 +1182,7 @@ public class JSONObject { * @throws JSONException If the key is null. */ public JSONObject setLong(String key, long value) { - this.put(key, new Long(value)); + this.put(key, Long.valueOf(value)); return this; } @@ -1494,7 +1494,7 @@ public class JSONObject { } else { Long myLong = new Long(string); if (myLong.longValue() == myLong.intValue()) { - return new Integer(myLong.intValue()); + return Integer.valueOf(myLong.intValue()); } else { return myLong; } diff --git a/core/src/processing/data/StringDict.java b/core/src/processing/data/StringDict.java index becc5ee51..a5eb53c10 100644 --- a/core/src/processing/data/StringDict.java +++ b/core/src/processing/data/StringDict.java @@ -279,7 +279,7 @@ public class StringDict { keys = PApplet.expand(keys); values = PApplet.expand(values); } - indices.put(key, new Integer(count)); + indices.put(key, Integer.valueOf(count)); keys[count] = key; values[count] = value; count++; @@ -325,8 +325,8 @@ public class StringDict { keys[b] = tkey; values[b] = tvalue; - indices.put(keys[a], new Integer(a)); - indices.put(keys[b], new Integer(b)); + indices.put(keys[a], Integer.valueOf(a)); + indices.put(keys[b], Integer.valueOf(b)); } diff --git a/pdex/src/com/illposed/osc/utility/OSCByteArrayToJavaConverter.java b/pdex/src/com/illposed/osc/utility/OSCByteArrayToJavaConverter.java index 3c29412c6..803ea65c1 100644 --- a/pdex/src/com/illposed/osc/utility/OSCByteArrayToJavaConverter.java +++ b/pdex/src/com/illposed/osc/utility/OSCByteArrayToJavaConverter.java @@ -248,7 +248,7 @@ public class OSCByteArrayToJavaConverter { intBytes[2] = bytes[streamPosition++]; intBytes[3] = bytes[streamPosition++]; BigInteger intBits = new BigInteger(intBytes); - return new Integer(intBits.intValue()); + return Integer.valueOf(intBits.intValue()); } /** diff --git a/pdex/src/galsasson/mode/tweak/OSCSender.java b/pdex/src/galsasson/mode/tweak/OSCSender.java index 1113ee1fd..b0fd8a599 100644 --- a/pdex/src/galsasson/mode/tweak/OSCSender.java +++ b/pdex/src/galsasson/mode/tweak/OSCSender.java @@ -11,8 +11,8 @@ public class OSCSender { { OSCPortOut sender = new OSCPortOut(InetAddress.getByName("localhost"), port); ArrayList args = new ArrayList(); - args.add(new Integer(index)); - args.add(new Float(val)); + args.add(Integer.valueOf(index)); + args.add(Float.valueOf(val)); OSCMessage msg = new OSCMessage("/tm_change_float", args); try { sender.send(msg); @@ -25,8 +25,8 @@ public class OSCSender { { OSCPortOut sender = new OSCPortOut(InetAddress.getByName("localhost"), port); ArrayList args = new ArrayList(); - args.add(new Integer(index)); - args.add(new Integer(val)); + args.add(Integer.valueOf(index)); + args.add(Integer.valueOf(val)); OSCMessage msg = new OSCMessage("/tm_change_int", args); try { sender.send(msg); @@ -40,8 +40,8 @@ public class OSCSender { { OSCPortOut sender = new OSCPortOut(InetAddress.getByName("localhost"), port); ArrayList args = new ArrayList(); - args.add(new Integer(index)); - args.add(new Long(val)); + args.add(Integer.valueOf(index)); + args.add(Long.valueOf(val)); OSCMessage msg = new OSCMessage("/tm_change_long", args); try { sender.send(msg);