You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by da...@apache.org on 2017/07/14 17:58:57 UTC

svn commit: r1801975 - /openoffice/trunk/main/jurt/com/sun/star/uno/AnyConverter.java

Author: damjan
Date: Fri Jul 14 17:58:56 2017
New Revision: 1801975

URL: http://svn.apache.org/viewvc?rev=1801975&view=rev
Log:
Update AnyConverter.toObject() to use Java 1.5+'s generics.

Patch by: me


Modified:
    openoffice/trunk/main/jurt/com/sun/star/uno/AnyConverter.java

Modified: openoffice/trunk/main/jurt/com/sun/star/uno/AnyConverter.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/jurt/com/sun/star/uno/AnyConverter.java?rev=1801975&r1=1801974&r2=1801975&view=diff
==============================================================================
--- openoffice/trunk/main/jurt/com/sun/star/uno/AnyConverter.java (original)
+++ openoffice/trunk/main/jurt/com/sun/star/uno/AnyConverter.java Fri Jul 14 17:58:56 2017
@@ -357,10 +357,11 @@ public class AnyConverter
      *  @throws com.sun.star.lang.IllegalArgumentException
      *          in case conversion is not possible
      */
-	static public Object toObject(Class clazz, Object object)
+    @SuppressWarnings("unchecked")
+	static public <T> T toObject(Class<T> clazz, Object object)
 		throws com.sun.star.lang.IllegalArgumentException
     {
-        return toObject( new Type( clazz ), object );
+        return (T) toObject( new Type( clazz ), object );
 	}
     
     /** converts an array or an any containing an array into an array.