[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 4 commits - bean/com bridges/source filter/source javaunohelper/com jurt/com l10ntools/java

Damjan Jovanovic damjan at apache.org
Sat Mar 25 16:08:15 UTC 2017


 bean/com/sun/star/beans/JavaWindowPeerFake.java                              |    2 
 bean/com/sun/star/beans/LocalOfficeWindow.java                               |    4 -
 bean/com/sun/star/comp/beans/LocalOfficeWindow.java                          |    8 +-
 bean/com/sun/star/comp/beans/OOoBean.java                                    |    4 -
 bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java      |    6 -
 filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java    |    2 
 javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java                   |   38 +++++-----
 javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java              |    6 -
 javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java                        |    2 
 jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java              |    2 
 jurt/com/sun/star/lib/uno/protocols/urp/Unmarshal.java                       |   14 +--
 jurt/com/sun/star/lib/uno/protocols/urp/urp.java                             |   10 +-
 jurt/com/sun/star/uno/AnyConverter.java                                      |   30 +++----
 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java   |    4 -
 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java |    4 -
 15 files changed, 68 insertions(+), 68 deletions(-)

New commits:
commit 15325f02503e3e47201a21fc9da3881fde3fab3f
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Sat Mar 25 15:10:09 2017 +0000

    Java boxing optimization and cleanups for l10ntools.
    
    Patch by: me

diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java
index 94ee4ad03ee2..07ac35aa02fb 100644
--- a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java
@@ -618,11 +618,11 @@ public class SDFReader extends DataReader {
         for (int i = 0; i < line.length(); i++) {
             c = line.charAt(i);
             if (c < 30 && c != 9) {
-                return (new Character(c)).toString();
+                return Character.toString(c);
             }
 
         }
         return line;
 
     }
-}
\ No newline at end of file
+}
diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java
index ad9bac6b4b4d..7e9d6a54b92a 100644
--- a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java
@@ -449,9 +449,9 @@ public class XLIFFReader extends DefaultHandler {
                 //TODO arraycopy might not be nessessary
                 System.arraycopy((String[]) DataStore.get(id), 0, data, 0,
                         data.length);
-                int help = (new Integer(data[FOUND_PARTS_COUNTER_IDX])).intValue(); //found one more part
+                int help = (Integer.valueOf(data[FOUND_PARTS_COUNTER_IDX])).intValue(); //found one more part
                 help++; // refresh the actual found parts
-                data[FOUND_PARTS_COUNTER_IDX] = (new Integer(help)).toString(); // belonging to this information
+                data[FOUND_PARTS_COUNTER_IDX] = Integer.toString(help); // belonging to this information
 
                 DataStore.remove(attrs.getValue("id")); // TODO this can be deleted?
             } else {
commit 862d03382236c006ccf21e710cbcb8f65eaf4317
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Sat Mar 25 15:07:15 2017 +0000

    Use more efficient Java boxing in main/filter.
    
    Patch by: me

diff --git a/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java b/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java
index d9f25568e252..22dbb3d743a3 100644
--- a/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java
+++ b/filter/source/xsltfilter/com/sun/star/comp/xsltfilter/XSLTransformer.java
@@ -293,7 +293,7 @@ public class XSLTransformer
                             debug("TransformerFactory is '" + tfactory.getClass().getName() + "'");
                 // some external saxons (Debian, Ubuntu, ...) have this disabled
                 // per default
-                tfactory.setAttribute(FeatureKeys.ALLOW_EXTERNAL_FUNCTIONS, new Boolean(true));
+                tfactory.setAttribute(FeatureKeys.ALLOW_EXTERNAL_FUNCTIONS, true);
                             xsltTemplate = tfactory.newTemplates(new StreamSource(stylesheeturl));
 
                             // store the transformation into the cache
commit 13abe86bb10ee68c302e9b27dba4a438a6c98168
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Sat Mar 25 15:04:26 2017 +0000

    Use more efficient Java boxing for basic types in main/bean.
    
    Patch by: me

diff --git a/bean/com/sun/star/beans/JavaWindowPeerFake.java b/bean/com/sun/star/beans/JavaWindowPeerFake.java
index 103294383b46..df8f05947c45 100644
--- a/bean/com/sun/star/beans/JavaWindowPeerFake.java
+++ b/bean/com/sun/star/beans/JavaWindowPeerFake.java
@@ -53,7 +53,7 @@ import com.sun.star.awt.*;
     {
 
         if (SystemType == localSystemType) {
-            return new Integer((int)hWindow);
+            return (int)hWindow;
         }
         else return null;
     }
diff --git a/bean/com/sun/star/beans/LocalOfficeWindow.java b/bean/com/sun/star/beans/LocalOfficeWindow.java
index c6e8314258e9..260d3fa2fc27 100644
--- a/bean/com/sun/star/beans/LocalOfficeWindow.java
+++ b/bean/com/sun/star/beans/LocalOfficeWindow.java
@@ -131,7 +131,7 @@ public class LocalOfficeWindow
             // set real parent
             XVclWindowPeer xVclWindowPeer = (XVclWindowPeer)UnoRuntime.queryInterface(
                                XVclWindowPeer.class, mWindow);
-            xVclWindowPeer.setProperty( "PluginParent", new Long(getNativeWindow()) );
+            xVclWindowPeer.setProperty( "PluginParent", getNativeWindow() );
             bPeer = true;
 
                    // show document window
@@ -152,7 +152,7 @@ public class LocalOfficeWindow
             // set null parent
             XVclWindowPeer xVclWindowPeer = (XVclWindowPeer)UnoRuntime.queryInterface(
                                XVclWindowPeer.class, mWindow);
-            xVclWindowPeer.setProperty( "PluginParent", new Long(0) );
+            xVclWindowPeer.setProperty( "PluginParent", 0L );
             bPeer = false;
         }
     }
