changeset 4460:2baf612764d2 jdk7u1-b02

7068047: DnDMerlinQLTestsuite_DnDJTextArea test fails with an java.awt.dnd.InvalidDnDOperationException Reviewed-by: art
author denis
date Fri, 22 Jul 2011 20:44:55 +0400
parents 7f3b478e628b
children a4781b6d9cfb
files src/share/classes/java/awt/AWTKeyStroke.java
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/awt/AWTKeyStroke.java	Fri Jul 15 10:25:28 2011 -0700
+++ b/src/share/classes/java/awt/AWTKeyStroke.java	Fri Jul 22 20:44:55 2011 +0400
@@ -805,7 +805,11 @@
      */
     protected Object readResolve() throws java.io.ObjectStreamException {
         synchronized (AWTKeyStroke.class) {
-            registerSubclass(getAWTKeyStrokeClass());
+            Class newClass = getClass();
+            Class awtKeyStrokeClass = getAWTKeyStrokeClass();
+            if (!newClass.equals(awtKeyStrokeClass)) {
+                registerSubclass(newClass);
+            }
             return getCachedStroke(keyChar, keyCode, modifiers, onKeyRelease);
         }
     }