tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkemn...@apache.org
Subject [1/2] git commit: fix a NullPointerException when the conduit is null, e.g. when BeanModel.addEmpty(String) is used
Date Fri, 02 May 2014 08:01:11 GMT
Repository: tapestry-5
Updated Branches:
  refs/heads/master b97d9aa36 -> 7294f9bcb


fix a NullPointerException when the conduit is null, e.g. when BeanModel.addEmpty(String)
is used


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/a7b45565
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/a7b45565
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/a7b45565

Branch: refs/heads/master
Commit: a7b455651f22aa7cf82c20e2bdb6ef145bfd1ca6
Parents: b97d9aa
Author: Jochen Kemnade <jochen.kemnade@eddyson.de>
Authored: Fri May 2 09:59:34 2014 +0200
Committer: Jochen Kemnade <jochen.kemnade@eddyson.de>
Committed: Fri May 2 09:59:34 2014 +0200

----------------------------------------------------------------------
 .../internal/beaneditor/PropertyModelImpl.java  | 23 +++++++++++---------
 1 file changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/a7b45565/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/PropertyModelImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/PropertyModelImpl.java
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/PropertyModelImpl.java
index 3edfaff..703ce44 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/PropertyModelImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/PropertyModelImpl.java
@@ -53,17 +53,20 @@ public class PropertyModelImpl implements PropertyModel
         label = TapestryInternalUtils.defaultLabel(id, messages, name);
 
         // TAP5-2305
-        Sortable sortableAnnotation = conduit.getAnnotation(Sortable.class);
-        if (sortableAnnotation != null) 
+        if (conduit != null)
         {
-            sortable = sortableAnnotation.value();
-        }
-        else
-        {
-            // Primitive types need to be converted to wrapper types before checking to see
-            // if they are sortable.
-            Class wrapperType = PlasticUtils.toWrapperType(getPropertyType());
-            sortable = Comparable.class.isAssignableFrom(wrapperType);
+            Sortable sortableAnnotation = conduit.getAnnotation(Sortable.class);
+            if (sortableAnnotation != null)
+            {
+                sortable = sortableAnnotation.value();
+            }
+            else
+            {
+                // Primitive types need to be converted to wrapper types before checking
to see
+                // if they are sortable.
+                Class wrapperType = PlasticUtils.toWrapperType(getPropertyType());
+                sortable = Comparable.class.isAssignableFrom(wrapperType);
+            }
         }
     }
 


Mime
View raw message