changeset 4559:44141ce2c9ea

7072645: Toolkit.addPropertyChangeListener(name, pcl) throws NPE for null name Reviewed-by: art
author denis
date Wed, 24 Aug 2011 19:49:39 +0400
parents be4a3afb7438
children 55cd74a4d575
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	Tue Aug 23 10:53:41 2011 -0700
+++ b/src/solaris/classes/sun/awt/X11/XToolkit.java	Wed Aug 24 19:49:39 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	Tue Aug 23 10:53:41 2011 -0700
+++ b/src/windows/classes/sun/awt/windows/WToolkit.java	Wed Aug 24 19:49:39 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))