diff --git a/headless-services/commons/org.json/pom.xml b/headless-services/commons/org.json/pom.xml index 14b1f3651..f935815cd 100644 --- a/headless-services/commons/org.json/pom.xml +++ b/headless-services/commons/org.json/pom.xml @@ -9,7 +9,7 @@ Repackaged org.json - 1.8 - 1.8 + 17 + 17 diff --git a/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONArray.java b/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONArray.java index b9ebb177f..5328e2159 100644 --- a/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONArray.java +++ b/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONArray.java @@ -608,7 +608,7 @@ public class JSONArray { * @return this. */ public JSONArray put(double value) throws JSONException { - Double d = new Double(value); + Double d = Double.valueOf(value); JSONObject.testValidity(d); this.put(d); return this; @@ -622,7 +622,7 @@ public class JSONArray { * @return this. */ public JSONArray put(int value) { - this.put(new Integer(value)); + this.put(Integer.valueOf(value)); return this; } @@ -634,7 +634,7 @@ public class JSONArray { * @return this. */ public JSONArray put(long value) { - this.put(new Long(value)); + this.put(Long.valueOf(value)); return this; } @@ -714,7 +714,7 @@ public class JSONArray { * If the index is negative or if the value is not finite. */ public JSONArray put(int index, double value) throws JSONException { - this.put(index, new Double(value)); + this.put(index, Double.valueOf(value)); return this; } @@ -732,7 +732,7 @@ public class JSONArray { * If the index is negative. */ public JSONArray put(int index, int value) throws JSONException { - this.put(index, new Integer(value)); + this.put(index, Integer.valueOf(value)); return this; } @@ -750,7 +750,7 @@ public class JSONArray { * If the index is negative. */ public JSONArray put(int index, long value) throws JSONException { - this.put(index, new Long(value)); + this.put(index, Long.valueOf(value)); return this; } diff --git a/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONObject.java b/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONObject.java index 6ac64e1c5..c9f14abe5 100644 --- a/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONObject.java +++ b/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONObject.java @@ -1067,7 +1067,7 @@ public class JSONObject { * If the key is null or if the number is invalid. */ public JSONObject put(String key, double value) throws JSONException { - this.put(key, new Double(value)); + this.put(key, Double.valueOf(value)); return this; } @@ -1083,7 +1083,7 @@ public class JSONObject { * If the key is null. */ public JSONObject put(String key, int value) throws JSONException { - this.put(key, new Integer(value)); + this.put(key, Integer.valueOf(value)); return this; } @@ -1099,7 +1099,7 @@ public class JSONObject { * If the key is null. */ public JSONObject put(String key, long value) throws JSONException { - this.put(key, new Long(value)); + this.put(key, Long.valueOf(value)); return this; } @@ -1319,10 +1319,10 @@ public class JSONObject { return d; } } else { - Long myLong = new Long(string); + Long myLong = Long.valueOf(string); if (string.equals(myLong.toString())) { if (myLong.longValue() == myLong.intValue()) { - return new Integer(myLong.intValue()); + return Integer.valueOf(myLong.intValue()); } else { return myLong; } diff --git a/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONWriter.java b/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONWriter.java index 06c6d21ed..2b282134c 100644 --- a/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONWriter.java +++ b/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/JSONWriter.java @@ -300,7 +300,7 @@ public class JSONWriter { * @throws JSONException If the number is not finite. */ public JSONWriter value(double d) throws JSONException { - return this.value(new Double(d)); + return this.value(Double.valueOf(d)); } /** diff --git a/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/XML.java b/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/XML.java index d7d119ab6..350f9f1d0 100644 --- a/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/XML.java +++ b/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/XML.java @@ -36,31 +36,31 @@ import java.util.Iterator; public class XML { /** The Character '&'. */ - public static final Character AMP = new Character('&'); + public static final Character AMP = Character.valueOf('&'); /** The Character '''. */ - public static final Character APOS = new Character('\''); + public static final Character APOS = Character.valueOf('\''); /** The Character '!'. */ - public static final Character BANG = new Character('!'); + public static final Character BANG = Character.valueOf('!'); /** The Character '='. */ - public static final Character EQ = new Character('='); + public static final Character EQ = Character.valueOf('='); /** The Character '>'. */ - public static final Character GT = new Character('>'); + public static final Character GT = Character.valueOf('>'); /** The Character '<'. */ - public static final Character LT = new Character('<'); + public static final Character LT = Character.valueOf('<'); /** The Character '?'. */ - public static final Character QUEST = new Character('?'); + public static final Character QUEST = Character.valueOf('?'); /** The Character '"'. */ - public static final Character QUOT = new Character('"'); + public static final Character QUOT = Character.valueOf('"'); /** The Character '/'. */ - public static final Character SLASH = new Character('/'); + public static final Character SLASH = Character.valueOf('/'); /** * Replace special characters with XML escapes: @@ -317,14 +317,14 @@ public class XML { try { char initial = string.charAt(0); if (initial == '-' || (initial >= '0' && initial <= '9')) { - Long value = new Long(string); + Long value = Long.valueOf(string); if (value.toString().equals(string)) { return value; } } } catch (Exception ignore) { try { - Double value = new Double(string); + Double value = Double.valueOf(string); if (value.toString().equals(string)) { return value; } diff --git a/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/zip/Decompressor.java b/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/zip/Decompressor.java index 65faebd48..39f03e031 100644 --- a/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/zip/Decompressor.java +++ b/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/zip/Decompressor.java @@ -288,7 +288,7 @@ public class Decompressor extends JSONzip { private Object readValue() throws JSONException { switch (read(2)) { case 0: - return new Integer(read(!bit() ? 4 : !bit() ? 7 : 14)); + return Integer.valueOf(read(!bit() ? 4 : !bit() ? 7 : 14)); case 1: byte[] bytes = new byte[256]; int length = 0; diff --git a/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/zip/MapKeep.java b/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/zip/MapKeep.java index 543b7f83a..1714ef386 100644 --- a/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/zip/MapKeep.java +++ b/headless-services/commons/org.json/src/main/java/org/springframework/ide/eclipse/org/json/zip/MapKeep.java @@ -65,7 +65,7 @@ class MapKeep extends Keep { if (usage > 0) { this.uses[to] = usage; this.list[to] = key; - this.map.put(key, new Integer(to)); + this.map.put(key, Integer.valueOf(to)); to += 1; } else { this.map.remove(key); @@ -141,7 +141,7 @@ class MapKeep extends Keep { compact(); } this.list[this.length] = value; - this.map.put(value, new Integer(this.length)); + this.map.put(value, Integer.valueOf(this.length)); this.uses[this.length] = 1; if (JSONzip.probe) { JSONzip.log("<" + this.length + " " + value + "> "); diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/eclipse/org/json/JSONObject.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/eclipse/org/json/JSONObject.java index 7555e1d14..6ac39d103 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/eclipse/org/json/JSONObject.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/eclipse/org/json/JSONObject.java @@ -1094,7 +1094,7 @@ public class JSONObject { * If the key is null or if the number is invalid. */ public JSONObject put(String key, double value) throws JSONException { - this.put(key, new Double(value)); + this.put(key, Double.valueOf(value)); return this; } @@ -1110,7 +1110,7 @@ public class JSONObject { * If the key is null. */ public JSONObject put(String key, int value) throws JSONException { - this.put(key, new Integer(value)); + this.put(key, Integer.valueOf(value)); return this; } @@ -1126,7 +1126,7 @@ public class JSONObject { * If the key is null. */ public JSONObject put(String key, long value) throws JSONException { - this.put(key, new Long(value)); + this.put(key, Long.valueOf(value)); return this; } @@ -1346,10 +1346,10 @@ public class JSONObject { return d; } } else { - Long myLong = new Long(string); + Long myLong = Long.valueOf(string); if (string.equals(myLong.toString())) { if (myLong.longValue() == myLong.intValue()) { - return new Integer(myLong.intValue()); + return Integer.valueOf(myLong.intValue()); } else { return myLong; } diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/livehover/v2/SpringProcessConnectorOverJMX.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/livehover/v2/SpringProcessConnectorOverJMX.java index 932c029f1..a263496dd 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/livehover/v2/SpringProcessConnectorOverJMX.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/livehover/v2/SpringProcessConnectorOverJMX.java @@ -107,7 +107,7 @@ public class SpringProcessConnectorOverJMX implements SpringProcessConnector { jmxServiceURL = new JMXServiceURL(jmxURL); Map environment = new HashMap<>(); - environment.put(JMX_CLIENT_CONNECTION_CHECK_PERIOD_PROPERTY_KEY, new Long(JMX_HEARTBEAT_INTERVAL)); + environment.put(JMX_CLIENT_CONNECTION_CHECK_PERIOD_PROPERTY_KEY, Long.valueOf(JMX_HEARTBEAT_INTERVAL)); jmxConnection = JMXConnectorFactory.connect(jmxServiceURL, environment); jmxConnection.addConnectionNotificationListener(notificationListener, null, null);