summaryrefslogtreecommitdiff
path: root/jurt/test
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-12 15:09:06 +0200
committerNoel Grandin <noel@peralex.com>2014-08-19 14:57:17 +0200
commitff0ad0493ee1729c726587f667761b04101d774c (patch)
tree8c0f97e8740fbdb2ed0cdbfc5d99d82cae8f7df6 /jurt/test
parentbe1bb7b1ccee28be616b89cc95e97d656e78bbe3 (diff)
java: use 'Integer.valueOf' instead of 'new Integer'
Change-Id: Ia8befb8d69914ce971174fc5f2ffc0e2f506a940
Diffstat (limited to 'jurt/test')
-rw-r--r--jurt/test/com/sun/star/lib/uno/environments/java/java_environment_Test.java2
-rw-r--r--jurt/test/com/sun/star/lib/uno/protocols/urp/Marshaling_Test.java30
-rw-r--r--jurt/test/com/sun/star/lib/uno/protocols/urp/Protocol_Test.java2
-rw-r--r--jurt/test/com/sun/star/uno/AnyConverter_Test.java8
4 files changed, 21 insertions, 21 deletions
diff --git a/jurt/test/com/sun/star/lib/uno/environments/java/java_environment_Test.java b/jurt/test/com/sun/star/lib/uno/environments/java/java_environment_Test.java
index fc03dc8ca56d..0b343ed4338e 100644
--- a/jurt/test/com/sun/star/lib/uno/environments/java/java_environment_Test.java
+++ b/jurt/test/com/sun/star/lib/uno/environments/java/java_environment_Test.java
@@ -27,7 +27,7 @@ public final class java_environment_Test {
@Test public void test() {
java_environment env = new java_environment(null);
- Object obj = new Integer(3);
+ Object obj = Integer.valueOf(3);
String[] oid = new String[1];
Object obj2 = env.registerInterface(obj, oid,
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 390c775a7a34..73919da886c9 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
@@ -37,7 +37,7 @@ public final class Marshaling_Test {
TestObject testObject = new TestObject();
TestPrimitiveSeqStruct x = new TestPrimitiveSeqStruct();
- x.zAny = new Object[]{new Integer(1), new Double(2) };
+ x.zAny = new Object[]{Integer.valueOf(1), new Double(2) };
Object data[] = new Object[] {
@@ -49,28 +49,28 @@ public final class Marshaling_Test {
new Double(0.12345),
TestEnum.B,
new Float(0.5678),
- new Integer(0),
- new Integer(128),
- new Integer(0x0f00),
- new Integer(0x0f0000),
- new Integer(0x0f000000),
- new Integer(-128),
- new Integer(0xff00),
- new Integer(0xff0000),
- new Integer(0xff000000),
+ Integer.valueOf(0),
+ Integer.valueOf(128),
+ Integer.valueOf(0x0f00),
+ Integer.valueOf(0x0f0000),
+ Integer.valueOf(0x0f000000),
+ Integer.valueOf(-128),
+ Integer.valueOf(0xff00),
+ Integer.valueOf(0xff0000),
+ Integer.valueOf(0xff000000),
new Long(666L),
new Short((short)444),
new String("blabla"),
- new Integer(10), // Any as object
- new Integer(10), // Any as object
- new Any(new Type(Integer.class), new Integer(10)), // Any as Any
- new Any(new Type(Integer.class), new Integer(10)), // Any as Any
+ Integer.valueOf(10), // Any as object
+ Integer.valueOf(10), // Any as object
+ new Any(new Type(Integer.class), Integer.valueOf(10)), // Any as Any
+ new Any(new Type(Integer.class), Integer.valueOf(10)), // Any as Any
null,
new TestPrimitiveStruct(),
x,
new byte[]{1,2,3,4,5,6,7}, // primitive sequence
new int[]{7,6,5,4,3,2,1}, // primitive sequence
- new Object[]{new Integer(123), new String("hallo")}, // any sequence
+ new Object[]{Integer.valueOf(123), new String("hallo")}, // any sequence
new TestPrimitiveStruct[]{new TestPrimitiveStruct(), new TestPrimitiveStruct()}, // sequence of primitive structs
new TestPrimitiveSeqStruct[]{new TestPrimitiveSeqStruct(), new TestPrimitiveSeqStruct()}, // sequence of primitive structs
new TestNestedStruct(),
diff --git a/jurt/test/com/sun/star/lib/uno/protocols/urp/Protocol_Test.java b/jurt/test/com/sun/star/lib/uno/protocols/urp/Protocol_Test.java
index a7ee1e511c6d..1ded133b09b5 100644
--- a/jurt/test/com/sun/star/lib/uno/protocols/urp/Protocol_Test.java
+++ b/jurt/test/com/sun/star/lib/uno/protocols/urp/Protocol_Test.java
@@ -243,7 +243,7 @@ public final class Protocol_Test {
iReceiver.readMessage();
// send a reply
iReceiver.writeReply(
- false, new ThreadId(new byte[] { 0, 1 }), new Integer(501));
+ false, new ThreadId(new byte[] { 0, 1 }), Integer.valueOf(501));
iMessage = iSender.readMessage();
result = iMessage.getResult();
assertEquals(501, result);
diff --git a/jurt/test/com/sun/star/uno/AnyConverter_Test.java b/jurt/test/com/sun/star/uno/AnyConverter_Test.java
index c4c93261d3f8..ce6316578f68 100644
--- a/jurt/test/com/sun/star/uno/AnyConverter_Test.java
+++ b/jurt/test/com/sun/star/uno/AnyConverter_Test.java
@@ -41,7 +41,7 @@ public final class AnyConverter_Test {
Character aChar= new Character('A');
Byte aByte= new Byte((byte) 111);
Short aShort= new Short((short) 11111);
- Integer aInt= new Integer( 1111111);
+ Integer aInt= Integer.valueOf( 1111111);
Long aLong= new Long( 0xffffffff);
Float aFloat= new Float( 3.14);
Double aDouble= new Double( 3.145);
@@ -315,7 +315,7 @@ public final class AnyConverter_Test {
Any a = new Any( Type.UNSIGNED_SHORT, new Short((short)5) );
assertEquals(5, AnyConverter.toInt(a));
assertEquals(5, AnyConverter.toUnsignedInt(a));
- a = new Any( Type.UNSIGNED_LONG, new Integer(5) );
+ a = new Any( Type.UNSIGNED_LONG, Integer.valueOf(5) );
assertEquals(5, AnyConverter.toUnsignedInt(a));
// must fail
@@ -386,7 +386,7 @@ public final class AnyConverter_Test {
Any a = new Any( Type.UNSIGNED_SHORT, new Short((short)5) );
assertEquals(5, AnyConverter.toLong(a));
assertEquals(5, AnyConverter.toUnsignedLong(a));
- a = new Any( Type.UNSIGNED_LONG, new Integer(5) );
+ 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) );
@@ -808,7 +808,7 @@ public final class AnyConverter_Test {
assertTrue(AnyConverter.isInt(aInt));
assertTrue(AnyConverter.isInt(anyInt));
assertEquals(Type.LONG, AnyConverter.getType(anyInt));
- Any a = new Any(Type.UNSIGNED_LONG, new Integer(5));
+ Any a = new Any(Type.UNSIGNED_LONG, Integer.valueOf(5));
assertEquals(Type.UNSIGNED_LONG, AnyConverter.getType(a));
assertFalse(AnyConverter.isInt(a));
assertFalse(Type.LONG.equals(AnyConverter.getType(a)));