db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer MtoNCollectionPrefetcher.java PlainPrefetcher.java ConnectionFactoryPooledImpl.java BasePrefetcher.java ReferencePrefetcher.java CollectionPrefetcher.java
Date Fri, 11 Jun 2004 18:49:09 GMT
brj         2004/06/11 11:49:09

  Modified:    src/java/org/apache/ojb/broker/accesslayer
                        MtoNCollectionPrefetcher.java PlainPrefetcher.java
                        ConnectionFactoryPooledImpl.java
                        BasePrefetcher.java ReferencePrefetcher.java
                        CollectionPrefetcher.java
  Log:
  provide initial size for Collections (by robert sfeir)
  
  Revision  Changes    Path
  1.12      +5 -5      db-ojb/src/java/org/apache/ojb/broker/accesslayer/MtoNCollectionPrefetcher.java
  
  Index: MtoNCollectionPrefetcher.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/MtoNCollectionPrefetcher.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MtoNCollectionPrefetcher.java	12 May 2004 19:25:54 -0000	1.11
  +++ MtoNCollectionPrefetcher.java	11 Jun 2004 18:49:09 -0000	1.12
  @@ -212,8 +212,8 @@
           ClassDescriptor cld = getOwnerClassDescriptor();
           Class topLevelClass = getBroker().getTopLevelClass(cld.getClassOfObject());
           BrokerHelper helper = getBroker().serviceBrokerHelper();
  -        Collection queries = new ArrayList();
  -        Collection idsSubset = new HashSet();
  +        Collection queries = new ArrayList(owners.size());
  +        Collection idsSubset = new HashSet(owners.size());
           Object[] fkValues;
           Object owner;
           Identity id;
  @@ -268,7 +268,7 @@
        *
        * @param ids Collection of identities of M side
        * @param fkCol indirection table fks to this class
  -     * @param itemFk indirection table fks to item class
  +     * @param itemFkCol indirection table fks to item class
        * @param itemPkField
        * @return the Criteria 
        */
  @@ -276,7 +276,7 @@
               FieldDescriptor itemPkField)
       {
           Criteria crit = new Criteria();
  -        ArrayList values = new ArrayList();
  +        ArrayList values = new ArrayList(ids.size());
           Iterator iter = ids.iterator();
           Identity id;
   
  
  
  
  1.9       +2 -2      db-ojb/src/java/org/apache/ojb/broker/accesslayer/PlainPrefetcher.java
  
  Index: PlainPrefetcher.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/PlainPrefetcher.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PlainPrefetcher.java	12 May 2004 19:25:54 -0000	1.8
  +++ PlainPrefetcher.java	11 Jun 2004 18:49:09 -0000	1.9
  @@ -61,7 +61,7 @@
           Identity id;
           Object proxy;
           Object realSubject;
  -        HashMap realSubjectsMap = new HashMap();
  +        HashMap realSubjectsMap = new HashMap(realSubjects.size());
   
           for (Iterator it = realSubjects.iterator(); it.hasNext(); )
           {
  
  
  
  1.15      +2 -2      db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryPooledImpl.java
  
  Index: ConnectionFactoryPooledImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryPooledImpl.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ConnectionFactoryPooledImpl.java	25 May 2004 15:02:01 -0000	1.14
  +++ ConnectionFactoryPooledImpl.java	11 Jun 2004 18:49:09 -0000	1.15
  @@ -109,7 +109,7 @@
           synchronized (connectionPools)
           {
               Collection pools = connectionPools.values();
  -            connectionPools = new HashMap();
  +            connectionPools = new HashMap(connectionPools.size());
               ObjectPool op = null;
               for (Iterator iterator = pools.iterator(); iterator.hasNext();)
               {
  
  
  
  1.10      +2 -2      db-ojb/src/java/org/apache/ojb/broker/accesslayer/BasePrefetcher.java
  
  Index: BasePrefetcher.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/BasePrefetcher.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BasePrefetcher.java	12 May 2004 19:25:54 -0000	1.9
  +++ BasePrefetcher.java	11 Jun 2004 18:49:09 -0000	1.10
  @@ -162,7 +162,7 @@
       private Criteria buildPrefetchCriteriaSingleKey(Collection ids, FieldDescriptor field)
       {
           Criteria crit = new Criteria();
  -        ArrayList values = new ArrayList();
  +        ArrayList values = new ArrayList(ids.size());
           Iterator iter = ids.iterator();
           Identity id;
   
  
  
  
  1.20      +4 -4      db-ojb/src/java/org/apache/ojb/broker/accesslayer/ReferencePrefetcher.java
  
  Index: ReferencePrefetcher.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/ReferencePrefetcher.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- ReferencePrefetcher.java	12 May 2004 19:25:54 -0000	1.19
  +++ ReferencePrefetcher.java	11 Jun 2004 18:49:09 -0000	1.20
  @@ -64,7 +64,7 @@
           PersistenceBroker pb = getBroker();
           PersistentField field = ord.getPersistentField();
           Class topLevelClass = pb.getTopLevelClass(ord.getItemClass());
  -        HashMap childrenMap = new HashMap();
  +        HashMap childrenMap = new HashMap(children.size());
   
   
           for (Iterator it = children.iterator(); it.hasNext(); )
  @@ -109,8 +109,8 @@
       {
           ClassDescriptor cld = getOwnerClassDescriptor();
           ObjectReferenceDescriptor ord = getObjectReferenceDescriptor();
  -        Collection queries = new ArrayList();
  -        Collection idsSubset = new HashSet();
  +        Collection queries = new ArrayList(owners.size());
  +        Collection idsSubset = new HashSet(owners.size());
           Iterator iter = owners.iterator();
           Class topLevelClass = getBroker().getTopLevelClass(ord.getItemClass());
           Object[] fkValues;
  
  
  
  1.29      +4 -4      db-ojb/src/java/org/apache/ojb/broker/accesslayer/CollectionPrefetcher.java
  
  Index: CollectionPrefetcher.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/CollectionPrefetcher.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- CollectionPrefetcher.java	12 May 2004 19:25:54 -0000	1.28
  +++ CollectionPrefetcher.java	11 Jun 2004 18:49:09 -0000	1.29
  @@ -70,8 +70,8 @@
           ClassDescriptor cld = getOwnerClassDescriptor();
           Class topLevelClass = getBroker().getTopLevelClass(cld.getClassOfObject());
           BrokerHelper helper = getBroker().serviceBrokerHelper();
  -        Collection queries = new ArrayList();
  -        Collection idsSubset = new HashSet();
  +        Collection queries = new ArrayList(owners.size());
  +        Collection idsSubset = new HashSet(owners.size());
           Object[] fkValues;
           Object owner;
           Identity id;
  @@ -131,7 +131,7 @@
           PersistenceBroker pb = getBroker();
           Class ownerTopLevelClass = pb.getTopLevelClass(getOwnerClassDescriptor().getClassOfObject());
           Class collectionClass = cds.getCollectionClass(); // this collection type will
be used:
  -        HashMap ownerIdsToLists = new HashMap();
  +        HashMap ownerIdsToLists = new HashMap(owners.size());
   
           // initialize the owner list map
           for (Iterator it = owners.iterator(); it.hasNext();)
  
  
  

---------------------------------------------------------------------
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