United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6681889 JSN security test headline/noWarningApp failed with NPE exception
JDK-6681889 : JSN security test headline/noWarningApp failed with NPE exception

Details
Type:
Bug
Submit Date:
2008-03-31
Status:
Closed
Updated Date:
2011-05-17
Project Name:
JDK
Resolved Date:
2011-05-17
Component:
client-libs
OS:
generic
Sub-Component:
java.awt
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Backport:
Relates:

Sub Tasks

Description
JSN security test headline/noWarningApp failed with NPE exception, but it can PASS with JDK 7.0 promoted b24. It should be a regression. 

Exception message :
java.lang.NullPointerException
	at java.awt.Component.firePropertyChange(Component.java:8011)
	at java.awt.Component.setFont(Component.java:1692)
	at java.awt.Container.setFont(Container.java:1616)
	at sun.awt.X11.XWindowPeer.preInit(XWindowPeer.java:163)
	at sun.awt.X11.XDecoratedPeer.preInit(XDecoratedPeer.java:75)
	at sun.awt.X11.XFramePeer.preInit(XFramePeer.java:62)
	at sun.awt.X11.XBaseWindow.init(XBaseWindow.java:183)
	at sun.awt.X11.XBaseWindow.<init>(XBaseWindow.java:261)
	at sun.awt.X11.XWindow.<init>(XWindow.java:125)
	at sun.awt.X11.XComponentPeer.<init>(XComponentPeer.java:115)
	at sun.awt.X11.XCanvasPeer.<init>(XCanvasPeer.java:43)
	at sun.awt.X11.XPanelPeer.<init>(XPanelPeer.java:46)
	at sun.awt.X11.XWindowPeer.<init>(XWindowPeer.java:110)
	at sun.awt.X11.XDecoratedPeer.<init>(XDecoratedPeer.java:59)
	at sun.awt.X11.XFramePeer.<init>(XFramePeer.java:54)
	at sun.awt.X11.XToolkit.createFrame(XToolkit.java:358)
	at java.awt.Frame.addNotify(Frame.java:476)
	at java.awt.Window.show(Window.java:892)
	at MakeFrameApp.init(MakeFrameApp.java:24)
	at sun.applet.AppletPanel.run(AppletPanel.java:435)
	at java.lang.Thread.run(Thread.java:674)

More info at : http://sqeweb.sfbay/net/sqenfs-1/export1/comp/jsn/keep_forbug/results-jsn-sb2500-2-08-03-30-20-33/results/mg145366.SunOS.sparc/noWarningApp/noWarningApp.err

To reproduce this bug , please just do step by step in Doit.sh.

                                    

Comments
EVALUATION

I have not tried to run the test, but from the code it looks like a regression from fix 6608764
(PropertyChangeListeners machinery should have a better locking scheme).  The fix has introduced
new transient field changeSupportLock, but this field is not initiallized in readObject().
                                     
2008-03-31
SUGGESTED FIX

--- old/src/share/classes/java/awt/Component.java	2008-04-01 12:32:22.000000000 +0400
+++ new/src/share/classes/java/awt/Component.java	2008-04-01 12:32:21.000000000 +0400
@@ -634,7 +634,9 @@
      */
     private PropertyChangeSupport changeSupport;
 
-    private transient final Object changeSupportLock = new Object();
+    // Note: this field is considered final, though readObject() prohibits
+    // initializing final fields.
+    private transient Object changeSupportLock = new Object();
     private Object getChangeSupportLock() {
         return changeSupportLock;
     }
@@ -8437,6 +8439,8 @@
                 popup.parent = this;
             }
         }
+
+        changeSupportLock = new Object();
     }
 
     /**
                                     
2008-04-01



Hardware and Software, Engineered to Work Together