Fix JVM Warnings

This commit is contained in:
Daniel Mills 2021-07-21 08:10:11 -04:00
parent 8f57364547
commit c5262f188e
7 changed files with 34 additions and 14 deletions

View File

@ -635,6 +635,7 @@ public class IO {
* @return the requested byte array * @return the requested byte array
* @deprecated Use {@link String#getBytes()} * @deprecated Use {@link String#getBytes()}
*/ */
@Deprecated
public static byte[] toByteArray(String input) { public static byte[] toByteArray(String input) {
return input.getBytes(); return input.getBytes();
} }
@ -770,6 +771,7 @@ public class IO {
* @return the requested String * @return the requested String
* @deprecated Use {@link String#String(byte[])} * @deprecated Use {@link String#String(byte[])}
*/ */
@Deprecated
public static String toString(byte[] input) { public static String toString(byte[] input) {
return new String(input); return new String(input);
} }
@ -788,6 +790,7 @@ public class IO {
* @throws IOException if an I/O error occurs (never occurs) * @throws IOException if an I/O error occurs (never occurs)
* @deprecated Use {@link String#String(byte[], String)} * @deprecated Use {@link String#String(byte[], String)}
*/ */
@Deprecated
public static String toString(byte[] input, String encoding) throws IOException { public static String toString(byte[] input, String encoding) throws IOException {
if (encoding == null) { if (encoding == null) {
return new String(input); return new String(input);

View File

@ -697,7 +697,7 @@ public class JSONArray implements Iterable<Object> {
* @throws JSONException if the value is not finite. * @throws JSONException if the value is not finite.
*/ */
public JSONArray put(double value) throws JSONException { public JSONArray put(double value) throws JSONException {
Double d = new Double(value); Double d = Double.valueOf(value);
JSONObject.testValidity(d); JSONObject.testValidity(d);
this.put(d); this.put(d);
return this; return this;
@ -710,7 +710,7 @@ public class JSONArray implements Iterable<Object> {
* @return this. * @return this.
*/ */
public JSONArray put(int value) { public JSONArray put(int value) {
this.put(new Integer(value)); this.put(Integer.valueOf(value));
return this; return this;
} }
@ -721,7 +721,7 @@ public class JSONArray implements Iterable<Object> {
* @return this. * @return this.
*/ */
public JSONArray put(long value) { public JSONArray put(long value) {
this.put(new Long(value)); this.put(Long.valueOf(value));
return this; return this;
} }
@ -790,7 +790,7 @@ public class JSONArray implements Iterable<Object> {
* @throws JSONException If the index is negative or if the value is not finite. * @throws JSONException If the index is negative or if the value is not finite.
*/ */
public JSONArray put(int index, double value) throws JSONException { public JSONArray put(int index, double value) throws JSONException {
this.put(index, new Double(value)); this.put(index, Double.valueOf(value));
return this; return this;
} }
@ -805,7 +805,7 @@ public class JSONArray implements Iterable<Object> {
* @throws JSONException If the index is negative. * @throws JSONException If the index is negative.
*/ */
public JSONArray put(int index, int value) throws JSONException { public JSONArray put(int index, int value) throws JSONException {
this.put(index, new Integer(value)); this.put(index, Integer.valueOf(value));
return this; return this;
} }
@ -820,7 +820,7 @@ public class JSONArray implements Iterable<Object> {
* @throws JSONException If the index is negative. * @throws JSONException If the index is negative.
*/ */
public JSONArray put(int index, long value) throws JSONException { public JSONArray put(int index, long value) throws JSONException {
this.put(index, new Long(value)); this.put(index, Long.valueOf(value));
return this; return this;
} }

View File

@ -1115,7 +1115,7 @@ public class JSONObject {
* @throws JSONException If the key is null or if the number is invalid. * @throws JSONException If the key is null or if the number is invalid.
*/ */
public JSONObject put(String key, double value) throws JSONException { public JSONObject put(String key, double value) throws JSONException {
this.put(key, new Double(value)); this.put(key, Double.valueOf(value));
return this; return this;
} }
@ -1128,7 +1128,7 @@ public class JSONObject {
* @throws JSONException If the key is null. * @throws JSONException If the key is null.
*/ */
public JSONObject put(String key, int value) throws JSONException { public JSONObject put(String key, int value) throws JSONException {
this.put(key, new Integer(value)); this.put(key, Integer.valueOf(value));
return this; return this;
} }
@ -1141,7 +1141,7 @@ public class JSONObject {
* @throws JSONException If the key is null. * @throws JSONException If the key is null.
*/ */
public JSONObject put(String key, long value) throws JSONException { public JSONObject put(String key, long value) throws JSONException {
this.put(key, new Long(value)); this.put(key, Long.valueOf(value));
return this; return this;
} }
@ -1389,7 +1389,7 @@ public class JSONObject {
return d; return d;
} }
} else { } else {
Long myLong = new Long(string); Long myLong = Long.valueOf(string);
if (string.equals(myLong.toString())) { if (string.equals(myLong.toString())) {
if (myLong == myLong.intValue()) { if (myLong == myLong.intValue()) {
return myLong.intValue(); return myLong.intValue();

View File

@ -301,7 +301,7 @@ public class JSONWriter {
* @throws JSONException If the number is not finite. * @throws JSONException If the number is not finite.
*/ */
public JSONWriter value(double d) throws JSONException { public JSONWriter value(double d) throws JSONException {
return this.value(new Double(d)); return this.value(Double.valueOf(d));
} }
/** /**

View File

@ -318,7 +318,7 @@ public class XML {
try { try {
char initial = string.charAt(0); char initial = string.charAt(0);
if (initial == '-' || (initial >= '0' && initial <= '9')) { if (initial == '-' || (initial >= '0' && initial <= '9')) {
Long value = new Long(string); Long value = Long.valueOf(string);
if (value.toString().equals(string)) { if (value.toString().equals(string)) {
return value; return value;
} }
@ -326,7 +326,7 @@ public class XML {
} catch (Exception ignore) { } catch (Exception ignore) {
Iris.reportError(ignore); Iris.reportError(ignore);
try { try {
Double value = new Double(string); Double value = Double.valueOf(string);
if (value.toString().equals(string)) { if (value.toString().equals(string)) {
return value; return value;
} }

View File

@ -288,6 +288,7 @@ public abstract class Tuple3d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use scaleAdd(double,Tuple3d) instead * @deprecated Use scaleAdd(double,Tuple3d) instead
*/ */
@Deprecated
public final void scaleAdd(double s, Tuple3f t1) { public final void scaleAdd(double s, Tuple3f t1) {
scaleAdd(s, new Point3d(t1)); scaleAdd(s, new Point3d(t1));
} }
@ -402,6 +403,7 @@ public abstract class Tuple3d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use clamp(double,double,Tuple3d) instead * @deprecated Use clamp(double,double,Tuple3d) instead
*/ */
@Deprecated
public final void clamp(float min, float max, Tuple3d t) { public final void clamp(float min, float max, Tuple3d t) {
clamp(min, (double) max, t); clamp(min, (double) max, t);
} }
@ -434,6 +436,7 @@ public abstract class Tuple3d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use clampMin(double,Tuple3d) instead * @deprecated Use clampMin(double,Tuple3d) instead
*/ */
@Deprecated
public final void clampMin(float min, Tuple3d t) { public final void clampMin(float min, Tuple3d t) {
clampMin((double) min, t); clampMin((double) min, t);
} }
@ -459,6 +462,7 @@ public abstract class Tuple3d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use clampMax(double,Tuple3d) instead * @deprecated Use clampMax(double,Tuple3d) instead
*/ */
@Deprecated
public final void clampMax(float max, Tuple3d t) { public final void clampMax(float max, Tuple3d t) {
clampMax((double) max, t); clampMax((double) max, t);
} }
@ -498,6 +502,7 @@ public abstract class Tuple3d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use clamp(double,double) instead * @deprecated Use clamp(double,double) instead
*/ */
@Deprecated
public final void clamp(float min, float max) { public final void clamp(float min, float max) {
clamp(min, (double) max); clamp(min, (double) max);
} }
@ -534,6 +539,7 @@ public abstract class Tuple3d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use clampMin(double) instead * @deprecated Use clampMin(double) instead
*/ */
@Deprecated
public final void clampMin(float min) { public final void clampMin(float min) {
clampMin((double) min); clampMin((double) min);
} }
@ -548,13 +554,13 @@ public abstract class Tuple3d implements java.io.Serializable, Cloneable {
if (x < min) x = min; if (x < min) x = min;
if (y < min) y = min; if (y < min) y = min;
if (z < min) z = min; if (z < min) z = min;
} }
/** /**
* @deprecated Use clampMax(double) instead * @deprecated Use clampMax(double) instead
*/ */
@Deprecated
public final void clampMax(float max) { public final void clampMax(float max) {
clampMax((double) max); clampMax((double) max);
} }
@ -585,6 +591,7 @@ public abstract class Tuple3d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use interpolate(Tuple3d,Tuple3d,double) instead * @deprecated Use interpolate(Tuple3d,Tuple3d,double) instead
*/ */
@Deprecated
public final void interpolate(Tuple3d t1, Tuple3d t2, float alpha) { public final void interpolate(Tuple3d t1, Tuple3d t2, float alpha) {
interpolate(t1, t2, (double) alpha); interpolate(t1, t2, (double) alpha);
} }
@ -608,6 +615,7 @@ public abstract class Tuple3d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use interpolate(Tuple3d,double) instead * @deprecated Use interpolate(Tuple3d,double) instead
*/ */
@Deprecated
public final void interpolate(Tuple3d t1, float alpha) { public final void interpolate(Tuple3d t1, float alpha) {
interpolate(t1, (double) alpha); interpolate(t1, (double) alpha);
} }

View File

@ -328,6 +328,7 @@ public abstract class Tuple4d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use scaleAdd(double,Tuple4d) instead * @deprecated Use scaleAdd(double,Tuple4d) instead
*/ */
@Deprecated
public final void scaleAdd(float s, Tuple4d t1) { public final void scaleAdd(float s, Tuple4d t1) {
scaleAdd((double) s, t1); scaleAdd((double) s, t1);
} }
@ -452,6 +453,7 @@ public abstract class Tuple4d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use clamp(double,double,Tuple4d) instead * @deprecated Use clamp(double,double,Tuple4d) instead
*/ */
@Deprecated
public final void clamp(float min, float max, Tuple4d t) { public final void clamp(float min, float max, Tuple4d t) {
clamp(min, (double) max, t); clamp(min, (double) max, t);
} }
@ -488,6 +490,7 @@ public abstract class Tuple4d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use clampMin(double,Tuple4d) instead * @deprecated Use clampMin(double,Tuple4d) instead
*/ */
@Deprecated
public final void clampMin(float min, Tuple4d t) { public final void clampMin(float min, Tuple4d t) {
clampMin((double) min, t); clampMin((double) min, t);
} }
@ -515,6 +518,7 @@ public abstract class Tuple4d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use clampMax(double,Tuple4d) instead * @deprecated Use clampMax(double,Tuple4d) instead
*/ */
@Deprecated
public final void clampMax(float max, Tuple4d t) { public final void clampMax(float max, Tuple4d t) {
clampMax((double) max, t); clampMax((double) max, t);
} }
@ -561,6 +565,7 @@ public abstract class Tuple4d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use clamp(double,double) instead * @deprecated Use clamp(double,double) instead
*/ */
@Deprecated
public final void clamp(float min, float max) { public final void clamp(float min, float max) {
clamp(min, (double) max); clamp(min, (double) max);
} }
@ -603,6 +608,7 @@ public abstract class Tuple4d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use clampMin(double) instead * @deprecated Use clampMin(double) instead
*/ */
@Deprecated
public final void clampMin(float min) { public final void clampMin(float min) {
clampMin((double) min); clampMin((double) min);
} }
@ -624,6 +630,7 @@ public abstract class Tuple4d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use clampMax(double) instead * @deprecated Use clampMax(double) instead
*/ */
@Deprecated
public final void clampMax(float max) { public final void clampMax(float max) {
clampMax((double) max); clampMax((double) max);
} }
@ -658,6 +665,7 @@ public abstract class Tuple4d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use interpolate(Tuple4d,Tuple4d,double) instead * @deprecated Use interpolate(Tuple4d,Tuple4d,double) instead
*/ */
@Deprecated
public void interpolate(Tuple4d t1, Tuple4d t2, float alpha) { public void interpolate(Tuple4d t1, Tuple4d t2, float alpha) {
interpolate(t1, t2, (double) alpha); interpolate(t1, t2, (double) alpha);
} }
@ -682,6 +690,7 @@ public abstract class Tuple4d implements java.io.Serializable, Cloneable {
/** /**
* @deprecated Use interpolate(Tuple4d,double) instead * @deprecated Use interpolate(Tuple4d,double) instead
*/ */
@Deprecated
public void interpolate(Tuple4d t1, float alpha) { public void interpolate(Tuple4d t1, float alpha) {
interpolate(t1, (double) alpha); interpolate(t1, (double) alpha);
} }