diff --git a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
index c7be5fe4cdb9..f41ce11782a9 100644
--- a/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
+++ b/bean/com/sun/star/comp/beans/LocalOfficeWindow.java
@@ -156,7 +156,7 @@ public class LocalOfficeWindow
             // set null parent
             XVclWindowPeer xVclWindowPeer = (XVclWindowPeer)UnoRuntime.queryInterface(
                                XVclWindowPeer.class, mWindow);
-            xVclWindowPeer.setProperty( "PluginParent", new Long(0) );
+            xVclWindowPeer.setProperty( "PluginParent", 0L );
             bPeer = false;
         }
     }
@@ -261,9 +261,9 @@ public class LocalOfficeWindow
     {
 
         NamedValue window = new NamedValue(
-            "WINDOW", new Any(new Type(Long.class), new Long(getNativeWindow())));
+            "WINDOW", new Any(new Type(Long.class), getNativeWindow()));
         NamedValue xembed = new NamedValue(
-            "XEMBED", new Any(new Type(Boolean.class), new Boolean(false)));
+            "XEMBED", new Any(new Type(Boolean.class), false));
 
         if (getNativeWindowSystemType() == SystemDependent.SYSTEM_XWINDOW )
         {
@@ -273,7 +273,7 @@ public class LocalOfficeWindow
             {
                 xembed = new NamedValue(
                     "XEMBED",
-                    new Any(new Type(Boolean.class), new Boolean(true)));
+                    new Any(new Type(Boolean.class), true));
             }
         }
         return new Any(
diff --git a/bean/com/sun/star/comp/beans/OOoBean.java b/bean/com/sun/star/comp/beans/OOoBean.java
index 47b3a87655e0..d75b99203793 100644
--- a/bean/com/sun/star/comp/beans/OOoBean.java
+++ b/bean/com/sun/star/comp/beans/OOoBean.java
@@ -650,7 +650,7 @@ public class OOoBean
                     com.sun.star.beans.PropertyValue aArgs[] =
                         addArgument( aArguments, new com.sun.star.beans.PropertyValue(
                             "MacroExecutionMode", -1,
-                            new Short( com.sun.star.document.MacroExecMode.USE_CONFIG ),
+                            com.sun.star.document.MacroExecMode.USE_CONFIG,
                             com.sun.star.beans.PropertyState.DIRECT_VALUE ) );
                                     //String fn = aFRame.getName();
 
@@ -1114,7 +1114,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
                 }
 
                 // notify change
