changeset 4140:7526766c86f5

RT-30836: Sorting large tables is a lot slower if your data model does not have property accessors Contributed-by: James Denvir Reviewed-by: jgiles
author jgiles
date Wed, 03 Jul 2013 12:15:46 +1200
parents 35d3fe04f57e
children 4a7255f5651e
files modules/controls/src/main/java/javafx/scene/control/cell/PropertyValueFactory.java
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/control/cell/PropertyValueFactory.java	Wed Jul 03 11:54:51 2013 +1200
+++ b/modules/controls/src/main/java/javafx/scene/control/cell/PropertyValueFactory.java	Wed Jul 03 12:15:46 2013 +1200
@@ -140,16 +140,13 @@
                 this.propertyRef = new PropertyReference<T>(rowData.getClass(), getProperty());
             }
 
-            return propertyRef.getProperty(rowData);
-        } catch (IllegalStateException e) {
-            try {
-                // attempt to just get the value
+            if (propertyRef.hasProperty()) {
+                return propertyRef.getProperty(rowData);
+            } else {
                 T value = propertyRef.get(rowData);
                 return new ReadOnlyObjectWrapper<T>(value);
-            } catch (IllegalStateException e2) {
-                // fall through to logged exception below
             }
-
+        } catch (IllegalStateException e) {
             // log the warning and move on
             final PlatformLogger logger = Logging.getControlsLogger();
             if (logger.isLoggable(Level.WARNING)) {