commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ozeigerm...@apache.org
Subject cvs commit: jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/memory OptimisticMapWrapper.java
Date Sat, 05 Jun 2004 16:42:11 GMT
ozeigermann    2004/06/05 09:42:11

  Modified:    transaction/src/test/org/apache/commons/transaction/memory
                        MapWrapperTest.java
               transaction/src/java/org/apache/commons/transaction/memory
                        OptimisticMapWrapper.java
  Log:
  And again missing inconsistent use of tabs and spaces, but finally found switch in Eclipse
to avoid tabs
  
  Revision  Changes    Path
  1.8       +18 -17    jakarta-commons-sandbox/transaction/src/test/org/apache/commons/transaction/memory/MapWrapperTest.java
  
  Index: MapWrapperTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/transaction/src/test/org/apache/commons/transaction/memory/MapWrapperTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MapWrapperTest.java	5 Jun 2004 14:52:49 -0000	1.7
  +++ MapWrapperTest.java	5 Jun 2004 16:42:11 -0000	1.8
  @@ -352,9 +352,9 @@
   
           final TransactionalMapWrapper txMap1 = getNewWrapper(map1);
   
  -		assertEquals(txMap1.getTransactionState(), TransactionalMapWrapper.STATUS_NO_TRANSACTION);
  +        assertEquals(txMap1.getTransactionState(), TransactionalMapWrapper.STATUS_NO_TRANSACTION);
           txMap1.startTransaction();
  -		assertEquals(txMap1.getTransactionState(), TransactionalMapWrapper.STATUS_ACTIVE);
  +        assertEquals(txMap1.getTransactionState(), TransactionalMapWrapper.STATUS_ACTIVE);
   
           assertTrue(txMap1.isReadOnly());
           txMap1.put("key", "value");
  @@ -372,32 +372,33 @@
           }
           assertTrue(failed);
           txMap1.rollbackTransaction();
  -		assertEquals(txMap1.getTransactionState(), TransactionalMapWrapper.STATUS_NO_TRANSACTION);
  +        assertEquals(txMap1.getTransactionState(), TransactionalMapWrapper.STATUS_NO_TRANSACTION);
   
           txMap1.startTransaction();
           final TransactionalMapWrapper.TxContext ctx = txMap1.suspendTransaction();
  -        final RendezvousBarrier afterSuspendBarrier = new RendezvousBarrier("After Suspend",
2, BARRIER_TIMEOUT, sLogger);
  +        final RendezvousBarrier afterSuspendBarrier =
  +            new RendezvousBarrier("After Suspend", 2, BARRIER_TIMEOUT, sLogger);
   
           new Thread(new Runnable() {
               public void run() {
                   txMap1.resumeTransaction(ctx);
                   txMap1.put("key2", "value2");
  -				txMap1.suspendTransaction();
  -				afterSuspendBarrier.call();
  +                txMap1.suspendTransaction();
  +                afterSuspendBarrier.call();
               }
           }).start();
   
  -		afterSuspendBarrier.meet();
  -		txMap1.resumeTransaction(ctx);
  +        afterSuspendBarrier.meet();
  +        txMap1.resumeTransaction(ctx);
   
  -		assertEquals(txMap1.size(), 1);
  -		txMap1.put("key3", "value3");
  -		assertEquals(txMap1.size(), 2);
  -		assertEquals(map1.size(), 0);
  +        assertEquals(txMap1.size(), 1);
  +        txMap1.put("key3", "value3");
  +        assertEquals(txMap1.size(), 2);
  +        assertEquals(map1.size(), 0);
   
           txMap1.commitTransaction();
  -		assertEquals(txMap1.size(), 2);
  -		assertEquals(map1.size(), 2);
  +        assertEquals(txMap1.size(), 2);
  +        assertEquals(map1.size(), 2);
       }
   
   }
  
  
  
  1.6       +7 -9      jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/memory/OptimisticMapWrapper.java
  
  Index: OptimisticMapWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/memory/OptimisticMapWrapper.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- OptimisticMapWrapper.java	5 Jun 2004 16:36:02 -0000	1.5
  +++ OptimisticMapWrapper.java	5 Jun 2004 16:42:11 -0000	1.6
  @@ -104,7 +104,7 @@
                   "Active thread " + Thread.currentThread() + " not associated with a transaction!");
           }
   
  -		if (txContext.status == STATUS_MARKED_ROLLBACK) {
  +        if (txContext.status == STATUS_MARKED_ROLLBACK) {
               throw new IllegalStateException("Active thread " + Thread.currentThread() +
" is marked for rollback!");
           }
   
  @@ -279,12 +279,10 @@
               mapFactory.disposeMap(externalAdds);
               externalAdds = null;
           }
  -        
  +
           protected void finalize() throws Throwable {
  -			activeTransactions.remove(this);	        	
  +            activeTransactions.remove(this);
               super.finalize();
           }
  -
  -
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message