summaryrefslogtreecommitdiff
path: root/javaunohelper
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-12 15:12:27 +0200
committerNoel Grandin <noel@peralex.com>2014-08-19 14:57:18 +0200
commit0764292c5dcb7daa62e9adeb1ac9af1dbe14066f (patch)
tree17a4e9f2393d23aaba1e68bbc944aa8e18b9e2f6 /javaunohelper
parent8a2c6c29af41cd7a62f37861fb0d4e81a857bb45 (diff)
java: use 'Short.valueOf' instead of 'new Short'
Change-Id: Icef19ef61ee0af2dd3bda527263934006271f219
Diffstat (limited to 'javaunohelper')
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java4
-rw-r--r--javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java20
2 files changed, 12 insertions, 12 deletions
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
index bf7a69f45758..118738c7c1d7 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
@@ -737,7 +737,7 @@ XMultiPropertySet
else if (cl.equals(byte.class))
retVal= new Byte(AnyConverter.toByte(obj));
else if (cl.equals(short.class))
- retVal= new Short(AnyConverter.toShort(obj));
+ retVal= Short.valueOf(AnyConverter.toShort(obj));
else if (cl.equals(int.class))
retVal= Integer.valueOf(AnyConverter.toInt(obj));
else if (cl.equals(long.class))
@@ -759,7 +759,7 @@ XMultiPropertySet
else if (cl.equals(Byte.class))
retVal= new Byte(AnyConverter.toByte(obj));
else if (cl.equals(Short.class))
- retVal= new Short(AnyConverter.toShort(obj));
+ retVal= Short.valueOf(AnyConverter.toShort(obj));
else if (cl.equals(Integer.class))
retVal= Integer.valueOf(AnyConverter.toInt(obj));
else if (cl.equals(Long.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 fb173ba58cd1..fbe595fe7cc8 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
@@ -109,7 +109,7 @@ public class PropertySet_Test
cl.setPropertyValue("PropByteA",value);
ret= cl.getPropertyValue("PropByteA");
r[i++]= ((Byte) ret).equals(value);
- value= new Short((short)112);
+ value= Short.valueOf((short)112);
cl.setPropertyValue("PropShortA", value);
ret= cl.getPropertyValue("PropShortA");
r[i++]= ((Short) ret).equals(value);
@@ -184,7 +184,7 @@ public class PropertySet_Test
cl.setPropertyValue("PropObjectA",value);
ret= cl.getPropertyValue("PropObjectA");
r[i++]= ((Byte) ret).equals(value);
- value= new Short((short)112);
+ value= Short.valueOf((short)112);
cl.setPropertyValue("PropObjectA", value);
ret= cl.getPropertyValue("PropObjectA");
r[i++]= ((Short) ret).equals(value);
@@ -241,7 +241,7 @@ public class PropertySet_Test
cl.setPropertyValue("PropAnyA",value);
ret= cl.getPropertyValue("PropAnyA");
r[i++]= ret instanceof Any && util.anyEquals(value, ret);
- value= new Short((short)112);
+ value= Short.valueOf((short)112);
cl.setPropertyValue("PropAnyA", value);
ret= cl.getPropertyValue("PropAnyA");
r[i++]= ret instanceof Any && util.anyEquals(value, ret);
@@ -295,7 +295,7 @@ public class PropertySet_Test
cl.setPropertyValue("PropByteA",value);
ret= cl.getPropertyValue("PropByteA");
r[i++]= ret instanceof Byte && util.anyEquals(value, ret);
- value= new Any(new Type(short.class), new Short((short)112));
+ value= new Any(new Type(short.class), Short.valueOf((short)112));
cl.setPropertyValue("PropShortA", value);
ret= cl.getPropertyValue("PropShortA");
r[i++]= ret instanceof Short && util.anyEquals(value, ret);
@@ -350,7 +350,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(short.class), new Short((short)112));
+ value= new Any(new Type(short.class), Short.valueOf((short)112));
cl.setPropertyValue("PropAnyA", value);
ret= cl.getPropertyValue("PropAnyA");
r[i++]= ret instanceof Any && util.anyEquals(value, ret);
@@ -406,7 +406,7 @@ public class PropertySet_Test
cl.setPropertyValue("PropByteClass",value);
ret= cl.getPropertyValue("PropByteClass");
r[i++]= ((Byte) ret).equals(value);
- value= new Short((short)112);
+ value= Short.valueOf((short)112);
cl.setPropertyValue("PropShortClass", value);
ret= cl.getPropertyValue("PropShortClass");
r[i++]= ((Short) ret).equals(value);
@@ -442,7 +442,7 @@ public class PropertySet_Test
cl.setPropertyValue("PropByteClass",value);
ret= cl.getPropertyValue("PropByteClass");
r[i++]= ret instanceof Byte && util.anyEquals(value, ret);
- value= new Any(new Type(short.class), new Short((short)112));
+ value= new Any(new Type(short.class), Short.valueOf((short)112));
cl.setPropertyValue("PropShortClass", value);
ret= cl.getPropertyValue("PropShortClass");
r[i++]= ret instanceof Short && util.anyEquals(value, ret);
@@ -1213,7 +1213,7 @@ class TestClass extends PropertySet
value= new Byte((byte) 111);
r[i++]= convertPropertyValue(propByteA, outNewVal, outOldVal, value);
r[i++]= outNewVal[0] instanceof Byte && outNewVal[0].equals(value);
- value= new Short((short) 112);
+ value= Short.valueOf((short) 112);
r[i++]= convertPropertyValue(propShortA, outNewVal, outOldVal, value);
r[i++]= outNewVal[0] instanceof Short && outNewVal[0].equals(value);
value= Integer.valueOf( 113);
@@ -1324,7 +1324,7 @@ class TestClass extends PropertySet
value= new Byte((byte) 111);
r[i++]= convertPropertyValue(propByteClass, outNewVal, outOldVal, value);
r[i++]= outNewVal[0] instanceof Byte && outNewVal[0].equals(value);
- value= new Short((short) 112);
+ value= Short.valueOf((short) 112);
r[i++]= convertPropertyValue(propShortClass, outNewVal, outOldVal, value);
r[i++]= outNewVal[0] instanceof Short && outNewVal[0].equals(value);
value= Integer.valueOf( 113);
@@ -1365,7 +1365,7 @@ class TestClass extends PropertySet
value= new Byte((byte) 111);
setPropertyValueNoBroadcast(propByteA, value);
r[i++]= bytePropA == ((Byte)value).byteValue();
- value= new Short((short) 112);
+ value= Short.valueOf((short) 112);
setPropertyValueNoBroadcast(propShortA, value);
r[i++]= shortPropA == ((Short) value).shortValue();
value= Integer.valueOf( 113);