We are observing a bug in the
JSONUtils.stripQuotes( String input ) method.
While creating a json string from a map and if there is a single quote in the map as value, this method is throwing Exception since the following if loop is valid
if( input.startsWith( SINGLE_QUOTE ) && input.endsWith( SINGLE_QUOTE ) )
and the subsequent statement is
input.substring( 1, input.length() - 1 ); which will fail since the length is 1.
I'm not sure whether this is fixed in teh latest version.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
We are observing a bug in the
JSONUtils.stripQuotes( String input ) method.
While creating a json string from a map and if there is a single quote in the map as value, this method is throwing Exception since the following if loop is valid
if( input.startsWith( SINGLE_QUOTE ) && input.endsWith( SINGLE_QUOTE ) )
and the subsequent statement is
input.substring( 1, input.length() - 1 ); which will fail since the length is 1.
I'm not sure whether this is fixed in teh latest version.
Hi Narayanan,
It is indeed a bug in 1.x, it has been fixed in 2.x
Cheers,
Andres