You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2005/10/08 14:06:19 UTC
cvs commit: db-ojb/src/java/org/apache/ojb/broker/metadata ClassDescriptor.java
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 <br>
* 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 <em>null</em>
+ * 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 <em>null</em>
+ * 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 <em>null</em>
+ * 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