Skip to content

Commit 038323a

Browse files
committed
Replace usages of deprecated constructors
1 parent fcbd052 commit 038323a

File tree

9 files changed

+34
-34
lines changed

9 files changed

+34
-34
lines changed

headless-services/commons/org.json/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<description>Repackaged org.json</description>
1010

1111
<properties>
12-
<maven.compiler.target>1.8</maven.compiler.target>
13-
<maven.compiler.source>1.8</maven.compiler.source>
12+
<maven.compiler.target>17</maven.compiler.target>
13+
<maven.compiler.source>17</maven.compiler.source>
1414
</properties>
1515
</project>

headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONArray.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ public JSONArray put(Collection value) {
608608
* @return this.
609609
*/
610610
public JSONArray put(double value) throws JSONException {
611-
Double d = new Double(value);
611+
Double d = Double.valueOf(value);
612612
JSONObject.testValidity(d);
613613
this.put(d);
614614
return this;
@@ -622,7 +622,7 @@ public JSONArray put(double value) throws JSONException {
622622
* @return this.
623623
*/
624624
public JSONArray put(int value) {
625-
this.put(new Integer(value));
625+
this.put(Integer.valueOf(value));
626626
return this;
627627
}
628628

@@ -634,7 +634,7 @@ public JSONArray put(int value) {
634634
* @return this.
635635
*/
636636
public JSONArray put(long value) {
637-
this.put(new Long(value));
637+
this.put(Long.valueOf(value));
638638
return this;
639639
}
640640

@@ -714,7 +714,7 @@ public JSONArray put(int index, Collection value) throws JSONException {
714714
* If the index is negative or if the value is not finite.
715715
*/
716716
public JSONArray put(int index, double value) throws JSONException {
717-
this.put(index, new Double(value));
717+
this.put(index, Double.valueOf(value));
718718
return this;
719719
}
720720

@@ -732,7 +732,7 @@ public JSONArray put(int index, double value) throws JSONException {
732732
* If the index is negative.
733733
*/
734734
public JSONArray put(int index, int value) throws JSONException {
735-
this.put(index, new Integer(value));
735+
this.put(index, Integer.valueOf(value));
736736
return this;
737737
}
738738

@@ -750,7 +750,7 @@ public JSONArray put(int index, int value) throws JSONException {
750750
* If the index is negative.
751751
*/
752752
public JSONArray put(int index, long value) throws JSONException {
753-
this.put(index, new Long(value));
753+
this.put(index, Long.valueOf(value));
754754
return this;
755755
}
756756

headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONObject.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ public JSONObject put(String key, Collection value) throws JSONException {
10671067
* If the key is null or if the number is invalid.
10681068
*/
10691069
public JSONObject put(String key, double value) throws JSONException {
1070-
this.put(key, new Double(value));
1070+
this.put(key, Double.valueOf(value));
10711071
return this;
10721072
}
10731073

@@ -1083,7 +1083,7 @@ public JSONObject put(String key, double value) throws JSONException {
10831083
* If the key is null.
10841084
*/
10851085
public JSONObject put(String key, int value) throws JSONException {
1086-
this.put(key, new Integer(value));
1086+
this.put(key, Integer.valueOf(value));
10871087
return this;
10881088
}
10891089

@@ -1099,7 +1099,7 @@ public JSONObject put(String key, int value) throws JSONException {
10991099
* If the key is null.
11001100
*/
11011101
public JSONObject put(String key, long value) throws JSONException {
1102-
this.put(key, new Long(value));
1102+
this.put(key, Long.valueOf(value));
11031103
return this;
11041104
}
11051105

@@ -1319,10 +1319,10 @@ public static Object stringToValue(String string) {
13191319
return d;
13201320
}
13211321
} else {
1322-
Long myLong = new Long(string);
1322+
Long myLong = Long.valueOf(string);
13231323
if (string.equals(myLong.toString())) {
13241324
if (myLong.longValue() == myLong.intValue()) {
1325-
return new Integer(myLong.intValue());
1325+
return Integer.valueOf(myLong.intValue());
13261326
} else {
13271327
return myLong;
13281328
}

headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONWriter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ public JSONWriter value(boolean b) throws JSONException {
300300
* @throws JSONException If the number is not finite.
301301
*/
302302
public JSONWriter value(double d) throws JSONException {
303-
return this.value(new Double(d));
303+
return this.value(Double.valueOf(d));
304304
}
305305

306306
/**

headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/XML.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,31 @@ of this software and associated documentation files (the "Software"), to deal
3636
public class XML {
3737

3838
/** The Character '&amp;'. */
39-
public static final Character AMP = new Character('&');
39+
public static final Character AMP = Character.valueOf('&');
4040

4141
/** The Character '''. */
42-
public static final Character APOS = new Character('\'');
42+
public static final Character APOS = Character.valueOf('\'');
4343

4444
/** The Character '!'. */
45-
public static final Character BANG = new Character('!');
45+
public static final Character BANG = Character.valueOf('!');
4646

4747
/** The Character '='. */
48-
public static final Character EQ = new Character('=');
48+
public static final Character EQ = Character.valueOf('=');
4949

5050
/** The Character '>'. */
51-
public static final Character GT = new Character('>');
51+
public static final Character GT = Character.valueOf('>');
5252

5353
/** The Character '&lt;'. */
54-
public static final Character LT = new Character('<');
54+
public static final Character LT = Character.valueOf('<');
5555

5656
/** The Character '?'. */
57-
public static final Character QUEST = new Character('?');
57+
public static final Character QUEST = Character.valueOf('?');
5858

5959
/** The Character '"'. */
60-
public static final Character QUOT = new Character('"');
60+
public static final Character QUOT = Character.valueOf('"');
6161

6262
/** The Character '/'. */
63-
public static final Character SLASH = new Character('/');
63+
public static final Character SLASH = Character.valueOf('/');
6464

6565
/**
6666
* Replace special characters with XML escapes:
@@ -317,14 +317,14 @@ public static Object stringToValue(String string) {
317317
try {
318318
char initial = string.charAt(0);
319319
if (initial == '-' || (initial >= '0' && initial <= '9')) {
320-
Long value = new Long(string);
320+
Long value = Long.valueOf(string);
321321
if (value.toString().equals(string)) {
322322
return value;
323323
}
324324
}
325325
} catch (Exception ignore) {
326326
try {
327-
Double value = new Double(string);
327+
Double value = Double.valueOf(string);
328328
if (value.toString().equals(string)) {
329329
return value;
330330
}

headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/zip/Decompressor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ private String readString() throws JSONException {
288288
private Object readValue() throws JSONException {
289289
switch (read(2)) {
290290
case 0:
291-
return new Integer(read(!bit() ? 4 : !bit() ? 7 : 14));
291+
return Integer.valueOf(read(!bit() ? 4 : !bit() ? 7 : 14));
292292
case 1:
293293
byte[] bytes = new byte[256];
294294
int length = 0;

headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/zip/MapKeep.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private void compact() {
6565
if (usage > 0) {
6666
this.uses[to] = usage;
6767
this.list[to] = key;
68-
this.map.put(key, new Integer(to));
68+
this.map.put(key, Integer.valueOf(to));
6969
to += 1;
7070
} else {
7171
this.map.remove(key);
@@ -141,7 +141,7 @@ public void register(Object value) {
141141
compact();
142142
}
143143
this.list[this.length] = value;
144-
this.map.put(value, new Integer(this.length));
144+
this.map.put(value, Integer.valueOf(this.length));
145145
this.uses[this.length] = 1;
146146
if (JSONzip.probe) {
147147
JSONzip.log("<" + this.length + " " + value + "> ");

headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/eclipse/org/json/JSONObject.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ public JSONObject put(String key, Collection value) throws JSONException {
10941094
* If the key is null or if the number is invalid.
10951095
*/
10961096
public JSONObject put(String key, double value) throws JSONException {
1097-
this.put(key, new Double(value));
1097+
this.put(key, Double.valueOf(value));
10981098
return this;
10991099
}
11001100

@@ -1110,7 +1110,7 @@ public JSONObject put(String key, double value) throws JSONException {
11101110
* If the key is null.
11111111
*/
11121112
public JSONObject put(String key, int value) throws JSONException {
1113-
this.put(key, new Integer(value));
1113+
this.put(key, Integer.valueOf(value));
11141114
return this;
11151115
}
11161116

@@ -1126,7 +1126,7 @@ public JSONObject put(String key, int value) throws JSONException {
11261126
* If the key is null.
11271127
*/
11281128
public JSONObject put(String key, long value) throws JSONException {
1129-
this.put(key, new Long(value));
1129+
this.put(key, Long.valueOf(value));
11301130
return this;
11311131
}
11321132

@@ -1346,10 +1346,10 @@ public static Object stringToValue(String string) {
13461346
return d;
13471347
}
13481348
} else {
1349-
Long myLong = new Long(string);
1349+
Long myLong = Long.valueOf(string);
13501350
if (string.equals(myLong.toString())) {
13511351
if (myLong.longValue() == myLong.intValue()) {
1352-
return new Integer(myLong.intValue());
1352+
return Integer.valueOf(myLong.intValue());
13531353
} else {
13541354
return myLong;
13551355
}

headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/livehover/v2/SpringProcessConnectorOverJMX.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void connect() throws Exception {
107107
jmxServiceURL = new JMXServiceURL(jmxURL);
108108

109109
Map<String, Object> environment = new HashMap<>();
110-
environment.put(JMX_CLIENT_CONNECTION_CHECK_PERIOD_PROPERTY_KEY, new Long(JMX_HEARTBEAT_INTERVAL));
110+
environment.put(JMX_CLIENT_CONNECTION_CHECK_PERIOD_PROPERTY_KEY, Long.valueOf(JMX_HEARTBEAT_INTERVAL));
111111
jmxConnection = JMXConnectorFactory.connect(jmxServiceURL, environment);
112112

113113
jmxConnection.addConnectionNotificationListener(notificationListener, null, null);

0 commit comments

Comments
 (0)