changeset 4161:a73c4b0d2bd7

RT-31227 InvalidationListener not being always properly removed upon .removeListener()
author Martin Sladecek <martin.sladecek@oracle.com>
date Wed, 03 Jul 2013 15:01:31 +0200
parents 57c32ccb4f62
children e9e6bb046dcb
files modules/base/src/main/java/com/sun/javafx/binding/ExpressionHelper.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/base/src/main/java/com/sun/javafx/binding/ExpressionHelper.java	Tue Jul 02 22:50:57 2013 -0400
+++ b/modules/base/src/main/java/com/sun/javafx/binding/ExpressionHelper.java	Wed Jul 03 15:01:31 2013 +0200
@@ -249,7 +249,7 @@
                             final InvalidationListener[] oldListeners = invalidationListeners;
                             if (locked) {
                                 invalidationListeners = new InvalidationListener[invalidationListeners.length];
-                                System.arraycopy(oldListeners, 0, invalidationListeners, 0, index+1);
+                                System.arraycopy(oldListeners, 0, invalidationListeners, 0, index);
                             }
                             if (numMoved > 0) {
                                 System.arraycopy(oldListeners, index+1, invalidationListeners, index, numMoved);
@@ -309,7 +309,7 @@
                             final ChangeListener<? super T>[] oldListeners = changeListeners;
                             if (locked) {
                                 changeListeners = new ChangeListener[changeListeners.length];
-                                System.arraycopy(oldListeners, 0, changeListeners, 0, index+1);
+                                System.arraycopy(oldListeners, 0, changeListeners, 0, index);
                             }
                             if (numMoved > 0) {
                                 System.arraycopy(oldListeners, index+1, changeListeners, index, numMoved);