svn commit: r672804 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilGenerics.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r672804 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilGenerics.java

doogie-3
Author: doogie
Date: Mon Jun 30 09:05:01 2008
New Revision: 672804

URL: http://svn.apache.org/viewvc?rev=672804&view=rev
Log:
Add another helper method to hide generics warnings.

Modified:
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilGenerics.java

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilGenerics.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilGenerics.java?rev=672804&r1=672803&r2=672804&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilGenerics.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilGenerics.java Mon Jun 30 09:05:01 2008
@@ -29,6 +29,11 @@
 
     public static final String module = UtilMisc.class.getName();
 
+    @SuppressWarnings("unchecked")
+    public static <V> V cast(Object object) {
+        return (V) object;
+    }
+
     private static <C extends Collection<?>> C checkCollectionCast(Object object, Class<C> clz) {
         return clz.cast(object);
     }