db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1437968 - /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java
Date Thu, 24 Jan 2013 11:54:14 GMT
Author: tv
Date: Thu Jan 24 11:54:14 2013
New Revision: 1437968

URL: http://svn.apache.org/viewvc?rev=1437968&view=rev
Log:
The cast is necessary to work around bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302954
in JDK 5.0

This version compiles with jdk 1.5.0_22. Tests pass.

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java?rev=1437968&r1=1437967&r2=1437968&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java (original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/Torque.java Thu
Jan 24 11:54:14 2013
@@ -192,9 +192,15 @@ public final class Torque
      *
      * @return The requested Manager.
      */
-    public static <T extends AbstractBaseManager<? extends Persistent>> T getManager(String
name)
+    @SuppressWarnings("unchecked")
+	public static <T extends AbstractBaseManager<? extends Persistent>> T getManager(String
name)
     {
-        return getInstance().getManager(name);
+        /*
+         *  The cast is necessary to work around bug
+         *  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302954
+         *  in JDK 5.0
+         */
+        return (T)getInstance().getManager(name);
     }
 
     /**
@@ -206,11 +212,17 @@ public final class Torque
      *
      * @return a Manager
      */
+    @SuppressWarnings("unchecked")
     public static <T extends AbstractBaseManager<? extends Persistent>> T getManager(
             String name,
             String defaultClassName)
     {
-        return getInstance().getManager(name, defaultClassName);
+        /*
+         *  The cast is necessary to work around bug
+         *  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302954
+         *  in JDK 5.0
+         */
+        return (T)getInstance().getManager(name, defaultClassName);
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message