changeset 7853:44cac66ba3ed

RT-38165 "A bound value cannot be set" exception should print the name of the property that is causing the problem
author Martin Sladecek <martin.sladecek@oracle.com>
date Tue, 26 Aug 2014 14:23:27 +0200
parents e282fa2c4093
children 0c4d4cf6cb87
files modules/base/src/main/java/javafx/beans/property/BooleanPropertyBase.java modules/base/src/main/java/javafx/beans/property/DoublePropertyBase.java modules/base/src/main/java/javafx/beans/property/FloatPropertyBase.java modules/base/src/main/java/javafx/beans/property/IntegerPropertyBase.java modules/base/src/main/java/javafx/beans/property/ListPropertyBase.java modules/base/src/main/java/javafx/beans/property/LongPropertyBase.java modules/base/src/main/java/javafx/beans/property/MapPropertyBase.java modules/base/src/main/java/javafx/beans/property/ObjectPropertyBase.java modules/base/src/main/java/javafx/beans/property/SetPropertyBase.java modules/base/src/main/java/javafx/beans/property/StringPropertyBase.java
diffstat 10 files changed, 20 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/modules/base/src/main/java/javafx/beans/property/BooleanPropertyBase.java	Tue Aug 26 11:16:42 2014 +0200
+++ b/modules/base/src/main/java/javafx/beans/property/BooleanPropertyBase.java	Tue Aug 26 14:23:27 2014 +0200
@@ -136,7 +136,8 @@
     @Override
     public void set(boolean newValue) {
         if (isBound()) {
-            throw new java.lang.RuntimeException("A bound value cannot be set.");
+            throw new java.lang.RuntimeException((getBean() != null && getName() != null ?
+                    getBean().getClass().getSimpleName() + "." + getName() + " : ": "") + "A bound value cannot be set.");
         }
         if (value != newValue) {
             value = newValue;
--- a/modules/base/src/main/java/javafx/beans/property/DoublePropertyBase.java	Tue Aug 26 11:16:42 2014 +0200
+++ b/modules/base/src/main/java/javafx/beans/property/DoublePropertyBase.java	Tue Aug 26 14:23:27 2014 +0200
@@ -139,7 +139,8 @@
     @Override
     public void set(double newValue) {
         if (isBound()) {
-            throw new java.lang.RuntimeException("A bound value cannot be set.");
+            throw new java.lang.RuntimeException((getBean() != null && getName() != null ?
+                    getBean().getClass().getSimpleName() + "." + getName() + " : ": "") + "A bound value cannot be set.");
         }
         if (value != newValue) {
             value = newValue;
--- a/modules/base/src/main/java/javafx/beans/property/FloatPropertyBase.java	Tue Aug 26 11:16:42 2014 +0200
+++ b/modules/base/src/main/java/javafx/beans/property/FloatPropertyBase.java	Tue Aug 26 14:23:27 2014 +0200
@@ -139,7 +139,8 @@
     @Override
     public void set(float newValue) {
         if (isBound()) {
-            throw new java.lang.RuntimeException("A bound value cannot be set.");
+            throw new java.lang.RuntimeException((getBean() != null && getName() != null ?
+                    getBean().getClass().getSimpleName() + "." + getName() + " : ": "") + "A bound value cannot be set.");
         }
         if (value != newValue) {
             value = newValue;
--- a/modules/base/src/main/java/javafx/beans/property/IntegerPropertyBase.java	Tue Aug 26 11:16:42 2014 +0200
+++ b/modules/base/src/main/java/javafx/beans/property/IntegerPropertyBase.java	Tue Aug 26 14:23:27 2014 +0200
@@ -139,7 +139,8 @@
     @Override
     public void set(int newValue) {
         if (isBound()) {
-            throw new java.lang.RuntimeException("A bound value cannot be set.");
+            throw new java.lang.RuntimeException((getBean() != null && getName() != null ?
+                    getBean().getClass().getSimpleName() + "." + getName() + " : ": "") + "A bound value cannot be set.");
         }
         if (value != newValue) {
             value = newValue;
--- a/modules/base/src/main/java/javafx/beans/property/ListPropertyBase.java	Tue Aug 26 11:16:42 2014 +0200
+++ b/modules/base/src/main/java/javafx/beans/property/ListPropertyBase.java	Tue Aug 26 14:23:27 2014 +0200
@@ -248,7 +248,8 @@
     @Override
     public void set(ObservableList<E> newValue) {
         if (isBound()) {
-            throw new java.lang.RuntimeException("A bound value cannot be set.");
+            throw new java.lang.RuntimeException((getBean() != null && getName() != null ?
+                    getBean().getClass().getSimpleName() + "." + getName() + " : ": "") + "A bound value cannot be set.");
         }
         if (value != newValue) {
             final ObservableList<E> oldValue = value;
--- a/modules/base/src/main/java/javafx/beans/property/LongPropertyBase.java	Tue Aug 26 11:16:42 2014 +0200
+++ b/modules/base/src/main/java/javafx/beans/property/LongPropertyBase.java	Tue Aug 26 14:23:27 2014 +0200
@@ -139,7 +139,8 @@
     @Override
     public void set(long newValue) {
         if (isBound()) {
-            throw new java.lang.RuntimeException("A bound value cannot be set.");
+            throw new java.lang.RuntimeException((getBean() != null && getName() != null ?
+                    getBean().getClass().getSimpleName() + "." + getName() + " : ": "") + "A bound value cannot be set.");
         }
         if (value != newValue) {
             value = newValue;
--- a/modules/base/src/main/java/javafx/beans/property/MapPropertyBase.java	Tue Aug 26 11:16:42 2014 +0200
+++ b/modules/base/src/main/java/javafx/beans/property/MapPropertyBase.java	Tue Aug 26 14:23:27 2014 +0200
@@ -250,7 +250,8 @@
     @Override
     public void set(ObservableMap<K, V> newValue) {
         if (isBound()) {
-            throw new RuntimeException("A bound value cannot be set.");
+            throw new java.lang.RuntimeException((getBean() != null && getName() != null ?
+                    getBean().getClass().getSimpleName() + "." + getName() + " : ": "") + "A bound value cannot be set.");
         }
         if (value != newValue) {
             final ObservableMap<K, V> oldValue = value;
--- a/modules/base/src/main/java/javafx/beans/property/ObjectPropertyBase.java	Tue Aug 26 11:16:42 2014 +0200
+++ b/modules/base/src/main/java/javafx/beans/property/ObjectPropertyBase.java	Tue Aug 26 14:23:27 2014 +0200
@@ -138,7 +138,8 @@
     @Override
     public void set(T newValue) {
         if (isBound()) {
-            throw new java.lang.RuntimeException("A bound value cannot be set.");
+            throw new java.lang.RuntimeException((getBean() != null && getName() != null ?
+                    getBean().getClass().getSimpleName() + "." + getName() + " : ": "") + "A bound value cannot be set.");
         }
         if (value != newValue) {
             value = newValue;
--- a/modules/base/src/main/java/javafx/beans/property/SetPropertyBase.java	Tue Aug 26 11:16:42 2014 +0200
+++ b/modules/base/src/main/java/javafx/beans/property/SetPropertyBase.java	Tue Aug 26 14:23:27 2014 +0200
@@ -250,7 +250,8 @@
     @Override
     public void set(ObservableSet<E> newValue) {
         if (isBound()) {
-            throw new RuntimeException("A bound value cannot be set.");
+            throw new java.lang.RuntimeException((getBean() != null && getName() != null ?
+                    getBean().getClass().getSimpleName() + "." + getName() + " : ": "") + "A bound value cannot be set.");
         }
         if (value != newValue) {
             final ObservableSet<E> oldValue = value;
--- a/modules/base/src/main/java/javafx/beans/property/StringPropertyBase.java	Tue Aug 26 11:16:42 2014 +0200
+++ b/modules/base/src/main/java/javafx/beans/property/StringPropertyBase.java	Tue Aug 26 14:23:27 2014 +0200
@@ -136,7 +136,8 @@
     @Override
     public void set(String newValue) {
         if (isBound()) {
-            throw new java.lang.RuntimeException("A bound value cannot be set.");
+            throw new java.lang.RuntimeException((getBean() != null && getName() != null ?
+                    getBean().getClass().getSimpleName() + "." + getName() + " : ": "") + "A bound value cannot be set.");
         }
         if ((value == null)? newValue != null : !value.equals(newValue)) {
             value = newValue;