changeset 4162:e9e6bb046dcb

Fixed the same issue as reported in RT-31227 in collection listener helpers
author Martin Sladecek <martin.sladecek@oracle.com>
date Wed, 03 Jul 2013 15:04:42 +0200
parents a73c4b0d2bd7
children 8a72ef8eb502 b4b7cc4c182a
files modules/base/src/main/java/com/sun/javafx/collections/ListListenerHelper.java modules/base/src/main/java/com/sun/javafx/collections/MapListenerHelper.java modules/base/src/main/java/com/sun/javafx/collections/SetListenerHelper.java
diffstat 3 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/modules/base/src/main/java/com/sun/javafx/collections/ListListenerHelper.java	Wed Jul 03 15:01:31 2013 +0200
+++ b/modules/base/src/main/java/com/sun/javafx/collections/ListListenerHelper.java	Wed Jul 03 15:04:42 2013 +0200
@@ -224,7 +224,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);
@@ -281,7 +281,7 @@
                             final ListChangeListener<? super E>[] oldListeners = changeListeners;
                             if (locked) {
                                 changeListeners = new ListChangeListener[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);
--- a/modules/base/src/main/java/com/sun/javafx/collections/MapListenerHelper.java	Wed Jul 03 15:01:31 2013 +0200
+++ b/modules/base/src/main/java/com/sun/javafx/collections/MapListenerHelper.java	Wed Jul 03 15:04:42 2013 +0200
@@ -223,7 +223,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);
@@ -280,7 +280,7 @@
                             final MapChangeListener<? super K, ? super V>[] oldListeners = changeListeners;
                             if (locked) {
                                 changeListeners = new MapChangeListener[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);
--- a/modules/base/src/main/java/com/sun/javafx/collections/SetListenerHelper.java	Wed Jul 03 15:01:31 2013 +0200
+++ b/modules/base/src/main/java/com/sun/javafx/collections/SetListenerHelper.java	Wed Jul 03 15:04:42 2013 +0200
@@ -223,7 +223,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);
@@ -280,7 +280,7 @@
                             final SetChangeListener<? super E>[] oldListeners = changeListeners;
                             if (locked) {
                                 changeListeners = new SetChangeListener[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);