You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by th...@apache.org on 2014/05/24 21:18:38 UTC

[1/4] git commit: Closes #2305: @Sortable annotation

Repository: tapestry-5
Updated Branches:
  refs/heads/5.3 a0ac605db -> 7485d9167


Closes #2305: @Sortable annotation


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

Branch: refs/heads/5.3
Commit: 985675b2086b860a6467b27e76dcd247b288c66b
Parents: a0ac605
Author: Thiago H. de Paula Figueiredo <th...@apache.org>
Authored: Mon Mar 24 17:39:38 2014 -0300
Committer: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
Committed: Sat May 24 15:51:52 2014 -0300

----------------------------------------------------------------------
 .../apache/tapestry5/beaneditor/Sortable.java   | 43 ++++++++++++++++++++
 1 file changed, 43 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/985675b2/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/Sortable.java
----------------------------------------------------------------------
diff --git a/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/Sortable.java b/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/Sortable.java
new file mode 100644
index 0000000..823bbf8
--- /dev/null
+++ b/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/Sortable.java
@@ -0,0 +1,43 @@
+// Copyright 2014 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.beaneditor;
+
+import static org.apache.tapestry5.ioc.annotations.AnnotationUseContext.BEAN;
+import static org.apache.tapestry5.ioc.annotations.AnnotationUseContext.COMPONENT;
+import static org.apache.tapestry5.ioc.annotations.AnnotationUseContext.MIXIN;
+import static org.apache.tapestry5.ioc.annotations.AnnotationUseContext.PAGE;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.tapestry5.ioc.annotations.UseWith;
+
+/**
+ * Used to explicitly define whether a property should be considerable sortable or not.
+ * If this annotation isn't used, then the property will be considered sortable only if
+ * its type implements {@link Comparable}.
+ * This annotation may be attached to a getter or setter method, or the matching field.
+ */
+@Target({ ElementType.FIELD, ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@UseWith({BEAN,COMPONENT,MIXIN,PAGE})
+public @interface Sortable
+{
+    boolean value();
+}


[4/4] git commit: Fixes an NPE in PropertyModelImpl

Posted by th...@apache.org.
Fixes an NPE in PropertyModelImpl

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

Branch: refs/heads/5.3
Commit: 7485d91671ff33cb2f45cfc7aa69822fccc9426a
Parents: 2dbf880
Author: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
Authored: Sat May 24 16:17:17 2014 -0300
Committer: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
Committed: Sat May 24 16:17:17 2014 -0300

----------------------------------------------------------------------
 .../apache/tapestry5/internal/beaneditor/PropertyModelImpl.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7485d916/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..0cd041c 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,7 +53,7 @@ public class PropertyModelImpl implements PropertyModel
         label = TapestryInternalUtils.defaultLabel(id, messages, name);
 
         // TAP5-2305
-        Sortable sortableAnnotation = conduit.getAnnotation(Sortable.class);
+        Sortable sortableAnnotation = conduit != null ? conduit.getAnnotation(Sortable.class) : null;
         if (sortableAnnotation != null) 
         {
             sortable = sortableAnnotation.value();


[2/4] git commit: Closes #2305: @Sortable annotation

Posted by th...@apache.org.
Closes #2305: @Sortable annotation


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

Branch: refs/heads/5.3
Commit: bc3f56fc3c8857276fa9908a09010acff8437178
Parents: 985675b
Author: Thiago H. de Paula Figueiredo <th...@apache.org>
Authored: Mon Mar 24 17:34:45 2014 -0300
Committer: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
Committed: Sat May 24 15:52:13 2014 -0300

----------------------------------------------------------------------
 .../internal/beaneditor/PropertyModelImpl.java  | 22 +++++---
 .../services/BeanModelSourceImplTest.java       | 58 ++++++++++++++++++++
 2 files changed, 73 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/bc3f56fc/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 e9ee3ec..3edfaff 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
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008, 2010, 2011 The Apache Software Foundation
+// Copyright 2007, 2008, 2010, 2011, 2014 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@ package org.apache.tapestry5.internal.beaneditor;
 import org.apache.tapestry5.PropertyConduit;
 import org.apache.tapestry5.beaneditor.BeanModel;
 import org.apache.tapestry5.beaneditor.PropertyModel;
+import org.apache.tapestry5.beaneditor.Sortable;
 import org.apache.tapestry5.internal.TapestryInternalUtils;
 import org.apache.tapestry5.ioc.Messages;
 import org.apache.tapestry5.ioc.internal.util.InternalUtils;
@@ -51,12 +52,19 @@ public class PropertyModelImpl implements PropertyModel
 
         label = TapestryInternalUtils.defaultLabel(id, messages, name);
 
-        // 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);
+        // TAP5-2305
+        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);
+        }
     }
 
     public String getId()

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/bc3f56fc/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BeanModelSourceImplTest.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BeanModelSourceImplTest.java b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BeanModelSourceImplTest.java
index 40300ed..17c9480 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BeanModelSourceImplTest.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BeanModelSourceImplTest.java
@@ -18,6 +18,7 @@ import org.apache.tapestry5.PropertyConduit;
 import org.apache.tapestry5.beaneditor.BeanModel;
 import org.apache.tapestry5.beaneditor.PropertyModel;
 import org.apache.tapestry5.beaneditor.RelativePosition;
