jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r706416 - in /jackrabbit/branches/1.5: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/commons/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ jackra...
Date Mon, 20 Oct 2008 21:26:39 GMT
Author: jukka
Date: Mon Oct 20 14:26:38 2008
New Revision: 706416

URL: http://svn.apache.org/viewvc?rev=706416&view=rev
Log:
1.5: Merged revisions 705934, 705938 and 705961 (JCR-1171, JCR-1813 and JCR-1091)

Added:
    jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AccessControlPolicyIteratorAdapter.java
  (props changed)
      - copied unchanged from r705934, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AccessControlPolicyIteratorAdapter.java
Removed:
    jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/commons/
Modified:
    jackrabbit/branches/1.5/   (props changed)
    jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AbstractAccessControlManager.java
    jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java
    jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
    jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java
    jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java

Propchange: jackrabbit/branches/1.5/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 20 14:26:38 2008
@@ -1,2 +1,2 @@
 /jackrabbit/branches/1.3:631261
-/jackrabbit/trunk:703899-704158,704165,704167,704324,704358,704361,704864,704933,704939,705010,705033,705243,705496,705522,705579,705925,705932,705937
+/jackrabbit/trunk:703899-704158,704165,704167,704324,704358,704361,704864,704933,704939,705010,705033,705243,705496,705522,705579,705925,705932,705934,705937-705938,705961

Modified: jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AbstractAccessControlManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AbstractAccessControlManager.java?rev=706416&r1=706415&r2=706416&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AbstractAccessControlManager.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AbstractAccessControlManager.java
Mon Oct 20 14:26:38 2008
@@ -21,7 +21,6 @@
 import org.apache.jackrabbit.api.jsr283.security.AccessControlPolicy;
 import org.apache.jackrabbit.api.jsr283.security.AccessControlPolicyIterator;
 import org.apache.jackrabbit.api.jsr283.security.Privilege;
-import org.apache.jackrabbit.commons.iterator.AccessControlPolicyIteratorAdapter;
 import org.apache.jackrabbit.core.security.authorization.PrivilegeRegistry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Propchange: jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AccessControlPolicyIteratorAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AccessControlPolicyIteratorAdapter.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Propchange: jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AccessControlPolicyIteratorAdapter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Mon Oct 20 14:26:38 2008
@@ -0,0 +1,2 @@
+/jackrabbit/branches/1.3/jackrabbit-core/src/main/java/org/apache/jackrabbit/commons/iterator/AccessControlPolicyIteratorAdapter.java:631261
+/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AccessControlPolicyIteratorAdapter.java:705938,705961

Modified: jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java?rev=706416&r1=706415&r2=706416&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java
Mon Oct 20 14:26:38 2008
@@ -21,7 +21,6 @@
 import org.apache.jackrabbit.api.jsr283.security.AccessControlPolicy;
 import org.apache.jackrabbit.api.jsr283.security.AccessControlPolicyIterator;
 import org.apache.jackrabbit.api.jsr283.security.Privilege;
-import org.apache.jackrabbit.commons.iterator.AccessControlPolicyIteratorAdapter;
 import org.apache.jackrabbit.core.HierarchyManager;
 import org.apache.jackrabbit.core.ItemId;
 import org.apache.jackrabbit.core.security.authorization.AccessControlEditor;

Modified: jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java?rev=706416&r1=706415&r2=706416&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
Mon Oct 20 14:26:38 2008
@@ -49,6 +49,20 @@
     private final Map modifiedRefs = new LinkedMap();
 
     /**
+     * Checks whether this change log contains any changes. This method is
+     * used to avoid extra work on updates that contain no changes.
+     *
+     * @since Apache Jackrabbit 1.5
+     * @see <a href="https://issues.apache.org/jira/browse/JCR-1813">JCR-1813</a>
+     * @return <code>true</code> if this log contains at least one change,
+     *         <code>false</code> otherwise
+     */
+    public boolean hasUpdates() { 
+        return !(addedStates.isEmpty() && modifiedStates.isEmpty()
+                && deletedStates.isEmpty() && modifiedRefs.isEmpty()); 
+    }
+
+    /**
      * A state has been added
      *
      * @param state state that has been added

Modified: jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java?rev=706416&r1=706415&r2=706416&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java
Mon Oct 20 14:26:38 2008
@@ -138,7 +138,7 @@
      */
     public void prepare(TransactionContext tx) throws TransactionException {
         ChangeLog txLog = (ChangeLog) tx.getAttribute(attributeName);
-        if (txLog != null) {
+        if (txLog != null && txLog.hasUpdates()) {
             try {
                 if (virtualProvider != null) {
                     updateVirtualReferences(txLog);
@@ -159,7 +159,7 @@
      */
     public void commit(TransactionContext tx) throws TransactionException {
         ChangeLog txLog = (ChangeLog) tx.getAttribute(attributeName);
-        if (txLog != null) {
+        if (txLog != null && txLog.hasUpdates()) {
             try {
                 update.end();
             } catch (ItemStateException ise) {
@@ -175,7 +175,7 @@
      */
     public void rollback(TransactionContext tx) {
         ChangeLog txLog = (ChangeLog) tx.getAttribute(attributeName);
-        if (txLog != null) {
+        if (txLog != null && txLog.hasUpdates()) {
             if (update != null) {
                 update.cancel();
             }

Modified: jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?rev=706416&r1=706415&r2=706416&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
Mon Oct 20 14:26:38 2008
@@ -623,16 +623,15 @@
         VersionException, ConstraintViolationException, LockException, RepositoryException
{
         checkIsWritable();
         Name mixinQName = getQName(mixinName);
-        if (!canAddMixin(mixinQName)) {
-            throw new ConstraintViolationException("Cannot add '" + mixinName + "' mixin
type.");
-        }
 
         // get mixin types present in the jcr:mixintypes property without
         // modifying the NodeState.
         List mixinValue = getMixinTypes();
-        if (mixinValue.contains(mixinQName)) {
-            log.warn("Mixin " + mixinName + " has already been transiently added -> Ignored.");
-        } else {
+        if (!mixinValue.contains(mixinQName)) {
+            if (!canAddMixin(mixinQName)) {
+                throw new ConstraintViolationException("Cannot add '" + mixinName + "' mixin
type.");
+            }
+
             mixinValue.add(mixinQName);
             // perform the operation
             Operation op = SetMixin.create(getNodeState(), (Name[]) mixinValue.toArray(new
Name[mixinValue.size()]));



Mime
View raw message