Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 80476 invoked from network); 8 Oct 2005 12:06:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Oct 2005 12:06:41 -0000 Received: (qmail 62196 invoked by uid 500); 8 Oct 2005 12:06:41 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 62154 invoked by uid 500); 8 Oct 2005 12:06:40 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 62143 invoked by uid 500); 8 Oct 2005 12:06:40 -0000 Received: (qmail 62140 invoked by uid 99); 8 Oct 2005 12:06:40 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 08 Oct 2005 05:06:39 -0700 Received: (qmail 80435 invoked by uid 1510); 8 Oct 2005 12:06:19 -0000 Date: 8 Oct 2005 12:06:19 -0000 Message-ID: <20051008120619.80434.qmail@minotaur.apache.org> From: arminw@apache.org To: db-ojb-cvs@apache.org Subject: cvs commit: db-ojb/src/java/org/apache/ojb/broker/metadata ClassDescriptor.java X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N arminw 2005/10/08 05:06:19 Modified: src/java/org/apache/ojb/broker/metadata ClassDescriptor.java Log: code optimization Revision Changes Path 1.116 +9 -6 db-ojb/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java Index: ClassDescriptor.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java,v retrieving revision 1.115 retrieving revision 1.116 diff -u -r1.115 -r1.116 --- ClassDescriptor.java 7 Oct 2005 14:54:48 -0000 1.115 +++ ClassDescriptor.java 8 Oct 2005 12:06:19 -0000 1.116 @@ -787,7 +787,8 @@ * using relationships
* ie: name, avg(price), adress.street * @param aPath the path to the attribute - * @param pathHints a Map containing the class to be used for a segment + * @param pathHints a Map containing the class to be used for a segment or null + * if no segment was used. * @return the FieldDescriptor or null (ie: for m:n queries) */ public FieldDescriptor getFieldDescriptorForPath(String aPath, Map pathHints) @@ -817,7 +818,7 @@ */ public FieldDescriptor getFieldDescriptorForPath(String aPath) { - return getFieldDescriptorForPath(aPath, new HashMap()); + return getFieldDescriptorForPath(aPath, null); } /* arminw: @@ -1138,7 +1139,8 @@ * ie: partner.addresses returns a Collection of 2 AttributeDescriptors * (ObjectReferenceDescriptor, CollectionDescriptor) * @param aPath the cleaned path to the attribute - * @param pathHints a Map containing the class to be used for a segment + * @param pathHints a Map containing the class to be used for a segment or null + * if no segment was used. * @return ArrayList of AttributeDescriptors */ public ArrayList getAttributeDescriptorsForPath(String aPath, Map pathHints) @@ -1153,7 +1155,8 @@ * ie: partner.addresses returns a Collection of 2 AttributeDescriptors * (ObjectReferenceDescriptor, CollectionDescriptor) * @param aPath the cleaned path to the attribute - * @param pathHints a Map containing the class to be used for a segment + * @param pathHints a Map containing the class to be used for a segment or null + * if no segment is used. * @return ArrayList of AttributeDescriptors */ private ArrayList getAttributeDescriptorsForCleanPath(String aPath, Map pathHints) @@ -1200,7 +1203,7 @@ { // BRJ : look for hints for the processed segment // ie: ref pointng to ClassA and ref.ref pointing to ClassC - List hintClasses = (List) pathHints.get(processedSegment.toString()); + List hintClasses = pathHints != null ? (List) pathHints.get(processedSegment.toString()) : null; if (hintClasses != null && hintClasses.get(0) != null) { itemClass = (Class) hintClasses.get(0); --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org