summaryrefslogtreecommitdiff
path: root/javaunohelper
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-08-12 15:10:41 +0200
committerNoel Grandin <noel@peralex.com>2014-08-19 14:57:17 +0200
commit8a2c6c29af41cd7a62f37861fb0d4e81a857bb45 (patch)
tree87575bd76a2ce98793d2bb1773ddc4a9c4e5e41c /javaunohelper
parentff0ad0493ee1729c726587f667761b04101d774c (diff)
java: use 'Long.valueOf' instead of 'new Long'
Change-Id: If4fff3dd37326fbcdd01b743355a16591d71fa69
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 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);