diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-12 15:10:41 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-19 14:57:17 +0200 |
commit | 8a2c6c29af41cd7a62f37861fb0d4e81a857bb45 (patch) | |
tree | 87575bd76a2ce98793d2bb1773ddc4a9c4e5e41c | |
parent | ff0ad0493ee1729c726587f667761b04101d774c (diff) |
java: use 'Long.valueOf' instead of 'new Long'
Change-Id: If4fff3dd37326fbcdd01b743355a16591d71fa69
18 files changed, 50 insertions, 50 deletions
diff --git a/bean/com/sun/star/beans/LocalOfficeWindow.java b/bean/com/sun/star/beans/LocalOfficeWindow.java index 03a4bd4b90ca..ebae69da94f5 100644 --- a/bean/com/sun/star/beans/LocalOfficeWindow.java +++ b/bean/com/sun/star/beans/LocalOfficeWindow.java @@ -126,7 +126,7 @@ public class LocalOfficeWindow // set real parent XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface( XVclWindowPeer.class, mWindow); - xVclWindowPeer.setProperty( "PluginParent", new Long(getNativeWindow()) ); + xVclWindowPeer.setProperty( "PluginParent", Long.valueOf(getNativeWindow()) ); bPeer = true; // show document window @@ -147,7 +147,7 @@ public class LocalOfficeWindow // set null parent XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface( XVclWindowPeer.class, mWindow); - xVclWindowPeer.setProperty( "PluginParent", new Long(0) ); + xVclWindowPeer.setProperty( "PluginParent", Long.valueOf(0) ); bPeer = false; } } diff --git a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java index e82061737c75..0fb6f9d8e722 100644 --- a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java +++ b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java @@ -151,7 +151,7 @@ public class LocalOfficeWindow // set null parent XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface( XVclWindowPeer.class, mWindow); - xVclWindowPeer.setProperty( "PluginParent", new Long(0) ); + xVclWindowPeer.setProperty( "PluginParent", Long.valueOf(0) ); bPeer = false; } } @@ -257,7 +257,7 @@ public class LocalOfficeWindow { NamedValue window = new NamedValue( - "WINDOW", new Any(new Type(Long.class), new Long(getNativeWindow()))); + "WINDOW", new Any(new Type(Long.class), Long.valueOf(getNativeWindow()))); NamedValue xembed = new NamedValue( "XEMBED", new Any(new Type(Boolean.class), Boolean.FALSE)); diff --git a/bridges/test/java_remote/PolyStructTest.java b/bridges/test/java_remote/PolyStructTest.java index 337a061d1d09..affb828a80cf 100644 --- a/bridges/test/java_remote/PolyStructTest.java +++ b/bridges/test/java_remote/PolyStructTest.java @@ -93,15 +93,15 @@ public final class PolyStructTest extends ComplexTestCase { new TestPolyStruct(Integer.valueOf(Integer.MAX_VALUE))).member); assertEquals( - new Long(0L), t.transportHyper(new TestPolyStruct()).member); + Long.valueOf(0L), t.transportHyper(new TestPolyStruct()).member); assertEquals( - new Long(Long.MIN_VALUE), + Long.valueOf(Long.MIN_VALUE), t.transportHyper( - new TestPolyStruct(new Long(Long.MIN_VALUE))).member); + new TestPolyStruct(Long.valueOf(Long.MIN_VALUE))).member); assertEquals( - new Long(Long.MAX_VALUE), + Long.valueOf(Long.MAX_VALUE), t.transportHyper( - new TestPolyStruct(new Long(Long.MAX_VALUE))).member); + new TestPolyStruct(Long.valueOf(Long.MAX_VALUE))).member); assertEquals( new Float(0.0f), t.transportFloat(new TestPolyStruct()).member); diff --git a/bridges/test/java_uno/any/TestAny.java b/bridges/test/java_uno/any/TestAny.java index 2c1575fcf555..7e1d0dc7ef50 100644 --- a/bridges/test/java_uno/any/TestAny.java +++ b/bridges/test/java_uno/any/TestAny.java @@ -194,29 +194,29 @@ final class TestAny { new CompareBoxed()); // HYPER: - success &= testMapAny(transport, new Long(-9223372036854775808L), + success &= testMapAny(transport, Long.valueOf(-9223372036854775808L), new CompareBoxed()); - success &= testMapAny(transport, new Long(0L), new CompareBoxed()); - success &= testMapAny(transport, new Long(9223372036854775807L), + success &= testMapAny(transport, Long.valueOf(0L), new CompareBoxed()); + success &= testMapAny(transport, Long.valueOf(9223372036854775807L), new CompareBoxed()); success &= testMapAny(transport, new Any(Type.HYPER, - new Long(-9223372036854775808L)), + Long.valueOf(-9223372036854775808L)), new CompareUnboxed()); - success &= testMapAny(transport, new Any(Type.HYPER, new Long(0L)), + success &= testMapAny(transport, new Any(Type.HYPER, Long.valueOf(0L)), new CompareUnboxed()); success &= testMapAny(transport, new Any(Type.HYPER, - new Long(9223372036854775807L)), + Long.valueOf(9223372036854775807L)), new CompareUnboxed()); // UNSIGNED HYPER: success &= testMapAny(transport, - new Any(Type.UNSIGNED_HYPER, new Long(0L)), + new Any(Type.UNSIGNED_HYPER, Long.valueOf(0L)), new CompareBoxed()); success &= testMapAny(transport, new Any(Type.UNSIGNED_HYPER, - new Long(-9223372036854775808L)), + Long.valueOf(-9223372036854775808L)), new CompareBoxed()); // FLOAT: diff --git a/comphelper/qa/complex/comphelper/Map.java b/comphelper/qa/complex/comphelper/Map.java index a615c8f86323..9ff558a44b2c 100644 --- a/comphelper/qa/complex/comphelper/Map.java +++ b/comphelper/qa/complex/comphelper/Map.java @@ -237,7 +237,7 @@ public class Map /* extends complexlib.ComplexTestCase */ case 0: someValue = Boolean.FALSE; break; case 1: someValue = new Short( (short)0 ); break; case 2: someValue = Integer.valueOf( 0 ); break; - case 3: someValue = new Long( 0 ); break; + case 3: someValue = Long.valueOf( 0 ); break; case 4: someValue = UnoRuntime.queryInterface( XInterface.class, new DummyInterface() ); break; case 5: someValue = UnoRuntime.queryInterface( XSet.class, new DummySet() ); break; case 6: someValue = UnoRuntime.queryInterface( XContainer.class, new DummyContainer() ); break; diff --git a/framework/qa/complex/framework/autosave/Protocol.java b/framework/qa/complex/framework/autosave/Protocol.java index 225ebce46207..77b1dc64376b 100644 --- a/framework/qa/complex/framework/autosave/Protocol.java +++ b/framework/qa/complex/framework/autosave/Protocol.java @@ -279,9 +279,9 @@ public class Protocol extends JComponent // insert line number if (m_nLine % MARK_DIFF == 0) - impl_generateColoredHTMLCell(sLine, new Long(m_nLine).toString(), BGCOLOR_LINECOL, FGCOLOR_LINECOL_MARKED, true); + impl_generateColoredHTMLCell(sLine, Long.valueOf(m_nLine).toString(), BGCOLOR_LINECOL, FGCOLOR_LINECOL_MARKED, true); else - impl_generateColoredHTMLCell(sLine, new Long(m_nLine).toString(), BGCOLOR_LINECOL, FGCOLOR_LINECOL_NORMAL, false); + impl_generateColoredHTMLCell(sLine, Long.valueOf(m_nLine).toString(), BGCOLOR_LINECOL, FGCOLOR_LINECOL_NORMAL, false); // add time stamp impl_generateColoredHTMLCell(sLine, m_aStamp.toString()+" ", BGCOLOR_TIMESTAMP, FGCOLOR_TIMESTAMP, false); diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java index 327145f624ab..bf7a69f45758 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java @@ -741,7 +741,7 @@ XMultiPropertySet else if (cl.equals(int.class)) retVal= Integer.valueOf(AnyConverter.toInt(obj)); else if (cl.equals(long.class)) - retVal= new Long(AnyConverter.toLong(obj)); + retVal= Long.valueOf(AnyConverter.toLong(obj)); else if (cl.equals(float.class)) retVal= new Float(AnyConverter.toFloat(obj)); else if (cl.equals(double.class)) @@ -763,7 +763,7 @@ XMultiPropertySet else if (cl.equals(Integer.class)) retVal= Integer.valueOf(AnyConverter.toInt(obj)); else if (cl.equals(Long.class)) - retVal= new Long(AnyConverter.toLong(obj)); + retVal= Long.valueOf(AnyConverter.toLong(obj)); else if (cl.equals(Float.class)) retVal= new Float(AnyConverter.toFloat(obj)); else if (cl.equals(Double.class)) 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 55617e7e038b..fb173ba58cd1 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 @@ -117,7 +117,7 @@ public class PropertySet_Test cl.setPropertyValue("PropIntA", value); ret= cl.getPropertyValue("PropIntA"); r[i++]= ((Integer) ret).equals(value); - value= new Long(115); + value= Long.valueOf(115); cl.setPropertyValue("PropLongA", value); ret= cl.getPropertyValue("PropLongA"); r[i++]= ((Long) ret).equals(value); @@ -192,7 +192,7 @@ public class PropertySet_Test cl.setPropertyValue("PropObjectA", value); ret= cl.getPropertyValue("PropObjectA"); r[i++]= ((Integer) ret).equals(value); - value= new Long(115); + value= Long.valueOf(115); cl.setPropertyValue("PropObjectA", value); ret= cl.getPropertyValue("PropObjectA"); r[i++]= ((Long) ret).equals(value); @@ -249,7 +249,7 @@ public class PropertySet_Test cl.setPropertyValue("PropAnyA", value); ret= cl.getPropertyValue("PropAnyA"); r[i++]= ret instanceof Any && util.anyEquals(value, ret); - value= new Long(115); + value= Long.valueOf(115); cl.setPropertyValue("PropAnyA", value); ret= cl.getPropertyValue("PropAnyA"); r[i++]= ret instanceof Any && util.anyEquals(value, ret); @@ -303,7 +303,7 @@ public class PropertySet_Test cl.setPropertyValue("PropIntA", value); ret= cl.getPropertyValue("PropIntA"); r[i++]= ret instanceof Integer && util.anyEquals(value, ret); - value= new Any(new Type(long.class), new Long(115)); + value= new Any(new Type(long.class), Long.valueOf(115)); cl.setPropertyValue("PropLongA", value); ret= cl.getPropertyValue("PropLongA"); r[i++]= ret instanceof Long && util.anyEquals(value, ret); @@ -358,7 +358,7 @@ public class PropertySet_Test cl.setPropertyValue("PropAnyA", value); ret= cl.getPropertyValue("PropAnyA"); r[i++]= ret instanceof Any && util.anyEquals(value, ret); - value= new Any(new Type(long.class), new Long(115)); + value= new Any(new Type(long.class), Long.valueOf(115)); cl.setPropertyValue("PropAnyA", value); ret= cl.getPropertyValue("PropAnyA"); r[i++]= ret instanceof Any && util.anyEquals(value, ret); @@ -414,7 +414,7 @@ public class PropertySet_Test cl.setPropertyValue("PropIntClass", value); ret= cl.getPropertyValue("PropIntClass"); r[i++]= ((Integer) ret).equals(value); - value= new Long(115); + value= Long.valueOf(115); cl.setPropertyValue("PropLongClass", value); ret= cl.getPropertyValue("PropLongClass"); r[i++]= ((Long) ret).equals(value); @@ -450,7 +450,7 @@ public class PropertySet_Test cl.setPropertyValue("PropIntClass", value); ret= cl.getPropertyValue("PropIntClass"); r[i++]= ret instanceof Integer && util.anyEquals(value, ret); - value= new Any(new Type(long.class), new Long(115)); + value= new Any(new Type(long.class), Long.valueOf(115)); cl.setPropertyValue("PropLongClass", value); ret= cl.getPropertyValue("PropLongClass"); r[i++]= ret instanceof Long && util.anyEquals(value, ret); @@ -1219,7 +1219,7 @@ class TestClass extends PropertySet value= Integer.valueOf( 113); r[i++]= convertPropertyValue(propIntA, outNewVal, outOldVal, value); r[i++]= outNewVal[0] instanceof Integer && outNewVal[0].equals(value); - value= new Long(114); + value= Long.valueOf(114); r[i++]= convertPropertyValue(propLongA, outNewVal, outOldVal, value); r[i++]= outNewVal[0] instanceof Long && outNewVal[0].equals(value); value= new Float(3.14); @@ -1330,7 +1330,7 @@ class TestClass extends PropertySet value= Integer.valueOf( 113); r[i++]= convertPropertyValue(propIntClass, outNewVal, outOldVal, value); r[i++]= outNewVal[0] instanceof Integer && outNewVal[0].equals(value); - value= new Long(114); + value= Long.valueOf(114); r[i++]= convertPropertyValue(propLongClass, outNewVal, outOldVal, value); r[i++]= outNewVal[0] instanceof Long && outNewVal[0].equals(value); value= new Float(3.14); @@ -1371,7 +1371,7 @@ class TestClass extends PropertySet value= Integer.valueOf( 113); setPropertyValueNoBroadcast(propIntA, value); r[i++]= intPropA == ((Integer) value).intValue(); - value= new Long(114); + value= Long.valueOf(114); setPropertyValueNoBroadcast(propLongA, value); r[i++]= longPropA == ((Long) value).longValue(); value= new Float(3.14); diff --git a/jurt/com/sun/star/lib/uno/protocols/urp/Unmarshal.java b/jurt/com/sun/star/lib/uno/protocols/urp/Unmarshal.java index b2776e23b66d..865bb0733bb7 100644 --- a/jurt/com/sun/star/lib/uno/protocols/urp/Unmarshal.java +++ b/jurt/com/sun/star/lib/uno/protocols/urp/Unmarshal.java @@ -234,7 +234,7 @@ final class Unmarshal { private Long readHyperValue() { try { - return new Long(input.readLong()); + return Long.valueOf(input.readLong()); } catch (IOException e) { throw new RuntimeException(e.toString()); } diff --git a/jurt/com/sun/star/uno/AnyConverter.java b/jurt/com/sun/star/uno/AnyConverter.java index 9acdb1622e16..83819d51a89f 100644 --- a/jurt/com/sun/star/uno/AnyConverter.java +++ b/jurt/com/sun/star/uno/AnyConverter.java @@ -574,13 +574,13 @@ public class AnyConverter case TypeClass.HYPER_value: switch (tc) { case TypeClass.BYTE_value: - return new Long( ((Byte)object).byteValue() ); + return Long.valueOf( ((Byte)object).byteValue() ); case TypeClass.SHORT_value: case TypeClass.UNSIGNED_SHORT_value: - return new Long( ((Short)object).shortValue() ); + return Long.valueOf( ((Short)object).shortValue() ); case TypeClass.LONG_value: case TypeClass.UNSIGNED_LONG_value: - return new Long( ((Integer)object).intValue() ); + return Long.valueOf( ((Integer)object).intValue() ); case TypeClass.HYPER_value: return object; } @@ -588,9 +588,9 @@ public class AnyConverter case TypeClass.UNSIGNED_HYPER_value: switch (tc) { case TypeClass.UNSIGNED_SHORT_value: - return new Long( ((Short)object).shortValue() ); + return Long.valueOf( ((Short)object).shortValue() ); case TypeClass.UNSIGNED_LONG_value: - return new Long( ((Integer)object).intValue() ); + return Long.valueOf( ((Integer)object).intValue() ); case TypeClass.UNSIGNED_HYPER_value: return object; } diff --git a/jurt/test/com/sun/star/lib/uno/protocols/urp/Marshaling_Test.java b/jurt/test/com/sun/star/lib/uno/protocols/urp/Marshaling_Test.java index 73919da886c9..c5498dea1ae8 100644 --- a/jurt/test/com/sun/star/lib/uno/protocols/urp/Marshaling_Test.java +++ b/jurt/test/com/sun/star/lib/uno/protocols/urp/Marshaling_Test.java @@ -58,7 +58,7 @@ public final class Marshaling_Test { Integer.valueOf(0xff00), Integer.valueOf(0xff0000), Integer.valueOf(0xff000000), - new Long(666L), + Long.valueOf(666L), new Short((short)444), new String("blabla"), Integer.valueOf(10), // Any as object diff --git a/jurt/test/com/sun/star/uno/AnyConverter_Test.java b/jurt/test/com/sun/star/uno/AnyConverter_Test.java index ce6316578f68..3a0c77723a4d 100644 --- a/jurt/test/com/sun/star/uno/AnyConverter_Test.java +++ b/jurt/test/com/sun/star/uno/AnyConverter_Test.java @@ -42,7 +42,7 @@ public final class AnyConverter_Test { Byte aByte= new Byte((byte) 111); Short aShort= new Short((short) 11111); Integer aInt= Integer.valueOf( 1111111); - Long aLong= new Long( 0xffffffff); + Long aLong= Long.valueOf( 0xffffffff); Float aFloat= new Float( 3.14); Double aDouble= new Double( 3.145); Object aObj= new ATypeProvider(); @@ -389,7 +389,7 @@ public final class AnyConverter_Test { a = new Any( Type.UNSIGNED_LONG, Integer.valueOf(5) ); assertEquals(5, AnyConverter.toUnsignedLong(a)); assertEquals(5, AnyConverter.toLong(a)); - a = new Any( Type.UNSIGNED_HYPER, new Long(5) ); + a = new Any( Type.UNSIGNED_HYPER, Long.valueOf(5) ); assertEquals(5, AnyConverter.toUnsignedLong(a)); // must fail @@ -819,7 +819,7 @@ public final class AnyConverter_Test { assertTrue(AnyConverter.isLong(aLong)); assertTrue(AnyConverter.isLong(anyLong)); assertEquals(Type.HYPER, AnyConverter.getType(anyLong)); - Any a = new Any( Type.UNSIGNED_HYPER, new Long(5) ); + Any a = new Any( Type.UNSIGNED_HYPER, Long.valueOf(5) ); assertEquals(Type.UNSIGNED_HYPER, AnyConverter.getType(a)); assertFalse(AnyConverter.isLong(a)); assertFalse(Type.HYPER.equals( AnyConverter.getType(a) )); diff --git a/qadevOOo/runner/helper/InetTools.java b/qadevOOo/runner/helper/InetTools.java index 2a5371d8ddaf..1ab8a2fe68a9 100644 --- a/qadevOOo/runner/helper/InetTools.java +++ b/qadevOOo/runner/helper/InetTools.java @@ -65,7 +65,7 @@ public class InetTools { oInetProps.setPropertyValue("ooInetHTTPProxyName", HTTPProxyName); oInetProps.setPropertyValue("ooInetHTTPProxyPort", HTTPProxyPort); - oInetProps.setPropertyValue("ooInetProxyType", new Long(2)); + oInetProps.setPropertyValue("ooInetProxyType", Long.valueOf(2)); XChangesBatch oSecureChange = UnoRuntime.queryInterface( XChangesBatch.class, oInet); diff --git a/qadevOOo/runner/util/ValueChanger.java b/qadevOOo/runner/util/ValueChanger.java index db95579f162c..a197c1b65d69 100644 --- a/qadevOOo/runner/util/ValueChanger.java +++ b/qadevOOo/runner/util/ValueChanger.java @@ -60,7 +60,7 @@ public class ValueChanger { if (oldValue instanceof Long) { long oldlong = ((Long) oldValue).longValue(); - newValue = new Long(oldlong + 15); + newValue = Long.valueOf(oldlong + 15); } else if (oldValue instanceof Short) { diff --git a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java index a1c93b212b8b..58cd7a252c94 100644 --- a/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java +++ b/qadevOOo/tests/java/mod/_forms/ODatabaseForm.java @@ -624,7 +624,7 @@ public class ODatabaseForm extends TestCase { params.add(new Byte((byte) 123)) ; params.add(new Short((short) 234)) ; params.add(Integer.valueOf(12345)) ; - params.add(new Long(23456)) ; + params.add(Long.valueOf(23456)) ; params.add(new Float(1.234)) ; params.add(new Double(2.345)) ; params.add(new byte[] {1, 2, 3}) ; diff --git a/ridljar/com/sun/star/uno/UnoRuntime.java b/ridljar/com/sun/star/uno/UnoRuntime.java index 2717dfb4666d..6ea263c5f0fc 100644 --- a/ridljar/com/sun/star/uno/UnoRuntime.java +++ b/ridljar/com/sun/star/uno/UnoRuntime.java @@ -315,7 +315,7 @@ public class UnoRuntime { return Integer.valueOf(0); case TypeClass.HYPER_value: case TypeClass.UNSIGNED_HYPER_value: - return new Long(0L); + return Long.valueOf(0L); case TypeClass.FLOAT_value: return new Float(0.0f); case TypeClass.DOUBLE_value: diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java index ea7f572cc4aa..beba7850dae4 100644 --- a/testtools/com/sun/star/comp/bridge/TestComponent.java +++ b/testtools/com/sun/star/comp/bridge/TestComponent.java @@ -1170,8 +1170,8 @@ public class TestComponent { new Any(Type.UNSIGNED_SHORT, new Short((short) -1)), Integer.valueOf(Integer.MIN_VALUE), new Any(Type.UNSIGNED_LONG, Integer.valueOf(-1)), - new Long(Long.MIN_VALUE), - new Any(Type.UNSIGNED_HYPER, new Long(-1L)), + Long.valueOf(Long.MIN_VALUE), + new Any(Type.UNSIGNED_HYPER, Long.valueOf(-1L)), new Float(0.123f), new Double(0.456), new Character('X'), @@ -1226,7 +1226,7 @@ public class TestComponent { new TestPolyStruct(new Byte(Byte.MIN_VALUE)), new TestPolyStruct(new Short(Short.MIN_VALUE)), new TestPolyStruct(Integer.valueOf(Integer.MIN_VALUE)), - new TestPolyStruct(new Long(Long.MIN_VALUE)), + new TestPolyStruct(Long.valueOf(Long.MIN_VALUE)), new TestPolyStruct(new Character('X')), new TestPolyStruct("test"), new TestPolyStruct(new Float(0.123f)), diff --git a/wizards/com/sun/star/wizards/common/NumericalHelper.java b/wizards/com/sun/star/wizards/common/NumericalHelper.java index 2b998ded224c..0472aea2cca4 100644 --- a/wizards/com/sun/star/wizards/common/NumericalHelper.java +++ b/wizards/com/sun/star/wizards/common/NumericalHelper.java @@ -261,7 +261,7 @@ public class NumericalHelper break; case TypeClass.HYPER_value: aTypeObject.iType = LONG_TYPE; - aTypeObject.aValue = new Long(AnyConverter.toLong(aValue)); + aTypeObject.aValue = Long.valueOf(AnyConverter.toLong(aValue)); break; case TypeClass.FLOAT_value: aTypeObject.iType = FLOAT_TYPE; |