You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2007/12/17 12:49:33 UTC
svn commit: r604844 -
/incubator/sling/trunk/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
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) {