Bug 62767 - NPE when searching under certain conditions
Summary: NPE when searching under certain conditions
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 5.0
Hardware: All All
: P2 regression (vote)
Target Milestone: JMETER_5.1
Assignee: JMeter issues mailing list
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2018-09-27 17:14 UTC by Philippe Mouawad
Modified: 2018-10-02 08:34 UTC (History)
2 users (show)



Attachments
Test plan to reproduce (2.17 KB, application/xml)
2018-09-27 17:14 UTC, Philippe Mouawad
Details
jmx that reproduce error when replacing text (3.49 KB, application/xml)
2018-10-02 06:09 UTC, orimarko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Mouawad 2018-09-27 17:14:40 UTC
Created attachment 36167 [details]
Test plan to reproduce

See:

- https://stackoverflow.com/questions/52512367/jmeter-5-failed-to-replace-text


Open plan:
Open Search
Type test in Search field
Click Search All

You get:
2018-09-27 19:11:29,509 ERROR o.a.j.JMeter: Uncaught exception: 
java.lang.NullPointerException: null
	at org.apache.jmeter.gui.tree.JMeterTreeNode.setMarkedBySearch(JMeterTreeNode.java:119) ~[ApacheJMeter_core.jar:5.0 r1840935]
	at org.apache.jmeter.gui.action.SearchTreeDialog.markConcernedNodes(SearchTreeDialog.java:388) ~[ApacheJMeter_core.jar:5.0 r1840935]
	at org.apache.jmeter.gui.action.SearchTreeDialog.doSearch(SearchTreeDialog.java:334) ~[ApacheJMeter_core.jar:5.0 r1840935]
	at org.apache.jmeter.gui.action.SearchTreeDialog.actionPerformed(SearchTreeDialog.java:242) ~[ApacheJMeter_core.jar:5.0 r1840935]
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967) ~[?:?]
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308) ~[?:?]
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) ~[?:?]
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) ~[?:?]
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:270) ~[?:?]
	at java.awt.Component.processMouseEvent(Component.java:6589) ~[?:?]
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3342) ~[?:?]
	at java.awt.Component.processEvent(Component.java:6354) ~[?:?]
	at java.awt.Container.processEvent(Container.java:2261) ~[?:?]
	at java.awt.Component.dispatchEventImpl(Component.java:4966) ~[?:?]
	at java.awt.Container.dispatchEventImpl(Container.java:2319) ~[?:?]
	at java.awt.Component.dispatchEvent(Component.java:4798) ~[?:?]
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4914) ~[?:?]
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4543) ~[?:?]
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4484) ~[?:?]
	at java.awt.Container.dispatchEventImpl(Container.java:2305) ~[?:?]
	at java.awt.Window.dispatchEventImpl(Window.java:2772) ~[?:?]
	at java.awt.Component.dispatchEvent(Component.java:4798) ~[?:?]
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772) ~[?:?]
	at java.awt.EventQueue.access$600(EventQueue.java:97) ~[?:?]
	at java.awt.EventQueue$4.run(EventQueue.java:721) ~[?:?]
	at java.awt.EventQueue$4.run(EventQueue.java:715) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) ~[?:?]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) ~[?:?]
	at java.awt.EventQueue$5.run(EventQueue.java:745) ~[?:?]
	at java.awt.EventQueue$5.run(EventQueue.java:743) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) ~[?:?]
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:742) ~[?:?]
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?]
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?]
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?]
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?]
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?]
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?]
Comment 1 Philippe Mouawad 2018-09-27 17:22:54 UTC
Author: pmouawad
Date: Thu Sep 27 17:20:36 2018
New Revision: 1842124

URL: http://svn.apache.org/viewvc?rev=1842124&view=rev
Log:
Bug 62767 - NPE when searching under certain conditions
Contributed by UbikLoadPack
Bugzilla Id: 62767

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/tree/JMeterTreeNode.java
    jmeter/trunk/xdocs/changes.xml
Comment 2 orimarko 2018-10-02 06:09:58 UTC
Created attachment 36181 [details]
jmx that reproduce error when replacing text
Comment 3 orimarko 2018-10-02 06:10:38 UTC
reproduce issue  in r1842362, errors:

2018-10-02 09:05:16,599 ERROR o.a.j.JMeter: Uncaught exception: 
java.lang.ArrayIndexOutOfBoundsException: null


