openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r813982 - /openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ConcreteClassGenerator.java
Date Fri, 11 Sep 2009 18:53:34 GMT
Author: ppoddar
Date: Fri Sep 11 18:53:34 2009
New Revision: 813982

URL: http://svn.apache.org/viewvc?rev=813982&view=rev
Log:
OPENJPA-1285: Use tighter method signature

Modified:
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ConcreteClassGenerator.java

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ConcreteClassGenerator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ConcreteClassGenerator.java?rev=813982&r1=813981&r2=813982&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ConcreteClassGenerator.java
(original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ConcreteClassGenerator.java
Fri Sep 11 18:53:34 2009
@@ -131,7 +131,6 @@
         } catch (Exception e) {
             throw new ExceptionInInitializerError(e);
         }
-        
     }
     
     /** 
@@ -143,8 +142,7 @@
      *  @param  params     the parameter values
      *  @return            the new instance
      */
-    public static <T> T newInstance(Class<T> c, Class[] paramTypes,
-        Object[] params) {
+    public static <T> T newInstance(Class<T> c, Class<?>[] paramTypes,
Object[] params) {
         try {
             return c.getConstructor(paramTypes).newInstance(params);
         } catch (Exception e) {
@@ -162,7 +160,7 @@
     /** 
      *  @see #newInstance(java.lang.Class,java.lang.Class[],java.lang.Object[])
      */
-    public static <T> T newInstance(Class<T> c, Class paramType, Object param)
{
+    public static <T,P> T newInstance(Class<T> c, Class<? extends P> paramType,
P param) {
         return newInstance(c,
             new Class[] { paramType },
             new Object[] { param });
@@ -171,8 +169,8 @@
     /** 
      *  @see #newInstance(java.lang.Class,java.lang.Class[],java.lang.Object[])
      */
-    public static <T> T newInstance(Class<T> c, Class paramType1, Object param1,
-        Class paramType2, Object param2) {
+    public static <T,P1,P2> T newInstance(Class<T> c, Class<? extends P1>
paramType1, P1 param1,
+        Class<? extends P2> paramType2, P2 param2) {
         return newInstance(c,
             new Class[] { paramType1, paramType2 },
             new Object[] { param1, param2 });
@@ -181,8 +179,8 @@
     /** 
      *  @see #newInstance(java.lang.Class,java.lang.Class[],java.lang.Object[])
      */
-    public static <T> T newInstance(Class<T> c, Class paramType1, Object param1,
-        Class paramType2, Object param2, Class paramType3, Object param3) {
+    public static <T,P1,P2,P3> T newInstance(Class<T> c, Class<? extends P1>
paramType1, P1 param1,
+        Class<? extends P2> paramType2, P2 param2, Class<? extends P3> paramType3,
P3 param3) {
         return newInstance(c,
             new Class[] { paramType1, paramType2, paramType3 },
             new Object[] { param1, param2, param3 });
@@ -191,9 +189,9 @@
     /** 
      *  @see #newInstance(java.lang.Class,java.lang.Class[],java.lang.Object[])
      */
-    public static <T> T newInstance(Class<T> c, Class paramType1, Object param1,
-        Class paramType2, Object param2, Class paramType3, Object param3,
-        Class paramType4, Object param4) {
+    public static <T,P1,P2,P3,P4> T newInstance(Class<T> c, Class<? extends
P1> paramType1, P1 param1,
+        Class<? extends P2> paramType2, P2 param2, Class<? extends P3> paramType3,
P3 param3,
+        Class<? extends P4> paramType4, P4 param4) {
         return newInstance(c,
             new Class[] { paramType1, paramType2, paramType3, paramType4 },
             new Object[] { param1, param2, param3, param4 });



Mime
View raw message