Browse Source

Improved type safety and performance in JsonProvider.

pull/41/head
Kalle Stenflo 11 years ago
parent
commit
080d68717a
  1. 2
      json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/AbstractJsonProvider.java

2
json-path/src/main/java/com/jayway/jsonpath/internal/spi/json/AbstractJsonProvider.java

@ -84,7 +84,7 @@ public abstract class AbstractJsonProvider implements JsonProvider {
*/
public Object getMapValue(Object obj, String key, boolean throwOnMissing){
Map m = (Map) obj;
if(!m.containsKey(key)){
if(!m.containsKey(key) && throwOnMissing){
throw new PathNotFoundException("Property ['" + key + "'] not found in the current context" );
} else {
return m.get(key);

Loading…
Cancel
Save