db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/query QueryByCriteria.java
Date Tue, 06 Dec 2005 15:17:40 GMT
arminw      2005/12/06 07:17:40

  Modified:    src/java/org/apache/ojb/broker/query Tag: OJB_1_0_RELEASE
                        QueryByCriteria.java
  Log:
  remove redundat Map#put(...) call, minor improvements
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.26.2.3  +8 -11     db-ojb/src/java/org/apache/ojb/broker/query/QueryByCriteria.java
  
  Index: QueryByCriteria.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/QueryByCriteria.java,v
  retrieving revision 1.26.2.2
  retrieving revision 1.26.2.3
  diff -u -r1.26.2.2 -r1.26.2.3
  --- QueryByCriteria.java	4 Dec 2005 15:05:59 -0000	1.26.2.2
  +++ QueryByCriteria.java	6 Dec 2005 15:17:40 -0000	1.26.2.3
  @@ -190,16 +190,14 @@
        */
       public void addPathClass(String aPath, Class aClass)
       {
  -        Object pathClasses = m_pathClasses.get(aPath);
  +        List pathClasses = (List) m_pathClasses.get(aPath);
           if(pathClasses == null)
           {
  -            setPathClass(aPath,aClass);
  +            setPathClass(aPath, aClass);
           }
           else
           {
  -            List hints = (List)pathClasses;
  -            hints.add(aClass);
  -            m_pathClasses.put(aPath, hints);
  +            pathClasses.add(aClass);
           }
       }
   
  @@ -217,7 +215,7 @@
        */
       public void setPathClass(String aPath, Class aClass)
       {
  -        List pathClasses = new ArrayList(1);
  +        List pathClasses = new ArrayList();
           pathClasses.add(aClass);
           m_pathClasses.put(aPath, pathClasses);
       }
  @@ -280,12 +278,11 @@
       public String toString()
       {
           StringBuffer buf = new StringBuffer("QueryByCriteria from ");
  -        buf.append(getSearchClass() + " ");
  +        buf.append(getSearchClass()).append(" ");
           if (getCriteria() != null && !getCriteria().isEmpty())
           {
  -            buf.append(" where " + getCriteria());
  +            buf.append(" where ").append(getCriteria());
           }
  -
           return buf.toString();
       }
   
  @@ -505,7 +502,7 @@
       {
           return m_pathOuterJoins;
       }
  -    
  +
       public String getObjectProjectionAttribute()
       {
           return m_objectProjectionAttribute;
  @@ -536,4 +533,4 @@
           m_objectProjectionAttribute = objectProjectionAttribute;
           m_searchClass = objectProjectionClass;
   	}
  -}
  +}
  \ No newline at end of file
  
  
  

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