jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1174604 - in /jackrabbit/sandbox/jackrabbit-mk: jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/
Date Fri, 23 Sep 2011 09:20:35 GMT
Author: mduerig
Date: Fri Sep 23 09:20:34 2011
New Revision: 1174604

URL: http://svn.apache.org/viewvc?rev=1174604&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
minor cleanup, add comment

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/WeakIdentityCollection.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java?rev=1174604&r1=1174603&r2=1174604&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java
Fri Sep 23 09:20:34 2011
@@ -146,9 +146,6 @@ public final class TransientISFactory ex
         notifyCreated(state);
     }
 
-    /**
-     * @see ItemStateCreationListener#statusChanged(ItemState, Status)
-     */
     @Override
     public void statusChanged(ItemState<?> state, Status previousStatus) {
         // ignore

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/WeakIdentityCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/WeakIdentityCollection.java?rev=1174604&r1=1174603&r2=1174604&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/WeakIdentityCollection.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/util/WeakIdentityCollection.java
Fri Sep 23 09:20:34 2011
@@ -55,6 +55,8 @@ public final class WeakIdentityCollectio
      */
     public void trim() {
         opCount = 0;
+
+        // remove cleared references from the head of the queue
         while (head != null && head.get() == null) {
             head = head.next;
             size--;
@@ -63,6 +65,7 @@ public final class WeakIdentityCollectio
             return;
         }
 
+        // remove cleared references from the tail of the queue
         for (LinkedReference ref = head; ref.next != null; ref = ref.next) {
             if (ref.next.get() == null) {
                 ref.next = ref.next.next;
@@ -124,7 +127,6 @@ public final class WeakIdentityCollectio
     @Override
     public boolean contains(Object o) {
         trimIfNecessary();
-        trimIfNecessary();
         for (LinkedReference ref = head; ref != null; ref = ref.next) {
             if (ref.get() == o) {
                 return true;
@@ -143,15 +145,20 @@ public final class WeakIdentityCollectio
     public boolean remove(Object o) {
         trimIfNecessary();
         opCount++;
+
+        // empty queue
         if (head == null) {
             return false;
         }
+
+        // check if head refers to o
         if (head.get() == o) {
             head = head.next;
             size--;
             return true;
         }
 
+        // check if tail contains o
         for (LinkedReference ref = head; ref.next != null; ref = ref.next) {
             if (ref.next.get() == o) {
                 ref.next = ref.next.next;



Mime
View raw message