sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r604844 - /incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
Date Mon, 17 Dec 2007 11:49:33 GMT
Author: fmeschbe
Date: Mon Dec 17 03:49:31 2007
New Revision: 604844

URL: http://svn.apache.org/viewvc?rev=604844&view=rev
Log:
Allow a JcrNodeResource to adapt to any interface implemented by the
underlying node. Mainly, this allows adapting to the javax.jcr.Item
interface.

Modified:
    incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java

Modified: incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java?rev=604844&r1=604843&r2=604844&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
(original)
+++ incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
Mon Dec 17 03:49:31 2007
@@ -108,8 +108,8 @@
 
     @SuppressWarnings("unchecked")
     public <Type> Type adaptTo(Class<Type> type) {
-        if (type == Node.class) {
-            return (Type) node; // unchecked cast
+        if (type.isInstance(getNode())) {
+            return (Type) getNode(); // unchecked cast
         } else if (type == InputStream.class) {
             return (Type) getInputStream(); // unchecked cast
         } else if (type == URL.class) {



Mime
View raw message