incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r966266 - /sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractSlingPostOperation.java
Date Wed, 21 Jul 2010 14:58:31 GMT
Author: justin
Date: Wed Jul 21 14:58:31 2010
New Revision: 966266

URL: http://svn.apache.org/viewvc?rev=966266&view=rev
Log:
SLING-1608 - fixing unsafe cast

Modified:
    sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractSlingPostOperation.java

Modified: sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractSlingPostOperation.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractSlingPostOperation.java?rev=966266&r1=966265&r2=966266&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractSlingPostOperation.java
(original)
+++ sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractSlingPostOperation.java
Wed Jul 21 14:58:31 2010
@@ -425,12 +425,14 @@ public abstract class AbstractSlingPostO
     }
 
     private boolean checkin(Session session, String path) throws RepositoryException {
-        Node node = (Node) session.getItem(path);
-        if (node.isCheckedOut() && isVersionable(node)) {
-            node.checkin();
-            return true;
+        Item item = session.getItem(path);
+        if (item instanceof Node) {
+            Node node = (Node) item;
+            if (node.isCheckedOut() && isVersionable(node)) {
+                node.checkin();
+                return true;
+            }
         }
-
         return false;
     }
 



Mime
View raw message