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 | |
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>
44 files changed, 70 insertions, 71 deletions
diff --git a/chart2/qa/TestCaseOldAPI.java b/chart2/qa/TestCaseOldAPI.java index 613ba480e7be..0c2571436a21 100644 --- a/chart2/qa/TestCaseOldAPI.java +++ b/chart2/qa/TestCaseOldAPI.java @@ -162,7 +162,7 @@ public class TestCaseOldAPI extends ComplexTestCase { float fHeight = (float)17.0; xTitleProp.setPropertyValue( "String", aTitle ); - xTitleProp.setPropertyValue( "CharHeight", new Float( fHeight ) ); + xTitleProp.setPropertyValue( "CharHeight", Float.valueOf( fHeight ) ); float fNewHeight = AnyConverter.toFloat( xTitleProp.getPropertyValue( "CharHeight" ) ); assure( "Changing CharHeight via old API failed", fNewHeight == fHeight ); @@ -213,8 +213,8 @@ public class TestCaseOldAPI extends ComplexTestCase { float fHeight = (float)14.0; xTitleProp.setPropertyValue( "CharColor", Integer.valueOf( nColor ) ); - xTitleProp.setPropertyValue( "CharWeight", new Float( fWeight )); - xTitleProp.setPropertyValue( "CharHeight", new Float( fHeight ) ); + xTitleProp.setPropertyValue( "CharWeight", Float.valueOf( fWeight )); + xTitleProp.setPropertyValue( "CharHeight", Float.valueOf( fHeight ) ); int nNewColor = AnyConverter.toInt( xTitleProp.getPropertyValue( "CharColor" ) ); assure( "Changing CharColor via old API failed", nNewColor == nColor ); @@ -390,7 +390,7 @@ public class TestCaseOldAPI extends ComplexTestCase { assure( "Property LineColor", AnyConverter.toInt( xProp.getPropertyValue( "LineColor" )) == nNewColor ); float fNewCharHeight = (float)(16.0); - xProp.setPropertyValue( "CharHeight", new Float( fNewCharHeight )); + xProp.setPropertyValue( "CharHeight", Float.valueOf( fNewCharHeight )); assure( "Property CharHeight", AnyConverter.toFloat( xProp.getPropertyValue( "CharHeight" )) == fNewCharHeight ); @@ -444,7 +444,7 @@ public class TestCaseOldAPI extends ComplexTestCase { xLegendProp.getPropertyValue( "Alignment" )) == eNewPos ); float fNewCharHeight = (float)(11.0); - xLegendProp.setPropertyValue( "CharHeight", new Float( fNewCharHeight )); + xLegendProp.setPropertyValue( "CharHeight", Float.valueOf( fNewCharHeight )); assure( "Property CharHeight", AnyConverter.toFloat( xLegendProp.getPropertyValue( "CharHeight" )) == fNewCharHeight ); diff --git a/javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java b/javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java index 41149ba61a18..4943df7d29f8 100644 --- a/javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java +++ b/javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java @@ -96,7 +96,7 @@ public class PropertySet_Test cl.setPropertyValue("PropLongA", value); assertEquals(cl.getPropertyValue("PropLongA"), value); - value= new Float(3.14); + value= Float.valueOf(3.14f); cl.setPropertyValue("PropFloatA", value); assertEquals(cl.getPropertyValue("PropFloatA"), value); @@ -169,7 +169,7 @@ public class PropertySet_Test cl.setPropertyValue("PropObjectA", value); assertEquals(cl.getPropertyValue("PropObjectA"), value); - value= new Float(3.14); + value= Float.valueOf(3.14f); cl.setPropertyValue("PropObjectA", value); assertEquals(cl.getPropertyValue("PropObjectA"), value); @@ -238,7 +238,7 @@ public class PropertySet_Test assertTrue(ret instanceof Any); assertTrue(util.anyEquals(value, ret)); - value= new Float(3.14); + value= Float.valueOf(3.14f); cl.setPropertyValue("PropAnyA", value); ret= cl.getPropertyValue("PropAnyA"); assertTrue(ret instanceof Any); @@ -318,7 +318,7 @@ public class PropertySet_Test assertTrue(ret instanceof Long); assertTrue(util.anyEquals(value, ret)); - value= new Any(new Type(float.class), new Float(3.14)); + value= new Any(new Type(float.class), Float.valueOf(3.14f)); cl.setPropertyValue("PropFloatA", value); ret= cl.getPropertyValue("PropFloatA"); assertTrue(ret instanceof Float); @@ -398,7 +398,7 @@ public class PropertySet_Test assertTrue(ret instanceof Any); assertTrue(util.anyEquals(value, ret)); - value= new Any(new Type(float.class), new Float(3.14)); + value= new Any(new Type(float.class), Float.valueOf(3.14f)); cl.setPropertyValue("PropAnyA", value); ret= cl.getPropertyValue("PropAnyA"); assertTrue(ret instanceof Any); @@ -466,7 +466,7 @@ public class PropertySet_Test cl.setPropertyValue("PropLongClass", value); assertEquals(cl.getPropertyValue("PropLongClass"), value); - value= new Float(3.14); + value= Float.valueOf(3.14f); cl.setPropertyValue("PropFloatClass", value); assertEquals(cl.getPropertyValue("PropFloatClass"), value); @@ -514,7 +514,7 @@ public class PropertySet_Test assertTrue(ret instanceof Long); assertTrue(util.anyEquals(value, ret)); - value= new Any(new Type(float.class), new Float(3.14)); + value= new Any(new Type(float.class), Float.valueOf(3.14f)); cl.setPropertyValue("PropFloatClass", value); ret= cl.getPropertyValue("PropFloatClass"); assertTrue(ret instanceof Float); @@ -1197,7 +1197,7 @@ class TestClass extends PropertySet assertTrue(outNewVal[0] instanceof Long); assertEquals(outNewVal[0], value); - value= new Float(3.14); + value= Float.valueOf(3.14f); assertTrue(convertPropertyValue(propFloatA, outNewVal, outOldVal, value)); assertTrue(outNewVal[0] instanceof Float); assertEquals(outNewVal[0], value); @@ -1353,7 +1353,7 @@ class TestClass extends PropertySet assertTrue(outNewVal[0] instanceof Long); assertEquals(outNewVal[0], value); - value= new Float(3.14); + value= Float.valueOf(3.14f); assertTrue(convertPropertyValue(propFloatClass, outNewVal, outOldVal, value)); assertTrue(outNewVal[0] instanceof Float); assertEquals(outNewVal[0], value); @@ -1392,7 +1392,7 @@ class TestClass extends PropertySet setPropertyValueNoBroadcast(propLongA, value); assertEquals(longPropA, ((Long) value).longValue()); - value= new Float(3.14); + value= Float.valueOf(3.14f); setPropertyValueNoBroadcast(propFloatA, value); assertEquals(floatPropA, ((Float) value).floatValue(), 0.0f); diff --git a/odk/examples/DevelopersGuide/Charts/ChartInCalc.java b/odk/examples/DevelopersGuide/Charts/ChartInCalc.java index d974d6e45e95..2ca6546f5a66 100644 --- a/odk/examples/DevelopersGuide/Charts/ChartInCalc.java +++ b/odk/examples/DevelopersGuide/Charts/ChartInCalc.java @@ -260,9 +260,9 @@ public class ChartInCalc // add a label text with bold font, bordeaux red 14pt aPointProp.setPropertyValue( "DataCaption", Integer.valueOf( ChartDataCaption.VALUE )); - aPointProp.setPropertyValue( "CharHeight", new Float( 14.0 )); + aPointProp.setPropertyValue( "CharHeight", Float.valueOf( 14.0f )); aPointProp.setPropertyValue( "CharColor", Integer.valueOf( 0x993366 )); - aPointProp.setPropertyValue( "CharWeight", new Float( FontWeight.BOLD )); + aPointProp.setPropertyValue( "CharWeight", Float.valueOf( FontWeight.BOLD )); } catch( IndexOutOfBoundsException ex ) { @@ -318,7 +318,7 @@ public class ChartInCalc if( aTitleProp != null ) { aTitleProp.setPropertyValue( "String", "Random Scatter Chart" ); - aTitleProp.setPropertyValue( "CharHeight", new Float(14.0) ); + aTitleProp.setPropertyValue( "CharHeight", Float.valueOf(14.0f) ); } // align title with y axis diff --git a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java index 2dd4e9c0e68d..66bb2d8d6420 100644 --- a/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java +++ b/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java @@ -319,7 +319,7 @@ public class HelloTextTableShape { xCursorProps.setPropertyValue("CharPosture", com.sun.star.awt.FontSlant.ITALIC); xCursorProps.setPropertyValue("CharWeight", - new Float(com.sun.star.awt.FontWeight.BOLD)); + Float.valueOf(com.sun.star.awt.FontWeight.BOLD)); // add more text at the end of the text using insertString xTextCursor.gotoEnd(false); diff --git a/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.java b/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.java index 0696a866cdc3..872337013c26 100644 --- a/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.java +++ b/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetDocHelper.java @@ -244,7 +244,7 @@ public class SpreadsheetDocHelper xCell.setFormula( aHeadline ); xPropSet = UnoRuntime.queryInterface( com.sun.star.beans.XPropertySet.class, xCell ); xPropSet.setPropertyValue( "CharColor", Integer.valueOf( 0x003399 ) ); - xPropSet.setPropertyValue( "CharWeight", new Float( com.sun.star.awt.FontWeight.BOLD ) ); + xPropSet.setPropertyValue( "CharWeight", Float.valueOf( com.sun.star.awt.FontWeight.BOLD ) ); } diff --git a/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java b/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java index ce65555289fc..bbf54af0eb22 100644 --- a/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java +++ b/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java @@ -263,7 +263,7 @@ public class SpreadsheetSample extends SpreadsheetDocHelper xPropSet = UnoRuntime.queryInterface( com.sun.star.beans.XPropertySet.class, xCell ); // from styles.CharacterProperties xPropSet.setPropertyValue( "CharColor", Integer.valueOf( 0x003399 ) ); - xPropSet.setPropertyValue( "CharHeight", new Float( 20.0 ) ); + xPropSet.setPropertyValue( "CharHeight", Float.valueOf( 20.0f ) ); // from styles.ParagraphProperties xPropSet.setPropertyValue( "ParaLeftMargin", Integer.valueOf( 500 ) ); // from table.CellProperties @@ -314,7 +314,7 @@ public class SpreadsheetSample extends SpreadsheetDocHelper xPropSet = UnoRuntime.queryInterface( com.sun.star.beans.XPropertySet.class, xCellRange ); // from com.sun.star.styles.CharacterProperties xPropSet.setPropertyValue( "CharColor", Integer.valueOf( 0x003399 ) ); - xPropSet.setPropertyValue( "CharHeight", new Float( 20.0 ) ); + xPropSet.setPropertyValue( "CharHeight", Float.valueOf( 20.0f ) ); // from com.sun.star.styles.ParagraphProperties xPropSet.setPropertyValue( "ParaLeftMargin", Integer.valueOf( 500 ) ); // from com.sun.star.table.CellProperties diff --git a/odk/examples/DevelopersGuide/Text/TextDocuments.java b/odk/examples/DevelopersGuide/Text/TextDocuments.java index 1a1a82762612..2ccd270e281d 100644 --- a/odk/examples/DevelopersGuide/Text/TextDocuments.java +++ b/odk/examples/DevelopersGuide/Text/TextDocuments.java @@ -533,7 +533,7 @@ public class TextDocuments { XPropertySet xCursorProps = UnoRuntime.queryInterface( XPropertySet.class, mxDocCursor ); xCursorProps.setPropertyValue ( "CharWeight", - new Float(com.sun.star.awt.FontWeight.BOLD) ); + Float.valueOf(com.sun.star.awt.FontWeight.BOLD) ); // replace the '.' at the end of the sentence with a new string xSentenceCursor.gotoEndOfSentence( false ); diff --git a/odk/examples/java/Drawing/SDraw.java b/odk/examples/java/Drawing/SDraw.java index 5d2f9a52e941..a02d41ee01d9 100644 --- a/odk/examples/java/Drawing/SDraw.java +++ b/odk/examples/java/Drawing/SDraw.java @@ -221,8 +221,7 @@ public class SDraw { size.Height = height; size.Width = width; position.X = (x+(i*40)); - position.Y = - (new Float(y+(Math.sin((i*Math.PI)/180))*5000)).intValue(); + position.Y = (int)(y+(Math.sin((i*Math.PI)/180))*5000); xShape.setSize(size); xShape.setPosition(position); diff --git a/odk/examples/java/NotesAccess/NotesAccess.java b/odk/examples/java/NotesAccess/NotesAccess.java index 0d0a0bb5ee60..8945a9e9984e 100644 --- a/odk/examples/java/NotesAccess/NotesAccess.java +++ b/odk/examples/java/NotesAccess/NotesAccess.java @@ -271,7 +271,7 @@ public class NotesAccess implements Runnable { System.out.println( "Could not get Cell" ); } if ( stringFlag.equals( "V" )) { - xCell.setValue((new Float(stringValue)).floatValue()); + xCell.setValue((Float.valueOf(stringValue)).floatValue()); } else { xCell.setFormula(stringValue); diff --git a/odk/examples/java/Spreadsheet/ChartTypeChange.java b/odk/examples/java/Spreadsheet/ChartTypeChange.java index d436b388925e..78f8b14bb417 100644 --- a/odk/examples/java/Spreadsheet/ChartTypeChange.java +++ b/odk/examples/java/Spreadsheet/ChartTypeChange.java @@ -336,7 +336,7 @@ public class ChartTypeChange { System.out.println( "Could not get cell." ); } if ( stringFlag.equals( "V" ) ) { - xcell.setValue( ( new Float( stringValue ) ).floatValue() ); + xcell.setValue( ( Float.valueOf( stringValue ) ).floatValue() ); } else { xcell.setFormula( stringValue ); diff --git a/odk/examples/java/Spreadsheet/SCalc.java b/odk/examples/java/Spreadsheet/SCalc.java index 90c5ce00f41d..db1bee8a803a 100644 --- a/odk/examples/java/Spreadsheet/SCalc.java +++ b/odk/examples/java/Spreadsheet/SCalc.java @@ -374,7 +374,7 @@ public class SCalc { } if (flag.equals("V")) { - xCell.setValue((new Float(theValue)).floatValue()); + xCell.setValue((Float.valueOf(theValue)).floatValue()); } else { xCell.setFormula(theValue); } diff --git a/odk/examples/java/Text/HardFormatting.java b/odk/examples/java/Text/HardFormatting.java index 81a294c86320..2dcc7b084e36 100644 --- a/odk/examples/java/Text/HardFormatting.java +++ b/odk/examples/java/Text/HardFormatting.java @@ -119,7 +119,7 @@ public class HardFormatting { xPropertySet = UnoRuntime.queryInterface( com.sun.star.beans.XPropertySet.class, xWordCursor); xPropertySet.setPropertyValue("CharWeight", - new Float(com.sun.star.awt.FontWeight.BOLD)); + Float.valueOf(com.sun.star.awt.FontWeight.BOLD)); xPropertySet.setPropertyValue("CharColor", Integer.valueOf( 255 ) ); System.out.println( diff --git a/odk/examples/java/Text/StyleCreation.java b/odk/examples/java/Text/StyleCreation.java index d5151eca7c29..5ad1c9498a26 100644 --- a/odk/examples/java/Text/StyleCreation.java +++ b/odk/examples/java/Text/StyleCreation.java @@ -93,11 +93,11 @@ public class StyleCreation { xPropertySet.setPropertyValue("CharFontName", "Helvetica" ); System.out.println( "set name of the font to 'Helvetica'" ); - xPropertySet.setPropertyValue("CharHeight", new Float( 36 ) ); + xPropertySet.setPropertyValue("CharHeight", Float.valueOf( 36 ) ); System.out.println( "Change the height of th font to 36" ); xPropertySet.setPropertyValue("CharWeight", - new Float( com.sun.star.awt.FontWeight.BOLD ) ); + Float.valueOf( com.sun.star.awt.FontWeight.BOLD ) ); System.out.println( "set the font attribute 'Bold'" ); xPropertySet.setPropertyValue("CharAutoKerning", Boolean.TRUE ); diff --git a/odk/examples/java/Text/TextDocumentStructure.java b/odk/examples/java/Text/TextDocumentStructure.java index 7f284556d3f5..a1043a44775f 100644 --- a/odk/examples/java/Text/TextDocumentStructure.java +++ b/odk/examples/java/Text/TextDocumentStructure.java @@ -186,7 +186,7 @@ public class TextDocumentStructure { UnoRuntime.queryInterface( com.sun.star.beans.XPropertySet.class, xWordCursor ); xPropertySet.setPropertyValue("CharWeight", - new Float( com.sun.star.awt.FontWeight.BOLD )); + Float.valueOf( com.sun.star.awt.FontWeight.BOLD )); System.out.println("create example data"); } 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 diff --git a/ridljar/com/sun/star/lib/uno/helper/PropertySet.java b/ridljar/com/sun/star/lib/uno/helper/PropertySet.java index 67a4f0c98062..ea89e102b836 100644 --- a/ridljar/com/sun/star/lib/uno/helper/PropertySet.java +++ b/ridljar/com/sun/star/lib/uno/helper/PropertySet.java @@ -747,7 +747,7 @@ XMultiPropertySet else if (cl.equals(long.class)) retVal= Long.valueOf(AnyConverter.toLong(obj)); else if (cl.equals(float.class)) - retVal= new Float(AnyConverter.toFloat(obj)); + retVal= Float.valueOf(AnyConverter.toFloat(obj)); else if (cl.equals(double.class)) retVal= new Double(AnyConverter.toDouble(obj)); else if (cl.equals(String.class)) @@ -769,7 +769,7 @@ XMultiPropertySet else if (cl.equals(Long.class)) retVal= Long.valueOf(AnyConverter.toLong(obj)); else if (cl.equals(Float.class)) - retVal= new Float(AnyConverter.toFloat(obj)); + retVal= Float.valueOf(AnyConverter.toFloat(obj)); else if (cl.equals(Double.class)) retVal= new Double(AnyConverter.toDouble(obj)); else if (XInterface.class.isAssignableFrom(cl)) diff --git a/ridljar/com/sun/star/lib/uno/protocols/urp/Unmarshal.java b/ridljar/com/sun/star/lib/uno/protocols/urp/Unmarshal.java index c16d19291356..bf820729c2c9 100644 --- a/ridljar/com/sun/star/lib/uno/protocols/urp/Unmarshal.java +++ b/ridljar/com/sun/star/lib/uno/protocols/urp/Unmarshal.java @@ -255,7 +255,7 @@ final class Unmarshal { } private Float readFloatValue() throws IOException { - return new Float(input.readFloat()); + return Float.valueOf(input.readFloat()); } private Double readDoubleValue() throws IOException { diff --git a/ridljar/com/sun/star/uno/AnyConverter.java b/ridljar/com/sun/star/uno/AnyConverter.java index d36542e1a67a..e44425d71999 100644 --- a/ridljar/com/sun/star/uno/AnyConverter.java +++ b/ridljar/com/sun/star/uno/AnyConverter.java @@ -599,9 +599,9 @@ public class AnyConverter case TypeClass.FLOAT_value: switch (tc) { case TypeClass.BYTE_value: - return new Float( ((Byte)object).byteValue() ); + return Float.valueOf( ((Byte)object).byteValue() ); case TypeClass.SHORT_value: - return new Float( ((Short)object).shortValue() ); + return Float.valueOf( ((Short)object).shortValue() ); case TypeClass.FLOAT_value: return object; } diff --git a/ridljar/com/sun/star/uno/UnoRuntime.java b/ridljar/com/sun/star/uno/UnoRuntime.java index 1f011aa77050..a054b406fe79 100644 --- a/ridljar/com/sun/star/uno/UnoRuntime.java +++ b/ridljar/com/sun/star/uno/UnoRuntime.java @@ -332,7 +332,7 @@ public class UnoRuntime { case TypeClass.UNSIGNED_HYPER_value: return Long.valueOf(0); case TypeClass.FLOAT_value: - return new Float(0.0f); + return Float.valueOf(0.0f); case TypeClass.DOUBLE_value: return new Double(0.0); case TypeClass.CHAR_value: diff --git a/ridljar/test/com/sun/star/lib/uno/protocols/urp/Marshaling_Test.java b/ridljar/test/com/sun/star/lib/uno/protocols/urp/Marshaling_Test.java index 5cf5f73e6554..a1ad705b26a7 100644 --- a/ridljar/test/com/sun/star/lib/uno/protocols/urp/Marshaling_Test.java +++ b/ridljar/test/com/sun/star/lib/uno/protocols/urp/Marshaling_Test.java @@ -49,7 +49,7 @@ public final class Marshaling_Test { new Character('k'), new Double(0.12345), TestEnum.B, - new Float(0.5678), + Float.valueOf(0.5678f), Integer.valueOf(0), Integer.valueOf(128), Integer.valueOf(0x0f00), diff --git a/ridljar/test/com/sun/star/uno/AnyConverter_Test.java b/ridljar/test/com/sun/star/uno/AnyConverter_Test.java index faa955a96582..5b1a5b34d4f4 100644 --- a/ridljar/test/com/sun/star/uno/AnyConverter_Test.java +++ b/ridljar/test/com/sun/star/uno/AnyConverter_Test.java @@ -61,7 +61,7 @@ public final class AnyConverter_Test { aShort= Short.valueOf((short) 11111); aInt= Integer.valueOf( 1111111); aLong= Long.valueOf( 0xffffffff); - aFloat= new Float( 3.14); + aFloat= Float.valueOf( 3.14f); aDouble= new Double( 3.145); aObj= new ATypeProvider(); aStr= "I am a string"; diff --git a/scripting/examples/beanshell/Highlight/ButtonPressHandler.bsh b/scripting/examples/beanshell/Highlight/ButtonPressHandler.bsh index ac6efacce5d3..74f00ca1efa1 100644 --- a/scripting/examples/beanshell/Highlight/ButtonPressHandler.bsh +++ b/scripting/examples/beanshell/Highlight/ButtonPressHandler.bsh @@ -80,7 +80,7 @@ else // Sets the replaced text property fontweight value to Bold PropertyValue wv = new PropertyValue("CharWeight", -1, - new Float(com.sun.star.awt.FontWeight.BOLD), + Float.valueOf(com.sun.star.awt.FontWeight.BOLD), com.sun.star.beans.PropertyState.DIRECT_VALUE); // Sets the replaced text property color value to RGB parameter diff --git a/scripting/examples/beanshell/Highlight/highlighter.bsh b/scripting/examples/beanshell/Highlight/highlighter.bsh index a69f76e1a113..576650392c41 100644 --- a/scripting/examples/beanshell/Highlight/highlighter.bsh +++ b/scripting/examples/beanshell/Highlight/highlighter.bsh @@ -44,12 +44,12 @@ int replaceText(searchKey, color, bold) { wv = null; if (bold) { wv = new PropertyValue("CharWeight", -1, - new Float(com.sun.star.awt.FontWeight.BOLD), + Float.valueOf(com.sun.star.awt.FontWeight.BOLD), com.sun.star.beans.PropertyState.DIRECT_VALUE); } else { wv = new PropertyValue("CharWeight", -1, - new Float(com.sun.star.awt.FontWeight.NORMAL), + Float.valueOf(com.sun.star.awt.FontWeight.NORMAL), com.sun.star.beans.PropertyState.DIRECT_VALUE); } diff --git a/scripting/examples/java/Highlight/HighlightText.java b/scripting/examples/java/Highlight/HighlightText.java index f39ccbfa22bf..cc381cec8e59 100644 --- a/scripting/examples/java/Highlight/HighlightText.java +++ b/scripting/examples/java/Highlight/HighlightText.java @@ -142,7 +142,7 @@ public class HighlightText implements com.sun.star.awt.XActionListener { // Sets the replaced text property fontweight value to Bold PropertyValue wv = new PropertyValue("CharWeight", -1, - new Float(com.sun.star.awt.FontWeight.BOLD), + Float.valueOf(com.sun.star.awt.FontWeight.BOLD), com.sun.star.beans.PropertyState.DIRECT_VALUE); // Sets the replaced text property color value to RGB parameter diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java index 271b139565fb..0660f930f0fb 100644 --- a/testtools/com/sun/star/comp/bridge/TestComponent.java +++ b/testtools/com/sun/star/comp/bridge/TestComponent.java @@ -1211,7 +1211,7 @@ public class TestComponent { new Any(Type.UNSIGNED_LONG, Integer.valueOf(-1)), Long.valueOf(Long.MIN_VALUE), new Any(Type.UNSIGNED_HYPER, Long.valueOf(-1L)), - new Float(0.123f), + Float.valueOf(0.123f), new Double(0.456), new Character('X'), "test", @@ -1268,7 +1268,7 @@ public class TestComponent { new TestPolyStruct(Long.valueOf(Long.MIN_VALUE)), new TestPolyStruct(new Character('X')), new TestPolyStruct("test"), - new TestPolyStruct(new Float(0.123f)), + new TestPolyStruct(Float.valueOf(0.123f)), new TestPolyStruct(new Double(0.456)), new TestPolyStruct(new com.sun.star.lib.uno.helper.ComponentBase()), new TestPolyStruct(new com.sun.star.lib.uno.helper.ComponentBase()), diff --git a/wizards/com/sun/star/wizards/common/NumericalHelper.java b/wizards/com/sun/star/wizards/common/NumericalHelper.java index af74704df4a2..b15d4af02bfc 100644 --- a/wizards/com/sun/star/wizards/common/NumericalHelper.java +++ b/wizards/com/sun/star/wizards/common/NumericalHelper.java @@ -199,7 +199,7 @@ public class NumericalHelper break; case TypeClass.FLOAT_value: aTypeObject.iType = FLOAT_TYPE; - aTypeObject.aValue = new Float(AnyConverter.toFloat(aValue)); + aTypeObject.aValue = Float.valueOf(AnyConverter.toFloat(aValue)); break; case TypeClass.DOUBLE_value: aTypeObject.iType = DOUBLE_TYPE; diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/DesignTemplate.java b/wizards/com/sun/star/wizards/reportbuilder/layout/DesignTemplate.java index a7343d9010f7..54f0c492b02d 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/DesignTemplate.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/DesignTemplate.java @@ -142,7 +142,7 @@ public class DesignTemplate { a = SectionEmptyObject.create(); // an empty group has to use bold font - a.setPropertyValue("CharWeight", new Float(com.sun.star.awt.FontWeight.BOLD)); + a.setPropertyValue("CharWeight", Float.valueOf(com.sun.star.awt.FontWeight.BOLD)); } return a; } diff --git a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java index c6d3887cccaf..f39cc47174ed 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java +++ b/wizards/com/sun/star/wizards/reportbuilder/layout/SectionObject.java @@ -60,7 +60,7 @@ abstract public class SectionObject public void setFontToBold() { - setPropertyValue("CharWeight", new Float(com.sun.star.awt.FontWeight.BOLD)); + setPropertyValue("CharWeight", Float.valueOf(com.sun.star.awt.FontWeight.BOLD)); } public void setPropertyValue(String _sKey, Object _nValue) |