Bug 58293 - SOAP/XML-RPC Sampler file browser generates NullPointerException
Summary: SOAP/XML-RPC Sampler file browser generates NullPointerException
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.13
Hardware: PC All
: P2 major (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-28 04:19 UTC by Kenny Yu
Modified: 2015-08-28 10:32 UTC (History)
0 users



Attachments
jmeter.log (29.96 KB, text/plain)
2015-08-28 04:19 UTC, Kenny Yu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kenny Yu 2015-08-28 04:19:55 UTC
Created attachment 33044 [details]
jmeter.log

SOAP/XML-RPC Sampler file browser generates NullPointerException on click of the browse button. The stacktrace follows, log also attached

Version 2.13 r1665067
java.version=1.7.0_10

ERROR - jmeter.JMeter: Uncaught exception:  java.lang.NullPointerException
	at java.lang.String.endsWith(String.java:1429)
	at org.apache.jmeter.gui.JMeterFileFilter.accept(JMeterFileFilter.java:96)
	at org.apache.jmeter.gui.JMeterFileFilter.accept(JMeterFileFilter.java:75)
	at javax.swing.JFileChooser.setFileFilter(JFileChooser.java:1436)
	at javax.swing.JFileChooser.addChoosableFileFilter(JFileChooser.java:1135)
	at org.apache.jmeter.gui.util.FileDialoger.promptToOpenFile(FileDialoger.java:131)
	at org.apache.jmeter.gui.util.FilePanelEntry.actionPerformed(FilePanelEntry.java:141)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.Component.processMouseEvent(Component.java:6505)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
	at java.awt.Component.processEvent(Component.java:6270)
	at java.awt.Container.processEvent(Container.java:2229)
	at java.awt.Component.dispatchEventImpl(Component.java:4861)
	at java.awt.Container.dispatchEventImpl(Container.java:2287)
	at java.awt.Component.dispatchEvent(Component.java:4687)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
	at java.awt.Container.dispatchEventImpl(Container.java:2273)
	at java.awt.Window.dispatchEventImpl(Window.java:2719)
	at java.awt.Component.dispatchEvent(Component.java:4687)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:682)
	at java.awt.EventQueue$3.run(EventQueue.java:680)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:696)
	at java.awt.EventQueue$4.run(EventQueue.java:694)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Comment 1 Sebb 2015-08-28 09:37:45 UTC
I can confirm the NPE in the current development version.
It seems that the extensions list contains a null.
Not sure yet where this is coming from.
Comment 2 Sebb 2015-08-28 10:13:49 UTC
I think I've found the problem. 

The ctor FilePanelEntry(String label, ChangeListener listener, String... exts) was converted to use String ... rather than String[] a long while back.
When it is called with a null String as the final parameter, that is converted into an array with a single null entry.

Not sure why the compiler does not warn about this.
Comment 3 Sebb 2015-08-28 10:32:49 UTC
Thanks for the report, fixed here:

URL: http://svn.apache.org/r1698295
Log:
SOAP/XML-RPC Sampler file browser generates NullPointerException
Bugzilla Id: 58293

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/FilePanelEntry.java
    jmeter/trunk/xdocs/changes.xml
Comment 4 The ASF infrastructure team 2022-09-24 20:38:00 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3657