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 /jurt | |
parent | ff0ad0493ee1729c726587f667761b04101d774c (diff) |
java: use 'Long.valueOf' instead of 'new Long'
Change-Id: If4fff3dd37326fbcdd01b743355a16591d71fa69
Diffstat (limited to 'jurt')
4 files changed, 10 insertions, 10 deletions
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) )); |