+import org.apache.tapestry5.beaneditor.Sortable;
 import org.apache.tapestry5.internal.PropertyOrderBean;
 import org.apache.tapestry5.internal.test.InternalBaseTestCase;
 import org.apache.tapestry5.internal.transform.pages.ReadOnlyBean;
@@ -693,4 +694,61 @@ public class BeanModelSourceImplTest extends InternalBaseTestCase
 
         verify();
     }
+    
+    // https://issues.apache.org/jira/browse/TAP5-2305
+    @Test
+    public void sortable_annotation() 
+    {
+        Messages messages = mockMessages();
+
+        stub_contains(messages, false);
+
+        replay();
+
+        BeanModel<SortableBean> model = source.createDisplayModel(SortableBean.class,  messages);
+        model.add("nonSortableByDefault");
+        model.add("sortable");
+        
+        // checking whether non-@Sortable annotated properties still behave in the old ways
+        assertTrue(model.get("sortableByDefault").isSortable());
+        assertFalse(model.get("nonSortableByDefault").isSortable());
+        
+        // checking @Sortable itself
+        assertFalse(model.get("nonSortable").isSortable());
+        assertTrue(model.get("sortable").isSortable());
+
+        verify();
+    }
+    
+    final private static class SortableBean
+    {
+        private int sortableByDefault;
+        private int nonSortable;
+        private SimpleBean sortable;
+        private SimpleBean nonSortableByDefault;
+        
+        public int getSortableByDefault()
+        {
+            return sortableByDefault;
+        }
+        
+        @Sortable(false)
+        public int getNonSortable()
+        {
+            return nonSortable;
+        }
+        
+        @Sortable(true)
+        public SimpleBean getSortable()
+        {
+            return sortable;
+        }
+        
+        public SimpleBean getNonSortableByDefault()
+        {
+            return nonSortableByDefault;
+        }
+        
+    }
+    
 }


[3/4] git commit: Changing captcha library to be the same as Tapestry 5.4.

Posted by th...@apache.org.
Changing captcha library to be the same as Tapestry 5.4.

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

Branch: refs/heads/5.3
Commit: 2dbf880226924ada64991c92dfc2ee61fbc71813
Parents: bc3f56f
Author: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
Authored: Sat May 24 16:02:20 2014 -0300
Committer: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
Committed: Sat May 24 16:02:20 2014 -0300

----------------------------------------------------------------------
 tapestry-kaptcha/build.gradle | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2dbf8802/tapestry-kaptcha/build.gradle
----------------------------------------------------------------------
diff --git a/tapestry-kaptcha/build.gradle b/tapestry-kaptcha/build.gradle
index be8fded..3dd4c43 100644
--- a/tapestry-kaptcha/build.gradle
+++ b/tapestry-kaptcha/build.gradle
@@ -1,16 +1,12 @@
-description = "Kaptcha image support"
+description = "Kaptcha user verification support"
 
 dependencies {
     compile project(':tapestry-core')
-    compile "com.google.code.kaptcha:kaptcha:2.3"
+    compile "com.github.axet:kaptcha:0.0.8"
     
     testCompile project(':tapestry-test')
 }
 
