diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-02 09:47:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-02 12:00:24 +0100 |
commit | cb982f14796aa4dc4362bc6fde74161afa11777b (patch) | |
tree | 58267840e3cc2a2d6e344337fe3d735063900711 /qadevOOo | |
parent | a71da3b7a80ca32b595a8ca0ea3da650b0af376c (diff) |
'new Float' is deprecated in Java
replace with Float.valueOf
Change-Id: Ib6408b24dac2953789d0ec67e73b8be8aefca252
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158784
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'qadevOOo')
17 files changed, 22 insertions, 22 deletions
diff --git a/qadevOOo/runner/util/ValueChanger.java b/qadevOOo/runner/util/ValueChanger.java index 8a6c51936863..3d043f6f051a 100644 --- a/qadevOOo/runner/util/ValueChanger.java +++ b/qadevOOo/runner/util/ValueChanger.java @@ -78,7 +78,7 @@ public class ValueChanger { newValue = Byte.valueOf((byte) (oldbyte + 1)); } else if (oldValue instanceof Float) { float oldfloat = ((Float) oldValue).floatValue(); - newValue = new Float((float) (oldfloat + 16.7)); + newValue = Float.valueOf((float) (oldfloat + 16.7)); } else if (oldValue instanceof Double) { double olddouble = ((Double) oldValue).doubleValue(); newValue = new Double(olddouble + 17.8); diff --git a/qadevOOo/testdocs/qadevlibs/source/com/sun/star/cmp/MyPersistObject.java b/qadevOOo/testdocs/qadevlibs/source/com/sun/star/cmp/MyPersistObject.java index 7ce7a80b618d..4838716a2b1a 100644 --- a/qadevOOo/testdocs/qadevlibs/source/com/sun/star/cmp/MyPersistObject.java +++ b/qadevOOo/testdocs/qadevlibs/source/com/sun/star/cmp/MyPersistObject.java @@ -214,7 +214,7 @@ public class MyPersistObject implements XPersistObject, XTypeProvider, if ( property.equals(props[3].Name)) return new Double(d); if ( property.equals(props[4].Name)) - return new Float(f); + return Float.valueOf(f); if ( property.equals(props[5].Name)) return Short.valueOf(s); if ( property.equals(props[6].Name)) diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java index b72874768ab2..e9e84bbb3429 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleValue.java @@ -323,7 +323,7 @@ public class _XAccessibleValue extends MultiMethodTest { return Short.valueOf((short)val); } else if (clazz.equals(Float.class)) { - return new Float((float)val); + return Float.valueOf((float)val); } else if (clazz.equals(Double.class)) { return new Double(val); diff --git a/qadevOOo/tests/java/ifc/style/_CharacterProperties.java b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java index fea9da4e4a3d..90f6b85315f3 100644 --- a/qadevOOo/tests/java/ifc/style/_CharacterProperties.java +++ b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java @@ -109,9 +109,9 @@ public class _CharacterProperties extends MultiPropertyTest { @Override protected Object getNewValue(String propName, Object old) { if (utils.isVoid(old)) { - return new Float(10) ; + return Float.valueOf(10) ; } else { - return new Float(((Float) old).floatValue() + 10) ; + return Float.valueOf(((Float) old).floatValue() + 10) ; } } }) ; @@ -143,8 +143,8 @@ public class _CharacterProperties extends MultiPropertyTest { } public void _CharWeight() { - testProperty("CharWeight", new Float(com.sun.star.awt.FontWeight.BOLD), - new Float(com.sun.star.awt.FontWeight.THIN)) ; + testProperty("CharWeight", Float.valueOf(com.sun.star.awt.FontWeight.BOLD), + Float.valueOf(com.sun.star.awt.FontWeight.THIN)) ; } public void _CharPosture() { diff --git a/qadevOOo/tests/java/ifc/style/_CharacterPropertiesAsian.java b/qadevOOo/tests/java/ifc/style/_CharacterPropertiesAsian.java index 96578c3bc77c..d14b7edbc76c 100644 --- a/qadevOOo/tests/java/ifc/style/_CharacterPropertiesAsian.java +++ b/qadevOOo/tests/java/ifc/style/_CharacterPropertiesAsian.java @@ -50,8 +50,8 @@ public class _CharacterPropertiesAsian extends MultiPropertyTest { } public void _CharWeightAsian() { - testProperty("CharWeightAsian", new Float(FontWeight.NORMAL), - new Float(FontWeight.BOLD)); + testProperty("CharWeightAsian", Float.valueOf(FontWeight.NORMAL), + Float.valueOf(FontWeight.BOLD)); } public void _ParaIsCharacterDistance() { diff --git a/qadevOOo/tests/java/ifc/style/_CharacterPropertiesComplex.java b/qadevOOo/tests/java/ifc/style/_CharacterPropertiesComplex.java index 2582ff8c5bec..557f6edcf7aa 100644 --- a/qadevOOo/tests/java/ifc/style/_CharacterPropertiesComplex.java +++ b/qadevOOo/tests/java/ifc/style/_CharacterPropertiesComplex.java @@ -40,8 +40,8 @@ import lib.MultiPropertyTest; public class _CharacterPropertiesComplex extends MultiPropertyTest { public void _CharWeightComplex() { - testProperty("CharWeightComplex", new Float(com.sun.star.awt.FontWeight.BOLD), - new Float(com.sun.star.awt.FontWeight.THIN)) ; + testProperty("CharWeightComplex", Float.valueOf(com.sun.star.awt.FontWeight.BOLD), + Float.valueOf(com.sun.star.awt.FontWeight.THIN)) ; } public void _CharPostureComplex() { diff --git a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java index 0683ab01cffa..71a26c0eea32 100644 --- a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java +++ b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java @@ -593,7 +593,7 @@ public class ODatabaseForm extends TestCase { params.add(Short.valueOf((short) 234)) ; params.add(Integer.valueOf(12345)) ; params.add(Long.valueOf(23456)) ; - params.add(new Float(1.234)) ; + params.add(Float.valueOf(1.234f)) ; params.add(new Double(2.345)) ; params.add(new byte[] {1, 2, 3}) ; Date d = new Date(); diff --git a/qadevOOo/tests/java/mod/_stm/DataInputStream.java b/qadevOOo/tests/java/mod/_stm/DataInputStream.java index ee55f57fa99d..73213f0fc5e2 100644 --- a/qadevOOo/tests/java/mod/_stm/DataInputStream.java +++ b/qadevOOo/tests/java/mod/_stm/DataInputStream.java @@ -115,7 +115,7 @@ public class DataInputStream extends TestCase { data.add(new Character((char)1234)) ; data.add(Short.valueOf((short)1234)) ; data.add(Integer.valueOf(123456)) ; - data.add(new Float(1.234)) ; + data.add(Float.valueOf(1.234f)) ; data.add(new Double(1.23456)) ; data.add("DataInputStream") ; // information for writing to the pipe diff --git a/qadevOOo/tests/java/mod/_stm/DataOutputStream.java b/qadevOOo/tests/java/mod/_stm/DataOutputStream.java index ead4fc671bb2..fba607c63d34 100644 --- a/qadevOOo/tests/java/mod/_stm/DataOutputStream.java +++ b/qadevOOo/tests/java/mod/_stm/DataOutputStream.java @@ -104,7 +104,7 @@ public class DataOutputStream extends TestCase { data.add(new Character((char)1234)) ; data.add(Short.valueOf((short)1234)) ; data.add(Integer.valueOf(123456)) ; - data.add(new Float(1.234)) ; + data.add(Float.valueOf(1.234f)) ; data.add(new Double(1.23456)) ; data.add("DataInputStream") ; // information for writing to the pipe diff --git a/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java b/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java index 6765ba721ef0..a71b2016821f 100644 --- a/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java +++ b/qadevOOo/tests/java/mod/_stm/MarkableOutputStream.java @@ -127,7 +127,7 @@ public class MarkableOutputStream extends TestCase { data.add(new Character((char)1234)) ; data.add(Short.valueOf((short)1234)) ; data.add(Integer.valueOf(123456)) ; - data.add(new Float(1.234)) ; + data.add(Float.valueOf(1.234f)) ; data.add(new Double(1.23456)) ; data.add("DataInputStream") ; // information for writing to the pipe diff --git a/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java b/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java index e40f2a12e187..91ec8ddc88f2 100644 --- a/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java +++ b/qadevOOo/tests/java/mod/_stm/ObjectInputStream.java @@ -216,7 +216,7 @@ public class ObjectInputStream extends TestCase { data.add(new Character((char)1234)) ; data.add(Short.valueOf((short)1234)) ; data.add(Integer.valueOf(123456)) ; - data.add(new Float(1.234)) ; + data.add(Float.valueOf(1.234f)) ; data.add(new Double(1.23456)) ; data.add("DataInputStream") ; // information for writing to the pipe diff --git a/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java b/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java index 37f091b9f0ad..5fd361273d81 100644 --- a/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java +++ b/qadevOOo/tests/java/mod/_stm/ObjectOutputStream.java @@ -208,7 +208,7 @@ public class ObjectOutputStream extends TestCase { data.add(new Character((char)1234)) ; data.add(Short.valueOf((short)1234)) ; data.add(Integer.valueOf(123456)) ; - data.add(new Float(1.234)) ; + data.add(Float.valueOf(1.234f)) ; data.add(new Double(1.23456)) ; data.add("DataInputStream") ; // information for writing to the pipe diff --git a/qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java b/qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java index a1c4a49d9bfc..a07c7fe903b1 100644 --- a/qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java +++ b/qadevOOo/tests/java/mod/_streams/uno/DataInputStream.java @@ -114,7 +114,7 @@ public class DataInputStream extends TestCase { data.add(new Character((char)1234)) ; data.add(Short.valueOf((short)1234)) ; data.add(Integer.valueOf(123456)) ; - data.add(new Float(1.234)) ; + data.add(Float.valueOf(1.234f)) ; data.add(new Double(1.23456)) ; data.add("DataInputStream") ; // information for writing to the pipe diff --git a/qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java b/qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java index fad95930a81d..07ea9bfac002 100644 --- a/qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java +++ b/qadevOOo/tests/java/mod/_streams/uno/DataOutputStream.java @@ -103,7 +103,7 @@ public class DataOutputStream extends TestCase { data.add(new Character((char)1234)) ; data.add(Short.valueOf((short)1234)) ; data.add(Integer.valueOf(123456)) ; - data.add(new Float(1.234)) ; + data.add(Float.valueOf(1.234f)) ; data.add(new Double(1.23456)) ; data.add("DataInputStream") ; // information for writing to the pipe diff --git a/qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java b/qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java index f08b20f175c3..a3b461f3d286 100644 --- a/qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java +++ b/qadevOOo/tests/java/mod/_streams/uno/MarkableOutputStream.java @@ -126,7 +126,7 @@ public class MarkableOutputStream extends TestCase { data.add(new Character((char)1234)) ; data.add(Short.valueOf((short)1234)) ; data.add(Integer.valueOf(123456)) ; - data.add(new Float(1.234)) ; + data.add(Float.valueOf(1.234f)) ; data.add(new Double(1.23456)) ; data.add("DataInputStream") ; // information for writing to the pipe diff --git a/qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java b/qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java index 6be959ed9fd2..de91ef8a07af 100644 --- a/qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java +++ b/qadevOOo/tests/java/mod/_streams/uno/ObjectInputStream.java @@ -222,7 +222,7 @@ public class ObjectInputStream extends TestCase { data.add(new Character((char)1234)) ; data.add(Short.valueOf((short)1234)) ; data.add(Integer.valueOf(123456)) ; - data.add(new Float(1.234)) ; + data.add(Float.valueOf(1.234f)) ; data.add(new Double(1.23456)) ; data.add("DataInputStream") ; // information for writing to the pipe diff --git a/qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java b/qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java index 98ffcbcb32ee..492cfaccb6a0 100644 --- a/qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java +++ b/qadevOOo/tests/java/mod/_streams/uno/ObjectOutputStream.java @@ -207,7 +207,7 @@ public class ObjectOutputStream extends TestCase { data.add(new Character((char)1234)) ; data.add(Short.valueOf((short)1234)) ; data.add(Integer.valueOf(123456)) ; - data.add(new Float(1.234)) ; + data.add(Float.valueOf(1.234f)) ; data.add(new Double(1.23456)) ; data.add("DataInputStream") ; // information for writing to the pipe |