-                firePropertyChange( aProperty, new Boolean(bOldValue), new Boolean(bNewValue) );
+                firePropertyChange( aProperty, bOldValue, bNewValue );
            }
         }
 
commit dfc1786af2d6249558cc91d84a82a7a2772abb12
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Sat Mar 25 14:14:44 2017 +0000

    Add some Java performance optimizations with boxing of basic types:
    
    instead of using "new <Type>(<value>)", use <Type>.valueOf(<value>),
    or better yet, rely on autoboxing.
    
    Since the box objects are immutable, Java can and does cache them for
    values between -128 and 127, which includes all possible boolean and byte
    values and many common values for all other basic types. Thus, unlike the
    constructor, calling valueOf() or autoboxing such values does not allocate
    memory at all, and only returns the pre-existing instance, which is not only
    faster, but uses zero extra memory too.
    
    This is the first of many patches. This one fixes this problem in bridges,
    javaunohelper and jurt, which are parts of the Java<->Uno bridge, which is
    critical to performance.
    
    Patch by: me

diff --git a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java
index 5f4dab4258c4..cec69a0b0a3c 100644
--- a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java
+++ b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java
@@ -150,7 +150,7 @@ public final class JNI_proxy implements java.lang.reflect.InvocationHandler
             if (method_name.equals( "hashCode" ))
             {
                 // int hashCode()
-                return new Integer( m_oid.hashCode() );
+                return Integer.valueOf( m_oid.hashCode() );
             }
             else if (method_name.equals( "equals" ))
             {
@@ -208,7 +208,7 @@ public final class JNI_proxy implements java.lang.reflect.InvocationHandler
     }
 
     private Boolean isSame(Object obj) {
-        return new Boolean(obj != null
-                           && m_oid.equals(UnoRuntime.generateOid(obj)));
+        return obj != null
+                           && m_oid.equals(UnoRuntime.generateOid(obj));
     }
 }
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
index f3e63be1e0b3..eefef8cc9e64 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java
@@ -221,7 +221,7 @@ XMultiPropertySet
      */
     protected Property getPropertyByHandle(int nHandle)
     {
-        return (Property) _handleToPropertyMap.get(new Integer(nHandle));
+        return (Property) _handleToPropertyMap.get(nHandle);
     }
 
     /** Returns an array of all Property objects or an array of length null if there
@@ -251,7 +251,7 @@ XMultiPropertySet
     {
         _nameToPropertyMap.put(prop.Name, prop);
         if (prop.Handle != -1)
-            _handleToPropertyMap.put(new Integer(prop.Handle), prop);
+            _handleToPropertyMap.put(prop.Handle, prop);
     }
 
     /** Assigns an identifyer object to a Property object so that the identifyer
@@ -577,7 +577,7 @@ XMultiPropertySet
      *  value of the property is to be stored in a member variable of type int with name intProp. Then setPropertyValue is
      *  called:
      *  <pre>
-     *  set.setPropertyValue( "PropA", new Byte( (byte)111));
+     *  set.setPropertyValue( "PropA", (byte)111);
      *  </pre>
      *  At some point setPropertyValue will call convertPropertyValue and pass in the Byte object. Since we allow
      *  that Byte values can be used with the property and know that the value is to be stored in intProp (type int)
@@ -732,21 +732,21 @@ XMultiPropertySet
             retVal= obj;
         }
         else if(cl.equals(boolean.class))
-            retVal= new Boolean(AnyConverter.toBoolean(obj));
+            retVal= AnyConverter.toBoolean(obj);
         else if (cl.equals(char.class))
-            retVal= new Character(AnyConverter.toChar(obj));
+            retVal= AnyConverter.toChar(obj);
         else if (cl.equals(byte.class))
-            retVal= new Byte(AnyConverter.toByte(obj));
+            retVal= AnyConverter.toByte(obj);
         else if (cl.equals(short.class))
-            retVal= new Short(AnyConverter.toShort(obj));
+            retVal= AnyConverter.toShort(obj);
         else if (cl.equals(int.class))
-            retVal= new Integer(AnyConverter.toInt(obj));
+            retVal= AnyConverter.toInt(obj);
         else if (cl.equals(long.class))
-            retVal= new Long(AnyConverter.toLong(obj));
+            retVal= AnyConverter.toLong(obj);
         else if (cl.equals(float.class))
-            retVal= new Float(AnyConverter.toFloat(obj));
+            retVal= AnyConverter.toFloat(obj);
         else if (cl.equals(double.class))
-            retVal= new Double(AnyConverter.toDouble(obj));
+            retVal= AnyConverter.toDouble(obj);
         else if (cl.equals(String.class))
             retVal= AnyConverter.toString(obj);
         else if (cl.isArray())
@@ -754,21 +754,21 @@ XMultiPropertySet
         else if (cl.equals(Type.class))
             retVal= AnyConverter.toType(obj);
         else if (cl.equals(Boolean.class))
-            retVal= new Boolean(AnyConverter.toBoolean(obj));
+            retVal= AnyConverter.toBoolean(obj);
         else if (cl.equals(Character.class))
-            retVal= new Character(AnyConverter.toChar(obj));
+            retVal= AnyConverter.toChar(obj);
         else if (cl.equals(Byte.class))
-            retVal= new Byte(AnyConverter.toByte(obj));
+            retVal= AnyConverter.toByte(obj);
         else if (cl.equals(Short.class))
-            retVal= new Short(AnyConverter.toShort(obj));
+            retVal= AnyConverter.toShort(obj);
         else if (cl.equals(Integer.class))
-            retVal= new Integer(AnyConverter.toInt(obj));
+            retVal= AnyConverter.toInt(obj);
         else if (cl.equals(Long.class))
-            retVal= new Long(AnyConverter.toLong(obj));
+            retVal= AnyConverter.toLong(obj);
         else if (cl.equals(Float.class))
-            retVal= new Float(AnyConverter.toFloat(obj));
+            retVal= AnyConverter.toFloat(obj);
         else if (cl.equals(Double.class))
-            retVal= new Double(AnyConverter.toDouble(obj));
+            retVal= AnyConverter.toDouble(obj);
         else if (XInterface.class.isAssignableFrom(cl))
             retVal= AnyConverter.toObject(new Type(cl), obj);
         else if (com.sun.star.uno.Enum.class.isAssignableFrom(cl))
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java
index 008b05efdda5..b182dbd139f7 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java
@@ -931,7 +931,7 @@ public final class PropertySetMixin {
                         isDefaulted, wrapOptional));
                 UnoRuntime.queryInterface(
                     XIdlField2.class, type.getField("IsAmbiguous")).set(
-                        strct, new Boolean(isAmbiguous));
+                        strct, isAmbiguous);
             } catch (com.sun.star.lang.IllegalArgumentException e) {
                 throw new RuntimeException(
                     "unexpected com.sun.star.lang.IllegalArgumentException: "
@@ -958,7 +958,7 @@ public final class PropertySetMixin {
                         false, false, wrapOptional));
                 UnoRuntime.queryInterface(
                     XIdlField2.class, type.getField("IsDefaulted")).set(
-                        strct, new Boolean(isDefaulted));
+                        strct, isDefaulted);
             } catch (com.sun.star.lang.IllegalArgumentException e) {
                 throw new RuntimeException(
                     "unexpected com.sun.star.lang.IllegalArgumentException: "
@@ -978,7 +978,7 @@ public final class PropertySetMixin {
             try {
                 UnoRuntime.queryInterface(
                     XIdlField2.class, type.getField("IsPresent")).set(
-                        strct, new Boolean(present));
+                        strct, present);
                 if (present) {
                     XIdlField2 field = UnoRuntime.queryInterface(
                         XIdlField2.class, type.getField("Value"));
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java b/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java
index c3a0de4068b5..8c6e63626d25 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/UnoUrl.java
@@ -236,7 +236,7 @@ public class UnoUrl {
                 ch = (hb << 4) | lb;
             }
 
-            v.addElement(new Integer(ch));
+            v.addElement(ch);
         }
 
         int size = v.size();
diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java
index ffb94245e799..db2281dfb796 100644
--- a/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java
+++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java
@@ -112,7 +112,7 @@ final class ProxyFactory {
                 return Boolean.valueOf(args[0] != null
                         && oid.equals(UnoRuntime.generateOid(args[0])));
             } else if (method.equals(METHOD_HASH_CODE)) {
-                return new Integer(oid.hashCode());
+                return Integer.valueOf(oid.hashCode());
             } else if (method.equals(METHOD_TO_STRING)) {
                 return "[Proxy:" + System.identityHashCode(proxy) + "," + oid
                     + "," + type + "]";
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 a8fb69b0054d..02e8d69cfc40 100644
--- a/jurt/com/sun/star/lib/uno/protocols/urp/Unmarshal.java
+++ b/jurt/com/sun/star/lib/uno/protocols/urp/Unmarshal.java
@@ -215,7 +215,7 @@ final class Unmarshal {
 
     private Byte readByteValue() {
         try {
-            return new Byte(input.readByte());
+            return input.readByte();
         } catch (IOException e) {
             throw new RuntimeException(e.toString());
         }
@@ -223,7 +223,7 @@ final class Unmarshal {
 
     private Short readShortValue() {
         try {
-            return new Short(input.readShort());
+            return input.readShort();
         } catch (IOException e) {
             throw new RuntimeException(e.toString());
         }
@@ -231,7 +231,7 @@ final class Unmarshal {
 
     private Integer readLongValue() {
         try {
-            return new Integer(input.readInt());
+            return input.readInt();
         } catch (IOException e) {
             throw new RuntimeException(e.toString());
         }
@@ -239,7 +239,7 @@ final class Unmarshal {
 
     private Long readHyperValue() {
         try {
-            return new Long(input.readLong());
+            return input.readLong();
         } catch (IOException e) {
             throw new RuntimeException(e.toString());
         }
@@ -247,7 +247,7 @@ final class Unmarshal {
 
     private Float readFloatValue() {
         try {
-            return new Float(input.readFloat());
+            return input.readFloat();
         } catch (IOException e) {
             throw new RuntimeException(e.toString());
         }
@@ -255,7 +255,7 @@ final class Unmarshal {
 
     private Double readDoubleValue() {
         try {
-            return new Double(input.readDouble());
+            return input.readDouble();
         } catch (IOException e) {
             throw new RuntimeException(e.toString());
         }
@@ -263,7 +263,7 @@ final class Unmarshal {
 
     private Character readCharValue() {
         try {
-            return new Character(input.readChar());
+            return input.readChar();
         } catch (IOException e) {
             throw new RuntimeException(e.toString());
         }
diff --git a/jurt/com/sun/star/lib/uno/protocols/urp/urp.java b/jurt/com/sun/star/lib/uno/protocols/urp/urp.java
index 0368985a6356..ad347717e994 100644
--- a/jurt/com/sun/star/lib/uno/protocols/urp/urp.java
+++ b/jurt/com/sun/star/lib/uno/protocols/urp/urp.java
@@ -193,7 +193,7 @@ public final class urp implements IProtocol {
             true, PROPERTIES_OID,
             TypeDescription.getTypeDescription(XProtocolProperties.class),
             PROPERTIES_FUN_REQUEST_CHANGE, propertiesTid,
-            new Object[] { new Integer(random) });
+            new Object[] { random });
         state = STATE_REQUESTED;
     }
 
@@ -214,7 +214,7 @@ public final class urp implements IProtocol {
                     case STATE_INITIAL0:
                     case STATE_INITIAL:
                         writeReply(
-                            false, message.getThreadId(), new Integer(1));
+                            false, message.getThreadId(), 1);
                         state = STATE_WAIT;
                         break;
                     case STATE_REQUESTED:
@@ -222,16 +222,16 @@ public final class urp implements IProtocol {
                             = ((Integer) message.getArguments()[0]).intValue();
                         if (random < n) {
                             writeReply(
-                                false, message.getThreadId(), new Integer(1));
+                                false, message.getThreadId(), 1);
                             state = STATE_WAIT;
                         } else if (random == n) {
                             writeReply(
-                                false, message.getThreadId(), new Integer(-1));
+                                false, message.getThreadId(), -1);
                             state = STATE_INITIAL;
                             sendRequestChange();
                         } else {
                             writeReply(
-                                false, message.getThreadId(), new Integer(0));
+                                false, message.getThreadId(), 0);
                         }
                         break;
                     default:
diff --git a/jurt/com/sun/star/uno/AnyConverter.java b/jurt/com/sun/star/uno/AnyConverter.java
index bb66c6c39e35..5804935b57c1 100644
--- a/jurt/com/sun/star/uno/AnyConverter.java
+++ b/jurt/com/sun/star/uno/AnyConverter.java
@@ -433,7 +433,7 @@ public class AnyConverter
                 switch (tc)
                 {
                 case TypeClass.BYTE_value:
-                    return new Short( ((Byte)object).byteValue() );
+                    return Short.valueOf( ((Byte)object).byteValue() );
                 case TypeClass.SHORT_value:
                     return object;
                 }
@@ -449,10 +449,10 @@ public class AnyConverter
                 switch (tc)
                 {
                 case TypeClass.BYTE_value:
-                    return new Integer( ((Byte)object).byteValue() );
+                    return Integer.valueOf( ((Byte)object).byteValue() );
                 case TypeClass.SHORT_value:
                 case TypeClass.UNSIGNED_SHORT_value:
-                    return new Integer( ((Short)object).shortValue() );
+                    return Integer.valueOf( ((Short)object).shortValue() );
                 case TypeClass.LONG_value:
                     return object;
                 }
@@ -461,7 +461,7 @@ public class AnyConverter
                 switch (tc)
                 {
                 case TypeClass.UNSIGNED_SHORT_value:
-                    return new Integer( ((Short)object).shortValue() );
+                    return Integer.valueOf( ((Short)object).shortValue() );
                 case TypeClass.UNSIGNED_LONG_value:
                     return object;
                 }
@@ -470,13 +470,13 @@ public class AnyConverter
                 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;
                 }
@@ -485,9 +485,9 @@ public class AnyConverter
                 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;
                 }
@@ -496,9 +496,9 @@ public class AnyConverter
                 switch (tc)
                 {
                 case TypeClass.BYTE_value:
-                    return new Float( ((Byte)object).byteValue() );
+                    return Float.valueOf( ((Byte)object).byteValue() );
                 case TypeClass.SHORT_value:
-                    return new Float( ((Short)object).shortValue() );
+                    return Float.valueOf( ((Short)object).shortValue() );
                 case TypeClass.FLOAT_value:
                     return object;
                 }
@@ -507,13 +507,13 @@ public class AnyConverter
                 switch (tc)
                 {
                 case TypeClass.BYTE_value:
-                    return new Double( ((Byte)object).byteValue() );
+                    return Double.valueOf( ((Byte)object).byteValue() );
                 case TypeClass.SHORT_value:
-                    return new Double( ((Short)object).shortValue() );
+                    return Double.valueOf( ((Short)object).shortValue() );
                 case TypeClass.LONG_value:
-                    return new Double( ((Integer)object).intValue() );
+                    return Double.valueOf( ((Integer)object).intValue() );
                 case TypeClass.FLOAT_value:
-                    return new Double( ((Float)object).floatValue() );
+                    return Double.valueOf( ((Float)object).floatValue() );
                 case TypeClass.DOUBLE_value:
                     return object;
                 }


More information about the Libreoffice-commits mailing list