-repositories {
-  mavenRepo name: "HLS", url: "http://howardlewisship.com/repository/"
-}
-
 jar {
     manifest {
         attributes 'Tapestry-Module-Classes': 'org.apache.tapestry5.kaptcha.services.KaptchaModule'


[3/4] git commit: Changing captcha library to be the same as Tapestry 5.4.

Posted by th...@apache.org.
Changing captcha library to be the same as Tapestry 5.4.

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

Branch: refs/heads/5.3
Commit: 2dbf880226924ada64991c92dfc2ee61fbc71813
Parents: bc3f56f
Author: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
Authored: Sat May 24 16:02:20 2014 -0300
Committer: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
Committed: Sat May 24 16:02:20 2014 -0300

----------------------------------------------------------------------
 tapestry-kaptcha/build.gradle | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2dbf8802/tapestry-kaptcha/build.gradle
----------------------------------------------------------------------
diff --git a/tapestry-kaptcha/build.gradle b/tapestry-kaptcha/build.gradle
index be8fded..3dd4c43 100644
--- a/tapestry-kaptcha/build.gradle
+++ b/tapestry-kaptcha/build.gradle
@@ -1,16 +1,12 @@
-description = "Kaptcha image support"
+description = "Kaptcha user verification support"
 
 dependencies {
     compile project(':tapestry-core')
-    compile "com.google.code.kaptcha:kaptcha:2.3"
+    compile "com.github.axet:kaptcha:0.0.8"
     
     testCompile project(':tapestry-test')
 }
 
-repositories {
-  mavenRepo name: "HLS", url: "http://howardlewisship.com/repository/"
-}
-
 jar {
     manifest {
         attributes 'Tapestry-Module-Classes': 'org.apache.tapestry5.kaptcha.services.KaptchaModule'


[4/4] git commit: Fixes an NPE in PropertyModelImpl

Posted by th...@apache.org.
Fixes an NPE in PropertyModelImpl

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

Branch: refs/heads/5.3
Commit: 7485d91671ff33cb2f45cfc7aa69822fccc9426a
Parents: 2dbf880
Author: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
Authored: Sat May 24 16:17:17 2014 -0300
Committer: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
Committed: Sat May 24 16:17:17 2014 -0300

----------------------------------------------------------------------
 .../apache/tapestry5/internal/beaneditor/PropertyModelImpl.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7485d916/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..0cd041c 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,7 +53,7 @@ public class PropertyModelImpl implements PropertyModel
         label = TapestryInternalUtils.defaultLabel(id, messages, name);
 
         // TAP5-2305
-        Sortable sortableAnnotation = conduit.getAnnotation(Sortable.class);
+        Sortable sortableAnnotation = conduit != null ? conduit.getAnnotation(Sortable.class) : null;
         if (sortableAnnotation != null) 
         {
             sortable = sortableAnnotation.value();


[2/4] git commit: Closes #2305: @Sortable annotation

Posted by th...@apache.org.
Closes #2305: @Sortable annotation


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

Branch: refs/heads/5.3
Commit: bc3f56fc3c8857276fa9908a09010acff8437178
Parents: 985675b
Author: Thiago H. de Paula Figueiredo <th...@apache.org>
Authored: Mon Mar 24 17:34:45 2014 -0300
Committer: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
Committed: Sat May 24 15:52:13 2014 -0300

----------------------------------------------------------------------
 .../internal/beaneditor/PropertyModelImpl.java  | 22 +++++---
 .../services/BeanModelSourceImplTest.java       | 58 ++++++++++++++++++++
 2 files changed, 73 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/bc3f56fc/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 e9ee3ec..3edfaff 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
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008, 2010, 2011 The Apache Software Foundation
+// Copyright 2007, 2008, 2010, 2011, 2014 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@ package org.apache.tapestry5.internal.beaneditor;
 import org.apache.tapestry5.PropertyConduit;
 import org.apache.tapestry5.beaneditor.BeanModel;
 import org.apache.tapestry5.beaneditor.PropertyModel;
+import org.apache.tapestry5.beaneditor.Sortable;
 import org.apache.tapestry5.internal.TapestryInternalUtils;
 import org.apache.tapestry5.ioc.Messages;
 import org.apache.tapestry5.ioc.internal.util.InternalUtils;
@@ -51,12 +52,19 @@ public class PropertyModelImpl implements PropertyModel
 
         label = TapestryInternalUtils.defaultLabel(id, messages, name);
 
-        // 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);
+        // TAP5-2305
+        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);
+        }
     }
 
     public String getId()

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/bc3f56fc/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BeanModelSourceImplTest.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BeanModelSourceImplTest.java b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BeanModelSourceImplTest.java
index 40300ed..17c9480 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BeanModelSourceImplTest.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BeanModelSourceImplTest.java
@@ -18,6 +18,7 @@ import org.apache.tapestry5.PropertyConduit;
 import org.apache.tapestry5.beaneditor.BeanModel;
 import org.apache.tapestry5.beaneditor.PropertyModel;
 import org.apache.tapestry5.beaneditor.RelativePosition;
+import org.apache.tapestry5.beaneditor.Sortable;
 import org.apache.tapestry5.internal.PropertyOrderBean;
 import org.apache.tapestry5.internal.test.InternalBaseTestCase;
 import org.apache.tapestry5.internal.transform.pages.ReadOnlyBean;
@@ -693,4 +694,61 @@ public class BeanModelSourceImplTest extends InternalBaseTestCase
 
         verify();
     }
+    
+    // https://issues.apache.org/jira/browse/TAP5-2305
+    @Test
+    public void sortable_annotation() 
+    {
+        Messages messages = mockMessages();
+
+        stub_contains(messages, false);
+
+        replay();
+
+        BeanModel<SortableBean> model = source.createDisplayModel(SortableBean.class,  messages);
+        model.add("nonSortableByDefault");
+        model.add("sortable");
+        
+        // checking whether non-@Sortable annotated properties still behave in the old ways
+        assertTrue(model.get("sortableByDefault").isSortable());
+        assertFalse(model.get("nonSortableByDefault").isSortable());
+        
+        // checking @Sortable itself
+        assertFalse(model.get("nonSortable").isSortable());
+        assertTrue(model.get("sortable").isSortable());
+
+        verify();
+    }
+    
+    final private static class SortableBean
+    {
+        private int sortableByDefault;
+        private int nonSortable;
+        private SimpleBean sortable;
+        private SimpleBean nonSortableByDefault;
+        
+        public int getSortableByDefault()
+        {
+            return sortableByDefault;
+        }
+        
+        @Sortable(false)
+        public int getNonSortable()
+        {
+            return nonSortable;
+        }
+        
+        @Sortable(true)
+        public SimpleBean getSortable()
+        {
+            return sortable;
+        }
+        
+        public SimpleBean getNonSortableByDefault()
+        {
+            return nonSortableByDefault;
+        }
+        
+    }
+    
 }