Bug 57389

Summary: Potential NPE in converters
Product: JMeter Reporter: Felix Schumacher <felix.schumacher>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: trivial    
Priority: P2    
Version: 2.12   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Fix potential NPE in converters

Description Felix Schumacher 2014-12-22 18:27:48 UTC
Created attachment 32320 [details]
Fix potential NPE in converters

in the converters in org.apache.jmeter.save.converters there are a few possible NPE. In the method canConvert(Class) often the implementation looks like

 "return arg0.equals(SomeClass.class)"

without arg0 being checked for non-null.

I would reverse the logic to

 "return SomeClass.class.equals(arg0)"

This is null safe and should return the same values (apart from possible NPE).
Comment 1 Felix Schumacher 2014-12-22 18:35:54 UTC
Date: Mon Dec 22 18:33:59 2014
New Revision: 1647367

URL: http://svn.apache.org/r1647367
Log:
Bug 57389: Fix potential NPE in org.apache.jmeter.save.converters
Bugzilla Id: 57389

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/save/converters/BooleanPropertyConverter.java
    jmeter/trunk/src/core/org/apache/jmeter/save/converters/IntegerPropertyConverter.java
    jmeter/trunk/src/core/org/apache/jmeter/save/converters/LongPropertyConverter.java
    jmeter/trunk/src/core/org/apache/jmeter/save/converters/MultiPropertyConverter.java
    jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleSaveConfigurationConverter.java
    jmeter/trunk/src/core/org/apache/jmeter/save/converters/TestElementPropertyConverter.java
    jmeter/trunk/src/core/org/apache/jmeter/save/converters/TestResultWrapperConverter.java
    jmeter/trunk/xdocs/changes.xml