Luan XML parser doesn't properly handle empty string

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Luan XML parser doesn't properly handle empty string

danilafoxpro
When trying to parse an empty string, XML parser throws the following:
java.lang.NullPointerException
	at luan.modules.parsers.Xml.addElements(Xml.java:97)
	at luan.modules.parsers.Xml.parse(Xml.java:90)
In the same case, JSON parser produces a clearer error:
goodjava.parser.ParseException: invalid value (position 1)

^
Difference is that Goodjava JSON parser throws an exception when empty string is passed to it. Goodjava XML parser returns 'null' in that case, which is not properly handled by 'src/luan/modules/parsers/Xml.java'. I would fix it myself, but I don't know if Luan XML parser should just forward the 'null' returned by the Goodjava XML parser or should there be an exception thrown in case an empty string is passed.
Reply | Threaded
Open this post in threaded view
|

Re: Luan XML parser doesn't properly handle empty string

fschmidt
Administrator