You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by re...@locus.apache.org on 2000/10/03 23:43:28 UTC

cvs commit: jakarta-slide/src/share/org/apache/slide/lock LockImpl.java

remm        00/10/03 14:43:27

  Modified:    src/share/org/apache/slide/lock LockImpl.java
  Log:
  - Bug fix in the locking algorithm, to prevent locking the same object
    multiple times with the same lock
  
  Revision  Changes    Path
  1.8       +6 -6      jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java
  
  Index: LockImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LockImpl.java	2000/09/26 03:17:24	1.7
  +++ LockImpl.java	2000/10/03 21:43:25	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java,v 1.7 2000/09/26 03:17:24 remm Exp $
  - * $Revision: 1.7 $
  - * $Date: 2000/09/26 03:17:24 $
  + * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java,v 1.8 2000/10/03 21:43:25 remm Exp $
  + * $Revision: 1.8 $
  + * $Date: 2000/10/03 21:43:25 $
    *
    * ====================================================================
    *
  @@ -78,7 +78,7 @@
    * Lock helper class.
    * 
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
    */
   public final class LockImpl implements Lock {
       
  @@ -568,10 +568,10 @@
           } else {
               // The lockTypes are not equal
               boolean condition1 = (tryToLock) 
  -                && (!token2.getTypeUri().equals(token1.getTypeUri()));
  +                && (token2.getTypeUri().equals(token1.getTypeUri()));
               // The user tested is not parent of the token's user
               boolean condition2 = 
  -                ((!token2.getSubjectUri().startsWith(token1.getSubjectUri()))
  +                ((token1.getSubjectUri().startsWith(token2.getSubjectUri()))
                    || (checkLockToken(credentialsToken, token2)));
               // The two lock types are the same
               boolean condition3 = token2.getTypeUri()