When running the OpenJDK regression tests in GUI mode (i.e. jtreg -gui), it is not possible to display the test files in the "Files" tab of a test because of the following exception:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.sun.javatest.regtest.config.Locations.<init>(Locations.java:158)
at com.sun.javatest.regtest.exec.RegressionScript.getSourceFiles(RegressionScript.java:319)
at com.sun.javatest.regtest.config.RegressionTestSuite.getFilesForTest(RegressionTestSuite.java:152)
at com.sun.javatest.exec.TP_FilesSubpanel.updateFiles(TP_FilesSubpanel.java:77)
at com.sun.javatest.exec.TP_FilesSubpanel.updateSubpanel(TP_FilesSubpanel.java:66)
at com.sun.javatest.exec.TestPanel.updateGUI(TestPanel.java:198)
at com.sun.javatest.exec.TestPanel.updateGUIWhenVisible(TestPanel.java:137)
at com.sun.javatest.exec.TestPanel.updatePanel(TestPanel.java:117)
at com.sun.javatest.exec.TestPanel.access$400(TestPanel.java:64)
at com.sun.javatest.exec.TestPanel$2.stateChanged(TestPanel.java:294)
at java.desktop/javax.swing.JTabbedPane.fireStateChanged(JTabbedPane.java:418)
at java.desktop/javax.swing.JTabbedPane$ModelListener.stateChanged(JTabbedPane.java:269)
at java.desktop/javax.swing.DefaultSingleSelectionModel.fireStateChanged(DefaultSingleSelectionModel.java:143)
at java.desktop/javax.swing.DefaultSingleSelectionModel.setSelectedIndex(DefaultSingleSelectionModel.java:74)
at java.desktop/javax.swing.JTabbedPane.setSelectedIndexImpl(JTabbedPane.java:622)
at java.desktop/javax.swing.JTabbedPane.setSelectedIndex(JTabbedPane.java:597)
at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.mousePressed(BasicTabbedPaneUI.java:4086)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6586)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
at java.desktop/java.awt.Component.processEvent(Component.java:6354)
at java.desktop/java.awt.Container.processEvent(Container.java:2260)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4966)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2318)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4906)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4532)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2304)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
The problem seems to be caused by the following code in com.sun.javatest.regtest.config.RegressionTestSuite.getFilesForTest:
RegressionParameters params = new RegressionParameters("regtest", this);
Set<File> files = new RegressionScript().getSourceFiles(params, td);
which creates a new RegressionParameters object with a 'testJDK' field set to NULL. Later in com.sun.javatest.regtest.config.Locations.<init> we call 'getTestJDK()' on the RegressionParameters object:
systemModules = params.getTestJDK().getSystemModules(params);
This will return NULL and we call 'getSystemModules(params)' on this NULL object which throws the NullPointerException.
I'm not sure why 'testJDK' is NULL here, because I've called jtreg with a valid "-testjdk" argument. I can also successfully execute the test in the GUI and look at the test results from the resulting .jtr file. The only thing that's not working is the Files tab which should display the test sources.
I'm actually not sure if this is a "jtreg" or a "jtharness" bug.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.sun.javatest.regtest.config.Locations.<init>(Locations.java:158)
at com.sun.javatest.regtest.exec.RegressionScript.getSourceFiles(RegressionScript.java:319)
at com.sun.javatest.regtest.config.RegressionTestSuite.getFilesForTest(RegressionTestSuite.java:152)
at com.sun.javatest.exec.TP_FilesSubpanel.updateFiles(TP_FilesSubpanel.java:77)
at com.sun.javatest.exec.TP_FilesSubpanel.updateSubpanel(TP_FilesSubpanel.java:66)
at com.sun.javatest.exec.TestPanel.updateGUI(TestPanel.java:198)
at com.sun.javatest.exec.TestPanel.updateGUIWhenVisible(TestPanel.java:137)
at com.sun.javatest.exec.TestPanel.updatePanel(TestPanel.java:117)
at com.sun.javatest.exec.TestPanel.access$400(TestPanel.java:64)
at com.sun.javatest.exec.TestPanel$2.stateChanged(TestPanel.java:294)
at java.desktop/javax.swing.JTabbedPane.fireStateChanged(JTabbedPane.java:418)
at java.desktop/javax.swing.JTabbedPane$ModelListener.stateChanged(JTabbedPane.java:269)
at java.desktop/javax.swing.DefaultSingleSelectionModel.fireStateChanged(DefaultSingleSelectionModel.java:143)
at java.desktop/javax.swing.DefaultSingleSelectionModel.setSelectedIndex(DefaultSingleSelectionModel.java:74)
at java.desktop/javax.swing.JTabbedPane.setSelectedIndexImpl(JTabbedPane.java:622)
at java.desktop/javax.swing.JTabbedPane.setSelectedIndex(JTabbedPane.java:597)
at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.mousePressed(BasicTabbedPaneUI.java:4086)
at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6586)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
at java.desktop/java.awt.Component.processEvent(Component.java:6354)
at java.desktop/java.awt.Container.processEvent(Container.java:2260)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4966)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2318)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4906)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4532)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2304)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4798)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
The problem seems to be caused by the following code in com.sun.javatest.regtest.config.RegressionTestSuite.getFilesForTest:
RegressionParameters params = new RegressionParameters("regtest", this);
Set<File> files = new RegressionScript().getSourceFiles(params, td);
which creates a new RegressionParameters object with a 'testJDK' field set to NULL. Later in com.sun.javatest.regtest.config.Locations.<init> we call 'getTestJDK()' on the RegressionParameters object:
systemModules = params.getTestJDK().getSystemModules(params);
This will return NULL and we call 'getSystemModules(params)' on this NULL object which throws the NullPointerException.
I'm not sure why 'testJDK' is NULL here, because I've called jtreg with a valid "-testjdk" argument. I can also successfully execute the test in the GUI and look at the test results from the resulting .jtr file. The only thing that's not working is the Files tab which should display the test sources.
I'm actually not sure if this is a "jtreg" or a "jtharness" bug.