click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r930609 - /click/trunk/click/extras/src/org/apache/click/extras/cayenne/QuerySelect.java
Date Sun, 04 Apr 2010 02:31:49 GMT
Author: sabob
Date: Sun Apr  4 02:31:49 2010
New Revision: 930609

URL: http://svn.apache.org/viewvc?rev=930609&view=rev
Log:
lookup context only once, not in loop

Modified:
    click/trunk/click/extras/src/org/apache/click/extras/cayenne/QuerySelect.java

Modified: click/trunk/click/extras/src/org/apache/click/extras/cayenne/QuerySelect.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/cayenne/QuerySelect.java?rev=930609&r1=930608&r2=930609&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/cayenne/QuerySelect.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/cayenne/QuerySelect.java Sun Apr
 4 02:31:49 2010
@@ -33,6 +33,7 @@ import org.apache.cayenne.DataRow;
 import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.query.NamedQuery;
 import org.apache.cayenne.query.SelectQuery;
+import org.apache.click.Context;
 
 /**
  * Provides a Cayenne Query Select control:   <select></select>.
@@ -447,6 +448,7 @@ public class QuerySelect extends Select 
             getOptionList().add(Option.EMPTY_OPTION);
         }
 
+        Context context = getContext();
         Map cache = new HashMap();
 
         for (int i = 0; i < list.size(); i++) {
@@ -479,7 +481,7 @@ public class QuerySelect extends Select 
                     }
 
                 } else {
-                    label = getDecorator().render(dataRow, getContext());
+                    label = getDecorator().render(dataRow, context);
                 }
 
             } else {
@@ -492,7 +494,7 @@ public class QuerySelect extends Select 
                         label = PropertyUtils.getValue(row, getOptionLabel(), cache);
 
                     } else {
-                        label = getDecorator().render(row, getContext());
+                        label = getDecorator().render(row, context);
                     }
 
                 } catch (Exception e) {



Mime
View raw message