cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johnth...@apache.org
Subject svn commit: r1509273 - in /cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne: BaseContext.java ObjectContext.java
Date Thu, 01 Aug 2013 15:03:27 GMT
Author: johnthuss
Date: Thu Aug  1 15:03:27 2013
New Revision: 1509273

URL: http://svn.apache.org/r1509273
Log:
Add type bounds to ObjectContext.localObject

Modified:
    cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/BaseContext.java
    cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/ObjectContext.java

Modified: cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/BaseContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/BaseContext.java?rev=1509273&r1=1509272&r2=1509273&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/BaseContext.java
(original)
+++ cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/BaseContext.java
Thu Aug  1 15:03:27 2013
@@ -238,13 +238,13 @@ public abstract class BaseContext implem
      * @since 3.1
      */
     @Override
-    public <T> T localObject(T objectFromAnotherContext) {
+    public <T extends Persistent> T localObject(T objectFromAnotherContext) {
 
         if (objectFromAnotherContext == null) {
             throw new NullPointerException("Null object argument");
         }
 
-        ObjectId id = ((Persistent) objectFromAnotherContext).getObjectId();
+        ObjectId id = objectFromAnotherContext.getObjectId();
 
         // first look for the ID in the local GraphManager
         T localObject = (T) getGraphManager().getNode(id);

Modified: cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/ObjectContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/ObjectContext.java?rev=1509273&r1=1509272&r2=1509273&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/ObjectContext.java
(original)
+++ cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/ObjectContext.java
Thu Aug  1 15:03:27 2013
@@ -77,7 +77,7 @@ public interface ObjectContext extends S
      * 
      * @since 3.1
      */
-    <T> T localObject(T objectFromAnotherContext);
+    <T extends Persistent> T localObject(T objectFromAnotherContext);
 
     /**
      * Creates a new persistent object of a given class scheduled to be inserted



Mime
View raw message