018-10-02 09:04:55,121 ERROR o.a.j.JMeter: Uncaught exception: 
java.lang.ArrayIndexOutOfBoundsException: -1
	at java.util.ArrayList.elementData(Unknown Source) ~[?:1.8.0_151]
	at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_151]
	at org.apache.jmeter.gui.action.SearchTreeDialog.doReplace(SearchTreeDialog.java:263) ~[ApacheJMeter_core.jar:r1842362]
	at org.apache.jmeter.gui.action.SearchTreeDialog.actionPerformed(SearchTreeDialog.java:249) ~[ApacheJMeter_core.jar:r1842362]
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) ~[?:1.8.0_151]
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) ~[?:1.8.0_151]
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) ~[?:1.8.0_151]
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source) ~[?:1.8.0_151]
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) ~[?:1.8.0_151]
	at java.awt.Component.processMouseEvent(Unknown Source) ~[?:1.8.0_151]
	at javax.swing.JComponent.processMouseEvent(Unknown Source) ~[?:1.8.0_151]
	at java.awt.Component.processEvent(Unknown Source) ~[?:1.8.0_151]
	at java.awt.Container.processEvent(Unknown Source) ~[?:1.8.0_151]
	at java.awt.Component.dispatchEventImpl(Unknown Source) ~[?:1.8.0_151]
	at java.awt.Container.dispatchEventImpl(Unknown Source) ~[?:1.8.0_151]
	at java.awt.Component.dispatchEvent(Unknown Source) ~[?:1.8.0_151]
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) ~[?:1.8.0_151]
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) ~[?:1.8.0_151]
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) ~[?:1.8.0_151]
	at java.awt.Container.dispatchEventImpl(Unknown Source) ~[?:1.8.0_151]
	at java.awt.Window.dispatchEventImpl(Unknown Source) ~[?:1.8.0_151]
	at java.awt.Component.dispatchEvent(Unknown Source) ~[?:1.8.0_151]
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source) ~[?:1.8.0_151]
Comment 4 Philippe Mouawad 2018-10-02 08:05:14 UTC
(In reply to orimarko from comment #3)
> reproduce issue  in r1842362, errors:
> 
> 2018-10-02 09:05:16,599 ERROR o.a.j.JMeter: Uncaught exception: 
> java.lang.ArrayIndexOutOfBoundsException: null
> 
> 
> 018-10-02 09:04:55,121 ERROR o.a.j.JMeter: Uncaught exception: 
> java.lang.ArrayIndexOutOfBoundsException: -1
> 	at java.util.ArrayList.elementData(Unknown Source) ~[?:1.8.0_151]
> 	at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_151]
> 	at
> org.apache.jmeter.gui.action.SearchTreeDialog.doReplace(SearchTreeDialog.
> java:263) ~[ApacheJMeter_core.jar:r1842362]
> 	at
> org.apache.jmeter.gui.action.SearchTreeDialog.
> actionPerformed(SearchTreeDialog.java:249) ~[ApacheJMeter_core.jar:r1842362]
> 	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
> ~[?:1.8.0_151]
> 	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
> ~[?:1.8.0_151]
> 	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
> ~[?:1.8.0_151]
> 	at javax.swing.DefaultButtonModel.setPressed(Unknown Source) ~[?:1.8.0_151]
> 	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
> ~[?:1.8.0_151]
> 	at java.awt.Component.processMouseEvent(Unknown Source) ~[?:1.8.0_151]
> 	at javax.swing.JComponent.processMouseEvent(Unknown Source) ~[?:1.8.0_151]
> 	at java.awt.Component.processEvent(Unknown Source) ~[?:1.8.0_151]
> 	at java.awt.Container.processEvent(Unknown Source) ~[?:1.8.0_151]
> 	at java.awt.Component.dispatchEventImpl(Unknown Source) ~[?:1.8.0_151]
> 	at java.awt.Container.dispatchEventImpl(Unknown Source) ~[?:1.8.0_151]
> 	at java.awt.Component.dispatchEvent(Unknown Source) ~[?:1.8.0_151]
> 	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
> ~[?:1.8.0_151]
> 	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
> ~[?:1.8.0_151]
> 	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
> ~[?:1.8.0_151]
> 	at java.awt.Container.dispatchEventImpl(Unknown Source) ~[?:1.8.0_151]
> 	at java.awt.Window.dispatchEventImpl(Unknown Source) ~[?:1.8.0_151]
> 	at java.awt.Component.dispatchEvent(Unknown Source) ~[?:1.8.0_151]
> 	at java.awt.EventQueue.dispatchEventImpl(Unknown Source) ~[?:1.8.0_151]

Hello,
Thanks for update.

Can you give me the scenario to reproduce ?

I am unable to reproduce using your JMX file. What sequences of actions should be done ?

Thanks
Comment 5 orimarko 2018-10-02 08:11:28 UTC
Scenario to reproduce:

1. Click Search 
2. Add  "text" to Search Field
3. Click Search All (find 1 occurrence)
4. Click Replace 

Also when Click Replace & Find
Comment 6 Philippe Mouawad 2018-10-02 08:34:16 UTC
(In reply to orimarko from comment #5)
> Scenario to reproduce:
> 
> 1. Click Search 
> 2. Add  "text" to Search Field
> 3. Click Search All (find 1 occurrence)
> 4. Click Replace 
> 
> Also when Click Replace & Find

Thanks for scenario, I opened Bug 62790 as it is different in fact.

You'll be able to test tomorrow.

Thanks