Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-RC2, 1.0
-
Fix Version/s: 1.3.3
-
Labels:None
-
Environment:windows xp pro sp2
-
Testcase included:yes
-
Number of attachments :
Description
There needs to be a guard for NPE.
getTextLength() below causes an NPE. I have been through this with a debugger and reader is NOT null. This should return 0 like getTextOffset() does.
AbstractXMLStreamReader reader = null;
try {
reader = new MappedXMLStreamReader(jsonObject);
System.out.println("Version: " + reader.getVersion());
System.out.println("Count: " + reader.getAttributeCount());
while (reader.hasNext())
} finally
{ reader.close(); }As String: {"device-types":{"device-type":[
{"@type-key":"WiFiStation","$":"WiFi Device"},
{"@type-key":"MultispectralTag","$":"Multispectral Tag"},
{"@type-key":"WiFiTag","$":"WiFi Tag"},
{"@type-key":"V2PanGoTag","$":"PanGo V2 Tag"},
{"@type-key":"PassiveTag","$":"Passive Tag"},
{"@type-key":"VERSUS_BADGE","$":"Versus Badge"},
{"@type-key":"V3PanGoTag","$":"PanGo V3 Tag"},
{"@type-key":"InnerWirelessTag","$":"InnerWireless Tag"}]}}
Version: null
Count: 0
************************
Element Text: null
Local Name: device-types
Text Start Offset: 0