jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1171129 [1/2] - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: ./ hierarchy/ lock/ operation/ security/ state/ version/ xml/
Date Thu, 15 Sep 2011 15:17:53 GMT
Author: mduerig
Date: Thu Sep 15 15:17:51 2011
New Revision: 1171129

URL: http://svn.apache.org/viewvc?rev=1171129&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)  
refactor: generify ItemState, ItemImpl, HierarchyEntry to reduce casting

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCache.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemLifeCycleListener.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrVersionManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LogUtil.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/EntryFactory.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntry.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEventListener.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntry.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/UniqueIdResolver.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractRemove.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkpoint.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveActivity.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/security/AccessManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/AbstractItemStateFactory.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateCreationListener.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateLifeCycleListener.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCache.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCache.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCache.java Thu Sep 15 15:17:51 2011
@@ -33,7 +33,7 @@ import static org.apache.jackrabbit.spi.
 public class ItemCache implements ItemLifeCycleListener {
     private static final Logger log = LoggerFactory.getLogger(ItemCache.class);
 
-    private final Map<ItemState, Item> cache;
+    private final Map<ItemState<?>, Item> cache;
 
     ItemCache(int maxSize) {
         cache = cast(new LRUMap(maxSize));
@@ -50,7 +50,7 @@ public class ItemCache implements ItemLi
     * @return The item reference stored in the corresponding cache entry
     * or {@code null} if there's no corresponding cache entry.
     */
-    public Item getItem(ItemState state) {
+    public Item getItem(ItemState<?> state) {
         return cache.get(state);
     }
 
@@ -64,18 +64,18 @@ public class ItemCache implements ItemLi
     //----------------------------------------------< ItemLifeCycleListener >---
 
     @Override
-    public void itemCreated(Item item, ItemState state) {
+    public void itemCreated(Item item, ItemState<?> state) {
         cacheItem(state, item);
     }
 
     @Override
-    public void itemUpdated(Item item, ItemState state, boolean modified) {
+    public void itemUpdated(Item item, ItemState<?> state, boolean modified) {
         // do nothing: we don't touch the cache here since the LRU
         // should only be affected by client side operations.
     }
 
     @Override
-    public void itemDestroyed(Item item, ItemState state) {
+    public void itemDestroyed(Item item, ItemState<?> state) {
         evictItem(state);
     }
 
@@ -87,7 +87,7 @@ public class ItemCache implements ItemLi
      *
      * @param item the item to cache
      */
-    private synchronized void cacheItem(ItemState state, Item item) {
+    private synchronized void cacheItem(ItemState<?> state, Item item) {
         if (log.isDebugEnabled()) {
             if (cache.containsKey(state)) {
                 log.debug("overwriting cached item " + state);
@@ -104,7 +104,7 @@ public class ItemCache implements ItemLi
      *
      * @param itemState state of the item to remove from the cache
      */
-    private synchronized void evictItem(ItemState itemState) {
+    private synchronized void evictItem(ItemState<?> itemState) {
         if (log.isDebugEnabled()) {
             log.debug("removing item " + itemState + " from cache");
         }
@@ -118,8 +118,8 @@ public class ItemCache implements ItemLi
      */
     public String toString() {
         StringBuilder builder = new StringBuilder();
-        for (Map.Entry<ItemState, Item> entry : cache.entrySet()) {
-            ItemState state = entry.getKey();
+        for (Map.Entry<ItemState<?>, Item> entry : cache.entrySet()) {
+            ItemState<?> state = entry.getKey();
             Item item = entry.getValue();
             if (item.isNode()) {
                 builder.append("Node: ");
@@ -143,4 +143,4 @@ public class ItemCache implements ItemLi
         }
         return builder.toString();
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java Thu Sep 15 15:17:51 2011
@@ -44,10 +44,10 @@ import javax.jcr.UnsupportedRepositoryOp
 /**
  * {@code ItemImpl}...
  */
-public abstract class ItemImpl implements Item, ItemStateLifeCycleListener {
+public abstract class ItemImpl<STATE_TYPE extends ItemState<?>> implements Item, ItemStateLifeCycleListener {
     private static final Logger log = LoggerFactory.getLogger(ItemImpl.class);
 
-    private final ItemState state;
+    private final STATE_TYPE state;
 
     /**
      * The session that created this item.
@@ -59,7 +59,7 @@ public abstract class ItemImpl implement
      */
     private ItemLifeCycleListener listener;
 
-    protected ItemImpl(SessionImpl session, ItemState state, ItemLifeCycleListener listener) {
+    protected ItemImpl(SessionImpl session, STATE_TYPE state, ItemLifeCycleListener listener) {
         this.session = session;
         this.state = state;
         this.listener = listener;
@@ -159,7 +159,7 @@ public abstract class ItemImpl implement
             return false;
         }
         if (otherItem instanceof ItemImpl) {
-            ItemImpl other = (ItemImpl) otherItem;
+            ItemImpl<?> other = (ItemImpl<?>) otherItem;
             if (state == other.state) {
                 return true;
             }
@@ -258,7 +258,7 @@ public abstract class ItemImpl implement
      * @param previousStatus
      */
     @Override
-    public void statusChanged(ItemState state, Status previousStatus) {
+    public void statusChanged(ItemState<?> state, Status previousStatus) {
         if (state != this.state) {
             throw new IllegalArgumentException("Invalid argument: ItemState with changed status must be this.state.");
         }
@@ -446,7 +446,7 @@ public abstract class ItemImpl implement
      *
      * @return state associated with this {@code Item}
      */
-    protected ItemState getItemState() {
+    protected STATE_TYPE getItemState() {
         return state;
     }
 
@@ -474,8 +474,8 @@ public abstract class ItemImpl implement
      * @param state
      * @throws RepositoryException
      */
-    private static void updateId(ItemState state) throws RepositoryException {
-        HierarchyEntry he = state.getHierarchyEntry();
+    private static void updateId(ItemState<?> state) throws RepositoryException {
+        HierarchyEntry<?> he = state.getHierarchyEntry();
         while (he.getStatus() != Status.INVALIDATED) {
             he = he.getParent();
             if (he == null) {

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemLifeCycleListener.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemLifeCycleListener.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemLifeCycleListener.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemLifeCycleListener.java Thu Sep 15 15:17:51 2011
@@ -31,7 +31,7 @@ public interface ItemLifeCycleListener {
      *
      * @param item the instance which has been created
      */
-    void itemCreated(Item item, ItemState state);
+    void itemCreated(Item item, ItemState<?> state);
 
     /**
      * Called when an {@code Item} instance has been refreshed. If
@@ -40,7 +40,7 @@ public interface ItemLifeCycleListener {
      *
      * @param item the instance which has been refreshed
      */
-    void itemUpdated(Item item, ItemState state, boolean modified);
+    void itemUpdated(Item item, ItemState<?> state, boolean modified);
 
     /**
      * Called when an {@code ItemImpl} instance has been destroyed
@@ -53,5 +53,5 @@ public interface ItemLifeCycleListener {
      *
      * @param item the instance which has been destroyed
      */
-    void itemDestroyed(Item item, ItemState state);
+    void itemDestroyed(Item item, ItemState<?> state);
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java Thu Sep 15 15:17:51 2011
@@ -158,10 +158,10 @@ public class ItemManager implements Item
      * @param hierarchyEntry
      * @return true if the specified item exists
      */
-    public boolean itemExists(HierarchyEntry hierarchyEntry) {
+    public boolean itemExists(HierarchyEntry<?> hierarchyEntry) {
         try {
             // session-sanity & permissions are checked upon itemExists(ItemState)
-            ItemState state = hierarchyEntry.getItemState();
+            ItemState<?> state = hierarchyEntry.getItemState();
             return itemExists(state);
         } catch (ItemNotFoundException e) {
             return false;
@@ -175,7 +175,7 @@ public class ItemManager implements Item
      * @param itemState
      * @return
      */
-    private boolean itemExists(ItemState itemState) {
+    private boolean itemExists(ItemState<?> itemState) {
         try {
             // check sanity of session
             session.checkIsAlive();
@@ -225,9 +225,9 @@ public class ItemManager implements Item
      * @throws ItemNotFoundException
      * @throws RepositoryException
      */
-    public Item getItem(HierarchyEntry hierarchyEntry) throws RepositoryException {
+    public Item getItem(HierarchyEntry<?> hierarchyEntry) throws RepositoryException {
         session.checkIsAlive();
-        ItemState state = hierarchyEntry.getItemState();
+        ItemState<?> state = hierarchyEntry.getItemState();
         if (!state.isValid()) {
             throw new ItemNotFoundException(LogUtil.safeGetJCRPath(state, session.getNamePathResolver()));
         }
@@ -381,7 +381,7 @@ public class ItemManager implements Item
      * @param state
      */
     @Override
-    public void created(ItemState state) {
+    public void created(ItemState<?> state) {
         if (state.isNode()) {
             try {
                 createNodeInstance((NodeState) state);
@@ -395,7 +395,7 @@ public class ItemManager implements Item
     }
 
     @Override
-    public void statusChanged(ItemState state, Status previousStatus) {
+    public void statusChanged(ItemState<?> state, Status previousStatus) {
         // stop listening if an state reached Status.REMOVED.
         if (Status.REMOVED == state.getStatus()) {
             state.removeListener(this);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrVersionManager.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrVersionManager.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/JcrVersionManager.java Thu Sep 15 15:17:51 2011
@@ -181,7 +181,7 @@ public class JcrVersionManager implement
         // make sure the workspace exists and is accessible for this session.
         session.checkAccessibleWorkspace(srcWorkspace);
         
-        Iterator<NodeId> failedIds = session.getVersionStateManager().merge((NodeState) n.getItemState(), srcWorkspace,
+        Iterator<NodeId> failedIds = session.getVersionStateManager().merge(n.getItemState(), srcWorkspace,
                 bestEffort, isShallow);
         
         return LazyItemIterator.nodeIterator(itemManager, session.getHierarchyManager(), failedIds);
@@ -208,7 +208,7 @@ public class JcrVersionManager implement
         session.checkIsAlive();
 
         NodeImpl n = (NodeImpl) itemManager.getNode(resolver.getQPath(absPath));
-        NodeEntry entry = vMgr.createConfiguration((NodeState) n.getItemState());
+        NodeEntry entry = vMgr.createConfiguration(n.getItemState());
         return (Node) itemManager.getItem(entry);
     }
 
@@ -260,7 +260,7 @@ public class JcrVersionManager implement
         session.checkIsAlive();
         NodeImpl activity = getValidActivity(activityNode, "remove");
 
-        NodeState nState = (NodeState) activity.getItemState();
+        NodeState nState = activity.getItemState();
         ItemId removeId = nState.getId();
         vMgr.removeActivity(nState);
 
@@ -275,7 +275,7 @@ public class JcrVersionManager implement
     public NodeIterator merge(Node activityNode) throws RepositoryException {
         session.checkIsAlive();
         NodeImpl activity = getValidActivity(activityNode, "merge");
-        Iterator<NodeId> failedIds = vMgr.mergeActivity((NodeState) activity.getItemState());
+        Iterator<NodeId> failedIds = vMgr.mergeActivity(activity.getItemState());
         return LazyItemIterator.nodeIterator(itemManager, session.getHierarchyManager(), failedIds);
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LazyItemIterator.java Thu Sep 15 15:17:51 2011
@@ -165,7 +165,7 @@ public final class LazyItemIterator {
         private final ItemManager itemMgr;
 
         /** Iterator over HierarchyEntry elements */
-        private final Iterator<? extends HierarchyEntry> hierarchyEntries;
+        private final Iterator<? extends HierarchyEntry<?>> hierarchyEntries;
 
         /**
          * The number of items.
@@ -187,7 +187,7 @@ public final class LazyItemIterator {
          * @param itemMgr item manager
          * @param hierarchyEntryIterator Iterator over HierarchyEntries
          */
-        public IteratorImpl(ItemManager itemMgr, Iterator<? extends HierarchyEntry> hierarchyEntryIterator, long size) {
+        public IteratorImpl(ItemManager itemMgr, Iterator<? extends HierarchyEntry<?>> hierarchyEntryIterator, long size) {
             this.itemMgr = itemMgr;
             hierarchyEntries = hierarchyEntryIterator;
             this.size = size;
@@ -206,7 +206,7 @@ public final class LazyItemIterator {
         private Item prefetchNext() {
             Item nextItem = null;
             while (nextItem == null && hierarchyEntries.hasNext()) {
-                HierarchyEntry entry = hierarchyEntries.next();
+                HierarchyEntry<?> entry = hierarchyEntries.next();
                 try {
                     nextItem = itemMgr.getItem(entry);
                 } catch (RepositoryException e) {
@@ -280,7 +280,7 @@ public final class LazyItemIterator {
             // skip the first (skipNum - 1) items without actually retrieving them
             while (--skipNum > 0) {
                 pos++;
-                HierarchyEntry entry = hierarchyEntries.next();
+                HierarchyEntry<?> entry = hierarchyEntries.next();
                 // check if item exists but don't build Item instance.
                 while (!itemMgr.itemExists(entry)) {
                     log.debug("Ignoring nonexistent item " + entry);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LogUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LogUtil.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LogUtil.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/LogUtil.java Thu Sep 15 15:17:51 2011
@@ -65,7 +65,7 @@ public final class LogUtil {
      * @param pathResolver
      * @return JCR path
      */
-    public static String safeGetJCRPath(ItemState itemState, PathResolver pathResolver) {
+    public static String safeGetJCRPath(ItemState<?> itemState, PathResolver pathResolver) {
         try {
             return safeGetJCRPath(itemState.getHierarchyEntry().getPath(), pathResolver);
         } catch (RepositoryException e) {
@@ -120,4 +120,4 @@ public final class LogUtil {
             return bf.toString();
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java Thu Sep 15 15:17:51 2011
@@ -85,7 +85,7 @@ import java.util.List;
 /**
  * {@code NodeImpl}...
  */
-public class NodeImpl extends ItemImpl implements Node {
+public class NodeImpl extends ItemImpl<NodeState> implements Node {
     private static final Logger log = LoggerFactory.getLogger(NodeImpl.class);
 
     protected NodeImpl(SessionImpl session, NodeState state, ItemLifeCycleListener listener) {
@@ -1332,8 +1332,8 @@ public class NodeImpl extends ItemImpl i
         session.getSessionItemStateManager().execute(an);
 
         // finally retrieve the new node
-        List<ItemState> addedStates = an.getAddedStates();
-        ItemState nState = addedStates.get(0);
+        List<ItemState<?>> addedStates = an.getAddedStates();
+        ItemState<?> nState = addedStates.get(0);
         return (Node) getItemManager().getItem(nState.getHierarchyEntry());
     }
 
@@ -1538,14 +1538,14 @@ public class NodeImpl extends ItemImpl i
      * @return {@code NodeState} of this {@code Node}
      */
     private NodeState getNodeState() {
-        return (NodeState) getItemState();
+        return getItemState();
     }
 
     /**
      * @return {@code NodeEntry} of this {@code Node}
      */
     private NodeEntry getNodeEntry() {
-        return (NodeEntry) getItemState().getHierarchyEntry();
+        return getItemState().getHierarchyEntry();
     }
 
     /**

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java Thu Sep 15 15:17:51 2011
@@ -50,7 +50,7 @@ import java.util.Calendar;
 /**
  * {@code PropertyImpl}...
  */
-public class PropertyImpl extends ItemImpl implements Property {
+public class PropertyImpl extends ItemImpl<PropertyState> implements Property {
     private static final Logger log = LoggerFactory.getLogger(PropertyImpl.class);
 
     public PropertyImpl(SessionImpl session, PropertyState state, ItemLifeCycleListener listener) {
@@ -557,7 +557,7 @@ public class PropertyImpl extends ItemIm
      * @return state for this Property
      */
     private PropertyState getPropertyState() {
-        return (PropertyState) getItemState();
+        return getItemState();
     }
 
     /**

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java Thu Sep 15 15:17:51 2011
@@ -855,11 +855,11 @@ public class SessionImpl extends Abstrac
     NodeState getVersionState(Version version) throws RepositoryException {
         NodeState nodeState;
         if (version.getSession() == this) {
-            nodeState = (NodeState) ((NodeImpl) version).getItemState();
+            nodeState = ((NodeImpl) version).getItemState();
         } else {
             Path p = getQPath(version.getPath());
             Path parentPath = p.getAncestor(1);
-            HierarchyEntry parentEntry = getHierarchyManager().lookup(parentPath);
+            HierarchyEntry<?> parentEntry = getHierarchyManager().lookup(parentPath);
             if (parentEntry != null) {
                 // make sure the parent entry is up to date
                 parentEntry.invalidate(false);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java Thu Sep 15 15:17:51 2011
@@ -631,20 +631,20 @@ public final class WorkspaceManager impl
     }
 
     @Override
-    public boolean isGranted(ItemState itemState, String[] actions) throws RepositoryException {
+    public boolean isGranted(ItemState<?> itemState, String[] actions) throws RepositoryException {
         // a 'new' state can always be read, written and removed
         return itemState.getStatus() == Status.NEW || service.isGranted(sessionInfo, itemState.getWorkspaceId(), actions);
     }
 
     @Override
-    public boolean canRead(ItemState itemState) throws RepositoryException {
+    public boolean canRead(ItemState<?> itemState) throws RepositoryException {
         // a 'new' state can always be read
         return itemState.getStatus() == Status.NEW || service.isGranted(sessionInfo, itemState.getWorkspaceId(),
                 AccessManager.READ);
     }
 
     @Override
-    public boolean canRemove(ItemState itemState) throws RepositoryException {
+    public boolean canRemove(ItemState<?> itemState) throws RepositoryException {
         // a 'new' state can always be removed again
         return itemState.getStatus() == Status.NEW || service.isGranted(sessionInfo, itemState.getWorkspaceId(),
                 AccessManager.REMOVE);
@@ -787,7 +787,7 @@ public final class WorkspaceManager impl
         private void execute(ChangeLog changeLog) throws RepositoryException {
             RepositoryException ex = null;
             try {
-                ItemState target = changeLog.getTarget();
+                ItemState<?> target = changeLog.getTarget();
                 batch = service.createBatch(sessionInfo, target.getId());
                 for (Operation op : changeLog.getOperations()) {
                     log.debug("executing " + op.getName());

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/EntryFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/EntryFactory.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/EntryFactory.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/EntryFactory.java Thu Sep 15 15:17:51 2011
@@ -171,7 +171,7 @@ public class EntryFactory {
          * @param entry The {@code HierarchyEntry} to invalidate.
          * @param recursive Invalidate state of child entries if {@code true}.
          */
-        void invalidate(HierarchyEntry entry, boolean recursive);
+        void invalidate(HierarchyEntry<?> entry, boolean recursive);
 
         /**
          * Apply any pending {@link org.apache.jackrabbit.jcr2spi.state.ItemState#invalidate()
@@ -180,6 +180,6 @@ public class EntryFactory {
          *
          * @param entry The affected {@code NodeEntry}.
          */
-        void applyPending(HierarchyEntry entry);
+        void applyPending(HierarchyEntry<?> entry);
     }
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntry.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntry.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntry.java Thu Sep 15 15:17:51 2011
@@ -40,7 +40,7 @@ import java.lang.ref.SoftReference;
  * {@code HierarchyEntryImpl} implements base functionality for child node
  * and property references.
  */
-public abstract class HierarchyEntry {
+public abstract class HierarchyEntry<STATE_TYPE extends ItemState<?>> {
     private static final Logger log = LoggerFactory.getLogger(HierarchyEntry.class);
 
     /**
@@ -54,7 +54,7 @@ public abstract class HierarchyEntry {
     /**
      * Cached soft reference to the target ItemState.
      */
-    private Reference<ItemState> itemState;
+    private Reference<STATE_TYPE> itemState;
 
     /**
      * The name of the target item state.
@@ -124,9 +124,9 @@ public abstract class HierarchyEntry {
      * does not exist.
      * @throws RepositoryException if an error occurs.
      */
-    ItemState resolve() throws RepositoryException {
+    STATE_TYPE resolve() throws RepositoryException {
         // check if already resolved
-        ItemState state = internalGetItemState();
+        STATE_TYPE state = internalGetItemState();
         // not yet resolved. retrieve and keep soft reference to state
         if (state == null) {
             try {
@@ -156,7 +156,7 @@ public abstract class HierarchyEntry {
      * does not exist.
      * @throws RepositoryException if another error occurs.
      */
-    abstract ItemState doResolve() throws RepositoryException;
+    abstract STATE_TYPE doResolve() throws RepositoryException;
 
     /**
      * Build the Path of this entry
@@ -183,7 +183,7 @@ public abstract class HierarchyEntry {
     /**
      * @return the item state or {@code null} if the entry isn't resolved.
      */
-    ItemState internalGetItemState() {
+    STATE_TYPE internalGetItemState() {
         return itemState != null
             ? itemState.get()
             : null;
@@ -199,7 +199,7 @@ public abstract class HierarchyEntry {
      * @param recursive
      */
     protected void invalidateInternal(boolean recursive) {
-        ItemState state = internalGetItemState();
+        STATE_TYPE state = internalGetItemState();
         if (state == null) {
             log.debug("Skip invalidation for unresolved HierarchyEntry " + name);
         } else {
@@ -252,7 +252,7 @@ public abstract class HierarchyEntry {
      * @see ItemState#getStatus()
      */
     public Status getStatus() {
-        ItemState state = internalGetItemState();
+        STATE_TYPE state = internalGetItemState();
         if (state == null) {
             return Status._UNDEFINED_;
         } else {
@@ -288,7 +288,7 @@ public abstract class HierarchyEntry {
      * @throws RepositoryException If an error occurs while retrieving the
      * {@code ItemState}.
      */
-    public ItemState getItemState() throws RepositoryException {
+    public STATE_TYPE getItemState() throws RepositoryException {
         return resolve();
     }
 
@@ -297,8 +297,8 @@ public abstract class HierarchyEntry {
      *
      * @param state
      */
-    public synchronized void setItemState(ItemState state) {
-        ItemState currentState = internalGetItemState();
+    public synchronized void setItemState(STATE_TYPE state) {
+        STATE_TYPE currentState = internalGetItemState();
         if (state == null || state == currentState || denotesNode() != state.isNode()) {
             throw new IllegalArgumentException();
         }
@@ -306,7 +306,7 @@ public abstract class HierarchyEntry {
         if (currentState == null) {
             // not connected yet to an item state. either a new entry or
             // an unresolved hierarchy entry.
-            itemState = new SoftReference<ItemState>(state);
+            itemState = new SoftReference<STATE_TYPE>(state);
         } else {
             // was already resolved before -> merge the existing state
             // with the passed state.
@@ -351,7 +351,7 @@ public abstract class HierarchyEntry {
      * @throws RepositoryException if an error occurs.
      */
     public void revert() throws RepositoryException {
-        ItemState state = internalGetItemState();
+        STATE_TYPE state = internalGetItemState();
         if (state == null) {
             // nothing to do
             return;
@@ -451,7 +451,7 @@ public abstract class HierarchyEntry {
      * states e.g. an item state is not valid anymore.
      */
     public void transientRemove() throws RepositoryException {
-        ItemState state = internalGetItemState();
+        STATE_TYPE state = internalGetItemState();
         if (state == null) {
             // nothing to do -> correct status must be set upon resolution.
             return;
@@ -515,7 +515,7 @@ public abstract class HierarchyEntry {
      * @param staleParent
      */
     void internalRemove(boolean staleParent) {
-        ItemState state = internalGetItemState();
+        STATE_TYPE state = internalGetItemState();
         Status status = getStatus();
         if (state != null) {
             if (status == Status.EXISTING_MODIFIED) {
@@ -572,10 +572,9 @@ public abstract class HierarchyEntry {
          * {@inheritDoc}
          */
         @Override
-        public void invalidate(HierarchyEntry entry, boolean recursive) {
-            HierarchyEntry he = entry;
+        public void invalidate(HierarchyEntry<?> entry, boolean recursive) {
             if (recursive) {
-                he.generation = INVALIDATION_PENDING;
+                entry.generation = INVALIDATION_PENDING;
                 if (!invalidating) {
                     nextGeneration = 1;
                 }
@@ -583,7 +582,7 @@ public abstract class HierarchyEntry {
                 if (!invalidating) {
                     nextGeneration = 1;
                 }
-                he.invalidateInternal(false);
+                entry.invalidateInternal(false);
             }
         }
 
@@ -598,18 +597,17 @@ public abstract class HierarchyEntry {
          * {@inheritDoc}
          */
         @Override
-        public void applyPending(HierarchyEntry entry) {
+        public void applyPending(HierarchyEntry<?> entry) {
             if (!invalidating) {
                 invalidating = true;
                 currentGeneration += nextGeneration;
                 nextGeneration = 0;
                 try {
-                    HierarchyEntry he = entry;
-                    if (he.generation == INVALIDATION_PENDING) {
-                        he.invalidateInternal(true);
-                        he.generation = currentGeneration;
-                    } else if (he.generation < currentGeneration) {
-                        resolvePendingInvalidation(he);
+                    if (entry.generation == INVALIDATION_PENDING) {
+                        entry.invalidateInternal(true);
+                        entry.generation = currentGeneration;
+                    } else if (entry.generation < currentGeneration) {
+                        resolvePendingInvalidation(entry);
                     }
                 } finally {
                     invalidating = false;
@@ -624,9 +622,8 @@ public abstract class HierarchyEntry {
          *
          * @param entry
          */
-        private void resolvePendingInvalidation(HierarchyEntry entry) {
+        private void resolvePendingInvalidation(HierarchyEntry<?> entry) {
             if (entry != null) {
-
                 // First recursively travel up to the first parent node
                 // which has invalidation pending or to the root node if
                 // no such node exists.

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEventListener.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEventListener.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEventListener.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEventListener.java Thu Sep 15 15:17:51 2011
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.jcr2spi.hierarchy;
 
-import com.sun.tools.javac.resources.version;
 import org.apache.jackrabbit.jcr2spi.WorkspaceManager;
 import org.apache.jackrabbit.jcr2spi.config.CacheBehaviour;
 import org.apache.jackrabbit.jcr2spi.observation.InternalEventListener;
@@ -141,7 +140,7 @@ public class HierarchyEventListener impl
             for (Iterator<Event> it = addEvents.iterator(); it.hasNext();) {
                 Event ev = it.next();
                 NodeId parentId = ev.getParentId();
-                HierarchyEntry parent = null;
+                HierarchyEntry<?> parent = null;
                 if (parentId != null) {
                     parent = hierarchyMgr.lookup(parentId);
                     if (parent == null && ev.getPath() != null && parentId.getUniqueID() != null) {

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyManager.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyManager.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyManager.java Thu Sep 15 15:17:51 2011
@@ -88,7 +88,7 @@ public class HierarchyManager {
      * @param workspaceItemId
      * @return the HierarchyEntry with the given {@code workspaceItemId}.
      */
-    public HierarchyEntry lookup(ItemId workspaceItemId) {
+    public HierarchyEntry<?> lookup(ItemId workspaceItemId) {
         String uniqueID = workspaceItemId.getUniqueID();
         if (uniqueID == null) {
             return rootEntry.lookupDeepEntry(workspaceItemId.getPath());
@@ -115,7 +115,7 @@ public class HierarchyManager {
      * @param workspacePath
      * @return the HierarchyEntry with the given {@code workspacePath}.
      */
-    public HierarchyEntry lookup(Path workspacePath) {
+    public HierarchyEntry<?> lookup(Path workspacePath) {
         return rootEntry.lookupDeepEntry(workspacePath);
     }
 
@@ -260,7 +260,7 @@ public class HierarchyManager {
      * @param hierarchyEntry
      * @return the depth of the specified item
      */
-    public int getDepth(HierarchyEntry hierarchyEntry) {
+    public int getDepth(HierarchyEntry<?> hierarchyEntry) {
         int depth = Path.ROOT_DEPTH;
         NodeEntry parentEntry = hierarchyEntry.getParent();
         while (parentEntry != null) {
@@ -283,7 +283,7 @@ public class HierarchyManager {
      * denote an ancestor of the item denoted by {@code descendant}
      * (or itself).
      */
-    public int getRelativeDepth(NodeEntry ancestor, HierarchyEntry descendant) {
+    public int getRelativeDepth(NodeEntry ancestor, HierarchyEntry<?> descendant) {
         if (ancestor.equals(descendant)) {
             return 0;
         }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java Thu Sep 15 15:17:51 2011
@@ -70,7 +70,7 @@ import static org.apache.jackrabbit.spi.
  * {@code NodeEntryImpl} implements common functionality for child
  * node entry implementations.
  */
-public class NodeEntry extends HierarchyEntry {
+public class NodeEntry extends HierarchyEntry<NodeState> {
     private static final Logger log = LoggerFactory.getLogger(NodeEntry.class);
 
     /**
@@ -223,8 +223,8 @@ public class NodeEntry extends Hierarchy
         // did not cause this entry to be removed -> therefore check status.
         if (recursive && !Status.isTerminal(getStatus())) {
             // recursively reload all entries including props that are in the attic.
-            for (Iterator<HierarchyEntry> it = getAllChildEntries(true); it.hasNext();) {
-                HierarchyEntry ce = it.next();
+            for (Iterator<HierarchyEntry<?>> it = getAllChildEntries(true); it.hasNext();) {
+                HierarchyEntry<?> ce = it.next();
                 ce.reload(recursive);
             }
         }
@@ -257,8 +257,8 @@ public class NodeEntry extends Hierarchy
      */
     @Override
     public void transientRemove() throws RepositoryException {
-        for (Iterator<HierarchyEntry> it = getAllChildEntries(false); it.hasNext();) {
-            HierarchyEntry ce = it.next();
+        for (Iterator<HierarchyEntry<?>> it = getAllChildEntries(false); it.hasNext();) {
+            HierarchyEntry<?> ce = it.next();
             ce.transientRemove();
         }
 
@@ -281,8 +281,8 @@ public class NodeEntry extends Hierarchy
         super.internalRemove(false);
         boolean staleParent = getStatus() == Status.STALE_DESTROYED;
         // now remove all child-entries (or mark them accordingly)
-        for (Iterator<HierarchyEntry> it = getAllChildEntries(true); it.hasNext();) {
-            HierarchyEntry ce = it.next();
+        for (Iterator<HierarchyEntry<?>> it = getAllChildEntries(true); it.hasNext();) {
+            HierarchyEntry<?> ce = it.next();
             ce.internalRemove(staleParent);
         }
     }
@@ -294,8 +294,8 @@ public class NodeEntry extends Hierarchy
         staleParent = staleParent || getStatus() == Status.STALE_DESTROYED;
 
         // now remove all child-entries (or mark them accordingly)
-        for (Iterator<HierarchyEntry> it = getAllChildEntries(true); it.hasNext();) {
-            HierarchyEntry ce = it.next();
+        for (Iterator<HierarchyEntry<?>> it = getAllChildEntries(true); it.hasNext();) {
+            HierarchyEntry<?> ce = it.next();
             ce.internalRemove(staleParent);
         }
     }
@@ -402,7 +402,7 @@ public class NodeEntry extends Hierarchy
      * {@code NodeState}.
      */
     public NodeState getNodeState() throws RepositoryException {
-        return (NodeState) getItemState();
+        return getItemState();
     }
 
     /**
@@ -582,7 +582,7 @@ public class NodeEntry extends Hierarchy
      * @param workspacePath
      * @return matching entry or {@code null}.
      */
-    public HierarchyEntry lookupDeepEntry(Path workspacePath) {
+    public HierarchyEntry<?> lookupDeepEntry(Path workspacePath) {
         NodeEntry entry = this;
         for (int i = 0; i < workspacePath.getLength(); i++) {
             Path.Element elem = workspacePath.getElements()[i];
@@ -904,7 +904,7 @@ public class NodeEntry extends Hierarchy
         // if this entry has not yet been resolved or if it is 'invalidated'
         // all property entries, that are not contained within the specified
         // collection of property names are removed from this NodeEntry.
-        ItemState state = internalGetItemState();
+        ItemState<?> state = internalGetItemState();
         if (containsExtra && (state == null || state.getStatus() == Status.INVALIDATED)) {
             for (Name propName : diff) {
                 PropertyEntry pEntry = properties.get(propName);
@@ -1054,7 +1054,7 @@ public class NodeEntry extends Hierarchy
         ItemId eventId = childEvent.getItemId();
         Path eventPath = childEvent.getPath();
         Name eventName = eventPath.getName();
-        HierarchyEntry child = eventId == null ? null : lookupEntry(eventId, eventPath);
+        HierarchyEntry<?> child = eventId == null ? null : lookupEntry(eventId, eventPath);
 
         switch (childEvent.getType()) {
             case Event.NODE_ADDED:
@@ -1136,7 +1136,7 @@ public class NodeEntry extends Hierarchy
     //-------------------------------------------------< HierarchyEntry >---
 
     @Override
-    ItemState doResolve() throws RepositoryException {
+    NodeState doResolve() throws RepositoryException {
         return getItemStateFactory().createNodeState(getWorkspaceId(), this);
     }
 
@@ -1219,7 +1219,7 @@ public class NodeEntry extends Hierarchy
      *
      * @param childEntry
      */
-    void internalRemoveChildEntry(HierarchyEntry childEntry) {
+    void internalRemoveChildEntry(HierarchyEntry<?> childEntry) {
         if (childEntry.denotesNode()) {
             if (childNodeEntries.remove((NodeEntry) childEntry) == null) {
                 childNodeAttic.remove((NodeEntry) childEntry);
@@ -1245,8 +1245,8 @@ public class NodeEntry extends Hierarchy
         if (recursive) {
             // invalidate all child entries including properties present in the
             // attic (removed props shadowed by a new property with the same name).
-            for (Iterator<HierarchyEntry> it = getAllChildEntries(true); it.hasNext();) {
-                HierarchyEntry ce = it.next();
+            for (Iterator<HierarchyEntry<?>> it = getAllChildEntries(true); it.hasNext();) {
+                HierarchyEntry<?> ce = it.next();
                 ce.invalidate(true);
             }
         }
@@ -1295,7 +1295,7 @@ public class NodeEntry extends Hierarchy
         if (wspIndex && revertInfo != null) {
             return revertInfo.oldIndex;
         } else {
-            NodeState state = (NodeState) internalGetItemState();
+            NodeState state = internalGetItemState();
             if (state == null || !state.hasDefinition() || state.getDefinition().allowsSameNameSiblings()) {
                 return parent.getChildIndex(this, wspIndex);
             } else {
@@ -1329,7 +1329,7 @@ public class NodeEntry extends Hierarchy
     private PropertyEntry loadPropertyEntry(PropertyId childId) throws RepositoryException {
         try {
             PropertyState state = getItemStateFactory().createDeepPropertyState(childId, this);
-            return (PropertyEntry) state.getHierarchyEntry();
+            return state.getHierarchyEntry();
         } catch (ItemNotFoundException e) {
             return null;
         }
@@ -1346,9 +1346,9 @@ public class NodeEntry extends Hierarchy
      * @return the entry or {@code null} if the matching entry has a status
      * {@code Status#NEW}.
      */
-    private HierarchyEntry lookupEntry(ItemId eventId, Path eventPath) {
+    private HierarchyEntry<?> lookupEntry(ItemId eventId, Path eventPath) {
         Name childName = eventPath.getName();
-        HierarchyEntry child;
+        HierarchyEntry<?> child;
         if (eventId.denotesNode()) {
             String uniqueChildID = eventId.getPath() == null ? eventId.getUniqueID() : null;
             int index = eventPath.getNormalizedIndex();
@@ -1399,7 +1399,7 @@ public class NodeEntry extends Hierarchy
                 PropertyState ps = child.getPropertyState();
                 setUniqueID(ps.getValue().getString());
             } else if (NameConstants.JCR_MIXINTYPES.equals(child.getName())) {
-                NodeState state = (NodeState) internalGetItemState();
+                NodeState state = internalGetItemState();
                 if (state != null) {
                     PropertyState ps = child.getPropertyState();
                     state.setMixinTypeNames(getMixinNames(ps));
@@ -1422,7 +1422,7 @@ public class NodeEntry extends Hierarchy
         if (NameConstants.JCR_UUID.equals(propName)) {
             setUniqueID(null);
         } else if (NameConstants.JCR_MIXINTYPES.equals(propName)) {
-            NodeState state = (NodeState) internalGetItemState();
+            NodeState state = internalGetItemState();
             if (state != null) {
                 state.setMixinTypeNames(Name.EMPTY_ARRAY);
             }
@@ -1455,7 +1455,7 @@ public class NodeEntry extends Hierarchy
      * @return iterator over all children entries, that currently are loaded
      * with this NodeEntry
      */
-    private Iterator<HierarchyEntry> getAllChildEntries(boolean includeAttic) {
+    private Iterator<HierarchyEntry<?>> getAllChildEntries(boolean includeAttic) {
         IteratorChain chain = new IteratorChain();
         // attic
         if (includeAttic) {
@@ -1586,8 +1586,8 @@ public class NodeEntry extends Hierarchy
             throw new IllegalArgumentException();
         }
 
-        for (ItemState itemState : operation.getAddedStates()) {
-            HierarchyEntry he = itemState.getHierarchyEntry();
+        for (ItemState<?> itemState : operation.getAddedStates()) {
+            HierarchyEntry<?> he = itemState.getHierarchyEntry();
             if (he.getStatus() == Status.NEW) {
                 switch (operation.getStatus()) {
                     case PERSISTED:
@@ -1615,7 +1615,7 @@ public class NodeEntry extends Hierarchy
                 case PERSISTED:
                     // for autocreated/protected props, mark to be reloaded
                     // upon next access.
-                    PropertyState addedState = (PropertyState) pe.internalGetItemState();
+                    PropertyState addedState = pe.internalGetItemState();
                     addedState.setStatus(Status.EXISTING);
                     QPropertyDefinition pd = addedState.getDefinition();
                     if (pd.isAutoCreated() || pd.isProtected()) {
@@ -1634,7 +1634,7 @@ public class NodeEntry extends Hierarchy
     }
 
     private void complete(Remove operation) throws RepositoryException {
-        HierarchyEntry rmEntry = operation.getRemoveState().getHierarchyEntry();
+        HierarchyEntry<?> rmEntry = operation.getRemoveState().getHierarchyEntry();
         if (rmEntry.getParent() != this) {
             throw new IllegalArgumentException();
         }
@@ -1713,7 +1713,7 @@ public class NodeEntry extends Hierarchy
     }
 
     private void complete(ReorderNodes operation) throws RepositoryException {
-        HierarchyEntry he = operation.getInsertNode().getHierarchyEntry();
+        HierarchyEntry<?> he = operation.getInsertNode().getHierarchyEntry();
         if (he != this) {
             throw new IllegalArgumentException();
         }
@@ -1739,7 +1739,7 @@ public class NodeEntry extends Hierarchy
     }
 
     private void complete(Move operation) throws RepositoryException {
-        HierarchyEntry he = operation.getSourceState().getHierarchyEntry();
+        HierarchyEntry<?> he = operation.getSourceState().getHierarchyEntry();
         if (he != this) {
             throw new IllegalArgumentException();
         }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntry.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntry.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntry.java Thu Sep 15 15:17:51 2011
@@ -18,7 +18,6 @@ package org.apache.jackrabbit.jcr2spi.hi
 
 import org.apache.jackrabbit.jcr2spi.operation.Operation;
 import org.apache.jackrabbit.jcr2spi.operation.SetPropertyValue;
-import org.apache.jackrabbit.jcr2spi.state.ItemState;
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
 import org.apache.jackrabbit.jcr2spi.state.Status;
 import org.apache.jackrabbit.spi.Name;
@@ -31,7 +30,7 @@ import javax.jcr.RepositoryException;
 /**
  * {@code PropertyEntryImpl} implements a reference to a property state.
  */
-public class PropertyEntry extends HierarchyEntry {
+public class PropertyEntry extends HierarchyEntry<PropertyState> {
 
     /**
      * Creates a new {@code PropertyEntryImpl}.
@@ -59,7 +58,7 @@ public class PropertyEntry extends Hiera
 
     //------------------------------------------------------< HierarchyEntry >---
     @Override
-    ItemState doResolve() throws RepositoryException {
+    PropertyState doResolve() throws RepositoryException {
         return getItemStateFactory().createPropertyState(getWorkspaceId(), this);
     }
 
@@ -99,7 +98,7 @@ public class PropertyEntry extends Hiera
      * {@code PropertyState}.
      */
     public PropertyState getPropertyState() throws RepositoryException {
-        return (PropertyState) getItemState();
+        return getItemState();
     }
 
     //-----------------------------------------------------< HierarchyEntry >---

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/UniqueIdResolver.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/UniqueIdResolver.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/UniqueIdResolver.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/UniqueIdResolver.java Thu Sep 15 15:17:51 2011
@@ -89,7 +89,7 @@ public class UniqueIdResolver implements
      * @see ItemStateLifeCycleListener#statusChanged(ItemState, org.apache.jackrabbit.jcr2spi.state.Status)
      */
     @Override
-    public void statusChanged(ItemState state, Status previousStatus) {
+    public void statusChanged(ItemState<?> state, Status previousStatus) {
         synchronized (lookUp) {
             if (Status.isTerminal(state.getStatus())) {
                 if (state.isNode()) {
@@ -120,7 +120,7 @@ public class UniqueIdResolver implements
      * @param state
      */
     @Override
-    public void created(ItemState state) {
+    public void created(ItemState<?> state) {
         if (state.isNode()) {
             NodeEntry entry = (NodeEntry) state.getHierarchyEntry();
             String uniqueID = entry.getUniqueID();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java Thu Sep 15 15:17:51 2011
@@ -607,7 +607,7 @@ public class LockManagerImpl implements 
         //-------------------------------------< ItemStateLifeCycleListener >---
 
         @Override
-        public void statusChanged(ItemState state, Status previousStatus) {
+        public void statusChanged(ItemState<?> state, Status previousStatus) {
             if (!isLive()) {
                 // since we only monitor the removal of the lock (by means
                 // of deletion of the jcr:lockIsDeep property, we are not interested

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java Thu Sep 15 15:17:51 2011
@@ -38,7 +38,7 @@ public abstract class AbstractOperation 
     /**
      * The collection of affected ItemStates.
      */
-    private final Collection<ItemState> affectedStates = new ArrayList<ItemState>();
+    private final Collection<ItemState<?>> affectedStates = new ArrayList<ItemState<?>>();
     protected Status status = Status.PENDING;
 
     /**
@@ -53,7 +53,7 @@ public abstract class AbstractOperation 
     }
 
     @Override
-    public Collection<ItemState> getAffectedItemStates() {
+    public Collection<ItemState<?>> getAffectedItemStates() {
     	if (affectedStates.isEmpty()) {
     		return Collections.emptySet();
     	}
@@ -78,7 +78,7 @@ public abstract class AbstractOperation 
      *
      * @param affectedState the {@code ItemState}s of the affected item.
      */
-    protected void addAffectedItemState(ItemState affectedState) {
+    protected void addAffectedItemState(ItemState<?> affectedState) {
         affectedStates.add(affectedState);
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractRemove.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractRemove.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractRemove.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractRemove.java Thu Sep 15 15:17:51 2011
@@ -27,10 +27,10 @@ import javax.jcr.RepositoryException;
  * operations executed on the workspace such as removing versions or activities.
  */
 public abstract class AbstractRemove extends AbstractOperation {
-    protected final ItemState removeState;
+    protected final ItemState<?> removeState;
     protected final NodeState parent;
 
-    protected AbstractRemove(ItemState removeState, NodeState parent) {
+    protected AbstractRemove(ItemState<?> removeState, NodeState parent) {
         this.removeState = removeState;
         this.parent = parent;
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java Thu Sep 15 15:17:51 2011
@@ -82,7 +82,7 @@ public class AddLabel extends AbstractOp
         assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         try {
-            NodeEntry vhEntry = (NodeEntry) versionHistoryState.getHierarchyEntry();
+            NodeEntry vhEntry = versionHistoryState.getHierarchyEntry();
             NodeEntry lnEntry = vhEntry.getNodeEntry(NameConstants.JCR_VERSIONLABELS, Path.INDEX_DEFAULT);
             if (lnEntry != null) {
                 lnEntry.invalidate(moveLabel);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java Thu Sep 15 15:17:51 2011
@@ -35,7 +35,7 @@ public class AddNode extends TransientOp
     private final Name nodeTypeName;
     private final String uuid;
 
-    private final List<ItemState> addedStates = new ArrayList<ItemState>();
+    private final List<ItemState<?>> addedStates = new ArrayList<ItemState<?>>();
 
     private AddNode(NodeState parentState, Name nodeName, Name nodeTypeName, String uuid)
             throws RepositoryException {
@@ -110,11 +110,11 @@ public class AddNode extends TransientOp
         return uuid;
     }
 
-    public void addedState(List<ItemState> newStates) {
+    public void addedState(List<ItemState<?>> newStates) {
         addedStates.addAll(newStates);
     }
 
-    public List<ItemState> getAddedStates() {
+    public List<ItemState<?>> getAddedStates() {
         return addedStates;
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkin.java Thu Sep 15 15:17:51 2011
@@ -71,7 +71,7 @@ public class Checkin extends AbstractOpe
         } catch (RepositoryException e) {
             log.debug("Failed to access Version history entry -> skip invalidation.", e);
         }
-        Iterator<PropertyEntry> entries = ((NodeEntry) nodeState.getHierarchyEntry()).getPropertyEntries();
+        Iterator<PropertyEntry> entries = nodeState.getHierarchyEntry().getPropertyEntries();
         while (entries.hasNext()) {
             PropertyEntry pe = entries.next();
             pe.invalidate(false);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkout.java Thu Sep 15 15:17:51 2011
@@ -78,7 +78,7 @@ public class Checkout extends AbstractOp
             log.warn("Failed to access Version history entry -> skip invalidation.", e);
         }
         // non-recursive invalidation (but including all properties)
-        NodeEntry nodeEntry = (NodeEntry) nodeState.getHierarchyEntry();
+        NodeEntry nodeEntry = nodeState.getHierarchyEntry();
         Iterator<PropertyEntry> entries = nodeEntry.getPropertyEntries();
         while (entries.hasNext()) {
             PropertyEntry pe = entries.next();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkpoint.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkpoint.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkpoint.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Checkpoint.java Thu Sep 15 15:17:51 2011
@@ -82,7 +82,7 @@ public class Checkpoint extends Abstract
             log.warn("Failed to access Version history entry -> skip invalidation.", e);
         }
         // non-recursive invalidation (but including all properties)
-        NodeEntry nodeEntry = (NodeEntry) nodeState.getHierarchyEntry();
+        NodeEntry nodeEntry = nodeState.getHierarchyEntry();
         Iterator<PropertyEntry> entries = nodeEntry.getPropertyEntries();
         while (entries.hasNext()) {
             PropertyEntry pe = entries.next();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java Thu Sep 15 15:17:51 2011
@@ -16,8 +16,8 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
-import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyManager;
+import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.spi.Path;
 
 import javax.jcr.RepositoryException;
@@ -57,7 +57,7 @@ public class Clone extends AbstractCopy 
         if (removeExisting) {
             status = Status.PERSISTED;
             // invalidate the complete tree -> find root-hierarchy-entry
-            HierarchyEntry he = destParentState.getHierarchyEntry();
+            NodeEntry he = destParentState.getHierarchyEntry();
             while (he.getParent() != null) {
                 he = he.getParent();
             }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Merge.java Thu Sep 15 15:17:51 2011
@@ -73,7 +73,7 @@ public class Merge extends AbstractOpera
         if (isActivityMerge()) {
             // TODO be more specific about what needs to be invalidated
             // look for the root entry and invalidate the complete tree
-            HierarchyEntry entry = nodeState.getNodeEntry();
+            HierarchyEntry<?> entry = nodeState.getNodeEntry();
             while (entry.getParent() != null) {
                 entry = entry.getParent();
             }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java Thu Sep 15 15:17:51 2011
@@ -187,7 +187,7 @@ public class Move extends TransientOpera
         Name destName = destPath.getName();
 
         if (sessionMove) {
-            NodeEntry destEntry = (NodeEntry) destParentState.getHierarchyEntry();
+            NodeEntry destEntry = destParentState.getHierarchyEntry();
 
             // force child node entries list to be present before the move is executed
             // on the hierarchy entry.

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Operation.java Thu Sep 15 15:17:51 2011
@@ -55,7 +55,7 @@ public interface Operation {
      *
      * @return collection of affected {@code ItemState}s.
      */
-    Collection<ItemState> getAffectedItemStates();
+    Collection<ItemState<?>> getAffectedItemStates();
 
     /**
      * Informs this Operation that it has been successfully executed.
@@ -77,4 +77,4 @@ public interface Operation {
      * @return status of this operation.
      */
     Status getStatus();
-}
\ No newline at end of file
+}

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Remove.java Thu Sep 15 15:17:51 2011
@@ -32,14 +32,14 @@ public class Remove extends TransientOpe
             | ItemStateValidator.CHECK_CONSTRAINTS;
 
     private final ItemId removeId;
-    protected ItemState removeState;
+    protected ItemState<?> removeState;
     protected NodeState parent;
 
-    private Remove(ItemState removeState, NodeState parent) throws RepositoryException {
+    private Remove(ItemState<?> removeState, NodeState parent) throws RepositoryException {
         this(removeState, parent, REMOVE_OPTIONS);
     }
 
-    private Remove(ItemState removeState, NodeState parent, int options) throws RepositoryException {
+    private Remove(ItemState<?> removeState, NodeState parent, int options) throws RepositoryException {
         super(options);
         removeId = removeState.getId();
         this.removeState = removeState;
@@ -85,7 +85,7 @@ public class Remove extends TransientOpe
         return removeId;
     }
 
-    public ItemState getRemoveState() {
+    public ItemState<?> getRemoveState() {
         return removeState;
     }
 
@@ -95,7 +95,7 @@ public class Remove extends TransientOpe
 
     //------------------------------------------------------------< Factory >---
 
-    public static Operation create(ItemState state) throws RepositoryException {
+    public static Operation create(ItemState<?> state) throws RepositoryException {
         if (state.isNode() && ((NodeState) state).getDefinition().allowsSameNameSiblings()) {
             // in case of SNS-siblings make sure the parent hierarchy entry has
             // its child entries loaded.

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveActivity.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveActivity.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveActivity.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveActivity.java Thu Sep 15 15:17:51 2011
@@ -62,7 +62,7 @@ public class RemoveActivity extends Abst
 
         // invalidate all references to the removed activity
         while (refs.hasNext()) {
-            HierarchyEntry entry = hMgr.lookup(refs.next());
+            HierarchyEntry<?> entry = hMgr.lookup(refs.next());
             if (entry != null) {
                 entry.invalidate(false);
             }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java Thu Sep 15 15:17:51 2011
@@ -79,7 +79,7 @@ public class RemoveLabel extends Abstrac
     public void persisted() throws RepositoryException {
         status = Status.PERSISTED;
         try {
-            NodeEntry vhEntry = (NodeEntry) versionHistoryState.getHierarchyEntry();
+            NodeEntry vhEntry = versionHistoryState.getHierarchyEntry();
             NodeEntry lnEntry = vhEntry.getNodeEntry(NameConstants.JCR_VERSIONLABELS, Path.INDEX_DEFAULT);
             if (lnEntry != null) {
                 lnEntry.invalidate(true);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ResolveMergeConflict.java Thu Sep 15 15:17:51 2011
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
-import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntry;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.spi.NodeId;
@@ -62,7 +61,7 @@ public class ResolveMergeConflict extend
         assertStatus(Status.PENDING);
         status = Status.PERSISTED;
         // non-recursive invalidation BUT including all properties
-        Iterator<PropertyEntry> propEntries = ((NodeEntry) nodeState.getHierarchyEntry()).getPropertyEntries();
+        Iterator<PropertyEntry> propEntries = nodeState.getHierarchyEntry().getPropertyEntries();
         while (propEntries.hasNext()) {
             PropertyEntry pe = propEntries.next();
             pe.invalidate(false);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/security/AccessManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/security/AccessManager.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/security/AccessManager.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/security/AccessManager.java Thu Sep 15 15:17:51 2011
@@ -65,7 +65,7 @@ public interface AccessManager {
      * @throws ItemNotFoundException if the target item does not exist
      * @throws RepositoryException if another error occurs
      */
-     boolean isGranted(ItemState itemState, String[] actions) throws ItemNotFoundException, RepositoryException;
+     boolean isGranted(ItemState<?> itemState, String[] actions) throws ItemNotFoundException, RepositoryException;
 
 
     /**
@@ -77,7 +77,7 @@ public interface AccessManager {
      * @throws ItemNotFoundException
      * @throws RepositoryException
      */
-    boolean canRead(ItemState itemState) throws ItemNotFoundException, RepositoryException;
+    boolean canRead(ItemState<?> itemState) throws ItemNotFoundException, RepositoryException;
 
     /**
      * Returns true if the existing item state can be removed.
@@ -87,7 +87,7 @@ public interface AccessManager {
      * @throws ItemNotFoundException
      * @throws RepositoryException
      */
-    boolean canRemove(ItemState itemState) throws ItemNotFoundException, RepositoryException;
+    boolean canRemove(ItemState<?> itemState) throws ItemNotFoundException, RepositoryException;
 
     /**
      * Determines whether the subject of the current context is granted access

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/AbstractItemStateFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/AbstractItemStateFactory.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/AbstractItemStateFactory.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/AbstractItemStateFactory.java Thu Sep 15 15:17:51 2011
@@ -57,7 +57,7 @@ public abstract class AbstractItemStateF
      *
      * @param createdState
      */
-    void notifyCreated(ItemState createdState) {
+    void notifyCreated(ItemState<?> createdState) {
         ItemStateCreationListener[] listeners = getListeners();
         for (ItemStateCreationListener listener : listeners) {
             // notify listeners when this item state is saved or invalidated
@@ -71,11 +71,11 @@ public abstract class AbstractItemStateF
      *
      * @param state
      */
-    void notifyUpdated(ItemState state, Status previousStatus) {
+    void notifyUpdated(ItemState<?> state, Status previousStatus) {
         ItemStateCreationListener[] listeners = getListeners();
         for (ItemStateCreationListener listener : listeners) {
             // now inform about creation
             listener.statusChanged(state, previousStatus);
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java?rev=1171129&r1=1171128&r2=1171129&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java (original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java Thu Sep 15 15:17:51 2011
@@ -47,14 +47,14 @@ public class ChangeLog {
      * The change log target: Root item of the tree whose changes are contained
      * in this change log.
      */
-    private final ItemState target;
+    private final ItemState<?> target;
 
     /**
      * Set of operations
      */
     private final Set<Operation> operations;
 
-    private final Set<ItemState> affectedStates;
+    private final Set<ItemState<?>> affectedStates;
 
     /**
      * Create a new change log and populates it with operations and states
@@ -66,7 +66,7 @@ public class ChangeLog {
      * @throws InvalidItemStateException
      * @throws ConstraintViolationException
      */
-    ChangeLog(ItemState target, Set<Operation> operations, Set<ItemState> affectedStates) {
+    ChangeLog(ItemState<?> target, Set<Operation> operations, Set<ItemState<?>> affectedStates) {
         this.target = target;
         this.operations = operations;
         this.affectedStates = affectedStates;
@@ -104,8 +104,8 @@ public class ChangeLog {
 
         // process all remaining states that were not covered by the
         // operation persistence.
-        for (ItemState state : affectedStates) {
-            HierarchyEntry he = state.getHierarchyEntry();
+        for (ItemState<?> state : affectedStates) {
+            HierarchyEntry<?> he = state.getHierarchyEntry();
 
             switch (state.getStatus()) {
                 case EXISTING_MODIFIED:
@@ -164,7 +164,7 @@ public class ChangeLog {
 
         // process all remaining states that were not covered by the
         // operation undo.
-        for (ItemState state : affectedStates) {
+        for (ItemState<?> state : affectedStates) {
             switch (state.getStatus()) {
                 case EXISTING_MODIFIED:
                 case EXISTING_REMOVED:
@@ -195,7 +195,7 @@ public class ChangeLog {
     /**
      * @return the target state
      */
-    public ItemState getTarget() {
+    public ItemState<?> getTarget() {
         return target;
     }
 
@@ -216,7 +216,7 @@ public class ChangeLog {
     /**
      * @return set of the affected states.
      */
-    public Set<ItemState> getAffectedStates() {
+    public Set<ItemState<?>> getAffectedStates() {
         return affectedStates;
     }
 



Mime
View raw message