changeset 4516:7968d9677f9a

7072645: Toolkit.addPropertyChangeListener(name, pcl) throws NPE for null name Reviewed-by: art
author denis
date Tue, 23 Aug 2011 17:56:14 +0400
parents 3bfa183cac32
children e05ea8ab1807
files src/solaris/classes/sun/awt/X11/XToolkit.java src/windows/classes/sun/awt/windows/WToolkit.java
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/awt/X11/XToolkit.java	Wed Aug 17 22:47:37 2011 -0700
+++ b/src/solaris/classes/sun/awt/X11/XToolkit.java	Tue Aug 23 17:56:14 2011 +0400
@@ -1532,6 +1532,10 @@
     }
 
     public synchronized void addPropertyChangeListener(String name, PropertyChangeListener pcl) {
+        if (name == null) {
+            // See JavaDoc for the Toolkit.addPropertyChangeListener() method
+            return;
+        }
         initXSettingsIfNeeded(name);
         super.addPropertyChangeListener(name, pcl);
     }
--- a/src/windows/classes/sun/awt/windows/WToolkit.java	Wed Aug 17 22:47:37 2011 -0700
+++ b/src/windows/classes/sun/awt/windows/WToolkit.java	Tue Aug 23 17:56:14 2011 +0400
@@ -879,6 +879,10 @@
     }
 
     public synchronized void addPropertyChangeListener(String name, PropertyChangeListener pcl) {
+        if (name == null) {
+            // See JavaDoc for the Toolkit.addPropertyChangeListener() method
+            return;
+        }
         if ( WDesktopProperties.isWindowsProperty(name)
              || name.startsWith(awtPrefix)
              || name.startsWith(dndPrefix))