db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acl...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/odmg LocalTxManager.java
Date Tue, 16 Aug 2005 15:11:33 GMT
aclute      2005/08/16 08:11:33

  Modified:    src/test/org/apache/ojb/odmg Tag: OJB_1_0_RELEASE
                        CollectionsTest.java
               src/java/org/apache/ojb/broker/locking Tag: OJB_1_0_RELEASE
                        CommonsOJBLockManager.java
               src/xdoclet/java/src/xdoclet/modules/ojb/model Tag:
                        OJB_1_0_RELEASE FieldWithIdComparator.java
               src/test/org/apache/ojb/broker Tag: OJB_1_0_RELEASE
                        AbstractExtentClassTest.java M2NGraphTest.java
                        BrokerExamples.java ArticleCollection.java
               src/test/org/apache/ojb/performance Tag: OJB_1_0_RELEASE
                        PerfMain.java
               src/java/org/apache/ojb/broker/core Tag: OJB_1_0_RELEASE
                        PersistenceBrokerFactorySyncImpl.java
               src/java/org/apache/ojb/odmg Tag: OJB_1_0_RELEASE
                        LocalTxManager.java
  Log:
  Code cleanup -- removing all unnessecary casts - except for Parser generated code
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.13.2.11 +4 -4      db-ojb/src/test/org/apache/ojb/odmg/CollectionsTest.java
  
  Index: CollectionsTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/CollectionsTest.java,v
  retrieving revision 1.13.2.10
  retrieving revision 1.13.2.11
  diff -u -r1.13.2.10 -r1.13.2.11
  --- CollectionsTest.java	4 Jun 2005 17:35:19 -0000	1.13.2.10
  +++ CollectionsTest.java	16 Aug 2005 15:11:32 -0000	1.13.2.11
  @@ -538,7 +538,7 @@
           tx.commit();
   
           tx.begin();
  -        ((TransactionExt)tx).getBroker().clearCache();
  +        tx.getBroker().clearCache();
           OQLQuery query = odmg.newOQLQuery();
           query.create(queryStr);
           query.bind(name);
  @@ -558,7 +558,7 @@
           tx.commit();
   
           tx.begin();
  -        ((TransactionExt)tx).getBroker().clearCache();
  +        tx.getBroker().clearCache();
           query = odmg.newOQLQuery();
           query.create(queryStr);
           query.bind(name);
  @@ -581,7 +581,7 @@
           tx.commit();
   
           tx.begin();
  -        ((TransactionExt)tx).getBroker().clearCache();
  +        tx.getBroker().clearCache();
           query = odmg.newOQLQuery();
           query.create(queryStr);
           query.bind(name);
  
  
  
  No                   revision
  No                   revision
  1.1.2.3   +2 -2      db-ojb/src/java/org/apache/ojb/broker/locking/Attic/CommonsOJBLockManager.java
  
  Index: CommonsOJBLockManager.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/locking/Attic/CommonsOJBLockManager.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- CommonsOJBLockManager.java	14 Jun 2005 13:26:00 -0000	1.1.2.2
  +++ CommonsOJBLockManager.java	16 Aug 2005 15:11:32 -0000	1.1.2.3
  @@ -125,7 +125,7 @@
                        boolean preferred, long timeoutMSecs, Object isolationId) throws LockException
       {
           timeoutCheck(ownerId);
  -        GenericLock lock = (GenericLock) atomicGetOrCreateLock(resourceId, isolationId);
  +        GenericLock lock = atomicGetOrCreateLock(resourceId, isolationId);
           super.doLock(lock, ownerId, resourceId, targetLockLevel, compatibility, preferred,
timeoutMSecs);
       }
   
  
  
  
  No                   revision
  No                   revision
  1.3.2.1   +2 -2      db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/model/FieldWithIdComparator.java
  
  Index: FieldWithIdComparator.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/xdoclet/java/src/xdoclet/modules/ojb/model/FieldWithIdComparator.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- FieldWithIdComparator.java	5 Apr 2004 00:32:31 -0000	1.3
  +++ FieldWithIdComparator.java	16 Aug 2005 15:11:32 -0000	1.3.2.1
  @@ -52,8 +52,8 @@
        */
       public int compare(Object objA, Object objB)
       {
  -        String idAStr = ((FieldDescriptorDef)_fields.get((String)objA)).getProperty("id");
  -        String idBStr = ((FieldDescriptorDef)_fields.get((String)objB)).getProperty("id");
  +        String idAStr = ((FieldDescriptorDef)_fields.get(objA)).getProperty("id");
  +        String idBStr = ((FieldDescriptorDef)_fields.get(objB)).getProperty("id");
           int    idA;
           int    idB;
   
  
  
  
  No                   revision
  No                   revision
  1.7.2.1   +6 -6      db-ojb/src/test/org/apache/ojb/broker/AbstractExtentClassTest.java
  
  Index: AbstractExtentClassTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/AbstractExtentClassTest.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- AbstractExtentClassTest.java	25 Jun 2004 15:58:39 -0000	1.7
  +++ AbstractExtentClassTest.java	16 Aug 2005 15:11:33 -0000	1.7.2.1
  @@ -81,7 +81,7 @@
           boolean found = false;
           for (Iterator iterator = res.iterator(); iterator.hasNext();)
           {
  -            Object o = (Object) iterator.next();
  +            Object o = iterator.next();
               if(o instanceof ConcreteZZ)
               {
                   ConcreteZZ zz = (ConcreteZZ) o;
  @@ -104,7 +104,7 @@
           found = false;
           for (Iterator iterator = results.iterator(); iterator.hasNext();)
           {
  -            Object o = (Object) iterator.next();
  +            Object o = iterator.next();
               if(o instanceof ConcreteZZ)
               {
                   ConcreteZZ zz = (ConcreteZZ) o;
  @@ -125,7 +125,7 @@
           assertEquals(3, results.size());
           for (Iterator iterator = results.iterator(); iterator.hasNext();)
           {
  -            Object o = (Object) iterator.next();
  +            Object o = iterator.next();
               ConcreteZZ zz = (ConcreteZZ) o;
               assertNotNull(zz.getConcreteZZName());
               assertEquals("ZZ", zz.getConcreteZZName());
  @@ -141,7 +141,7 @@
           assertEquals(3, results.size());
           for (Iterator iterator = results.iterator(); iterator.hasNext();)
           {
  -            Object o = (Object) iterator.next();
  +            Object o = iterator.next();
               ConcreteZZ zz = (ConcreteZZ) o;
               assertNotNull(zz.getConcreteZZName());
               assertEquals("ZZ", zz.getConcreteZZName());
  @@ -175,7 +175,7 @@
           assertEquals(3, results.size());
           for (Iterator iterator = results.iterator(); iterator.hasNext();)
           {
  -            Object o = (Object) iterator.next();
  +            Object o = iterator.next();
               ConcreteZZ zz = (ConcreteZZ) o;
               assertNotNull(zz.getConcreteZZName());
               assertEquals("ZZ", zz.getConcreteZZName());
  
  
  
  1.2.2.2   +2 -2      db-ojb/src/test/org/apache/ojb/broker/M2NGraphTest.java
  
  Index: M2NGraphTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/M2NGraphTest.java,v
  retrieving revision 1.2.2.1
  retrieving revision 1.2.2.2
  diff -u -r1.2.2.1 -r1.2.2.2
  --- M2NGraphTest.java	27 Jul 2004 00:31:50 -0000	1.2.2.1
  +++ M2NGraphTest.java	16 Aug 2005 15:11:33 -0000	1.2.2.2
  @@ -310,7 +310,7 @@
       void changeRelationMetadata(String field, boolean autoRetrieve, int autoUpdate, int
autoDelete, boolean proxy)
       {
           ClassDescriptor cld = broker.getClassDescriptor(Node.class);
  -        CollectionDescriptor cod = (CollectionDescriptor) cld.getCollectionDescriptorByName(field);
  +        CollectionDescriptor cod = cld.getCollectionDescriptorByName(field);
           cod.setLazy(proxy);
           cod.setCascadeRetrieve(autoRetrieve);
           cod.setCascadingStore(autoUpdate);
  
  
  
  1.19.2.4  +2 -2      db-ojb/src/test/org/apache/ojb/broker/BrokerExamples.java
  
  Index: BrokerExamples.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/BrokerExamples.java,v
  retrieving revision 1.19.2.3
  retrieving revision 1.19.2.4
  diff -u -r1.19.2.3 -r1.19.2.4
  --- BrokerExamples.java	7 Feb 2005 17:38:22 -0000	1.19.2.3
  +++ BrokerExamples.java	16 Aug 2005 15:11:33 -0000	1.19.2.4
  @@ -124,7 +124,7 @@
   
               // switch to shallow retrieval
               ClassDescriptor cld = broker.getClassDescriptor(Article.class);
  -            ord = (ObjectReferenceDescriptor) cld.getObjectReferenceDescriptorByName("productGroup");
  +            ord = cld.getObjectReferenceDescriptorByName("productGroup");
               ord.setCascadeRetrieve(false);
   
               Article article = (Article) broker.getObjectByIdentity(tmpOID);
  @@ -170,7 +170,7 @@
               // switch to shallow retrieval
               ClassDescriptor cld = broker.getClassDescriptor(Article.class);
               // article only has one ord
  -            ord = (ObjectReferenceDescriptor) cld.getObjectReferenceDescriptorByName("productGroup");
  +            ord = cld.getObjectReferenceDescriptorByName("productGroup");
               ord.setCascadeRetrieve(false);
   
               Article article = (Article) broker.getObjectByIdentity(tmpOID);
  
  
  
  1.3.4.1   +1 -1      db-ojb/src/test/org/apache/ojb/broker/ArticleCollection.java
  
  Index: ArticleCollection.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/ArticleCollection.java,v
  retrieving revision 1.3
  retrieving revision 1.3.4.1
  diff -u -r1.3 -r1.3.4.1
  --- ArticleCollection.java	9 Apr 2003 08:57:48 -0000	1.3
  +++ ArticleCollection.java	16 Aug 2005 15:11:33 -0000	1.3.4.1
  @@ -39,7 +39,7 @@
        */
       public void ojbAdd(java.lang.Object anObject)
       {
  -        elements.add((InterfaceArticle) anObject);
  +        elements.add(anObject);
       }
   
       /**
  
  
  
  No                   revision
  No                   revision
  1.9.2.3   +4 -4      db-ojb/src/test/org/apache/ojb/performance/PerfMain.java
  
  Index: PerfMain.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/performance/PerfMain.java,v
  retrieving revision 1.9.2.2
  retrieving revision 1.9.2.3
  diff -u -r1.9.2.2 -r1.9.2.3
  --- PerfMain.java	16 Aug 2005 15:04:39 -0000	1.9.2.2
  +++ PerfMain.java	16 Aug 2005 15:11:33 -0000	1.9.2.3
  @@ -356,11 +356,11 @@
   //            }
               if(counter == 0)
               {
  -                calibrationMark = (double) (((double) res.getTotalTime()) / 1000);
  +                calibrationMark = (((double) res.getTotalTime()) / 1000);
               }
               buf.append(getFilledUpToLength(res.getTestName(), columnLength, " "));
  -            buf.append(getFilledUpToLength(new Double((double) (((double) res.getTestPeriod())
/ 1000)).toString(), columnLength, " "));
  -            Double totalTime = new Double((double) (((double) res.getTotalTime()) / 1000));
  +            buf.append(getFilledUpToLength(new Double((((double) res.getTestPeriod()) /
1000)).toString(), columnLength, " "));
  +            Double totalTime = new Double((((double) res.getTotalTime()) / 1000));
               buf.append(getFilledUpToLength(totalTime.toString(), columnLength, " "));
               buf.append(getFilledUpToLength(new Long(Math.round((totalTime.doubleValue()
/ calibrationMark) * 100)).toString(), columnLength, " "));
               buf.append(getFilledUpToLength(new Long(res.getInsertPeriod()).toString(),
columnLength, " "));
  
  
  
  No                   revision
  No                   revision
  1.7.2.6   +2 -2      db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerFactorySyncImpl.java
  
  Index: PersistenceBrokerFactorySyncImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerFactorySyncImpl.java,v
  retrieving revision 1.7.2.5
  retrieving revision 1.7.2.6
  diff -u -r1.7.2.5 -r1.7.2.6
  --- PersistenceBrokerFactorySyncImpl.java	7 May 2005 16:51:09 -0000	1.7.2.5
  +++ PersistenceBrokerFactorySyncImpl.java	16 Aug 2005 15:11:33 -0000	1.7.2.6
  @@ -454,7 +454,7 @@
               {
                   throw new PBFactoryException("Can't associate object with JTA transaction,
because tx-completion started");
               }
  -            syncMap.put(syncObj.getPBKey(), (Synchronization) syncObj);
  +            syncMap.put(syncObj.getPBKey(), syncObj);
           }
   
           public void afterCompletion(int status)
  
  
  
  No                   revision
  No                   revision
  1.5.2.4   +2 -2      db-ojb/src/java/org/apache/ojb/odmg/LocalTxManager.java
  
  Index: LocalTxManager.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/LocalTxManager.java,v
  retrieving revision 1.5.2.3
  retrieving revision 1.5.2.4
  diff -u -r1.5.2.3 -r1.5.2.4
  --- LocalTxManager.java	25 Jul 2005 00:02:50 -0000	1.5.2.3
  +++ LocalTxManager.java	16 Aug 2005 15:11:33 -0000	1.5.2.4
  @@ -67,7 +67,7 @@
        */
       public TransactionImpl getTransaction()
       {
  -        return (TransactionImpl) tx_table.get(Thread.currentThread());
  +        return  tx_table.get(Thread.currentThread());
       }
   
       /**
  
  
  

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


Mime
View raw message