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){ public Object getMapValue(Object obj, String key, boolean throwOnMissing){
Map m = (Map) obj; Map m = (Map) obj;
if(!m.containsKey(key)){ if(!m.containsKey(key) && throwOnMissing){
throw new PathNotFoundException("Property ['" + key + "'] not found in the current context" ); throw new PathNotFoundException("Property ['" + key + "'] not found in the current context" );
} else { } else {
return m.get(key); return m.get(key);

Loading…
Cancel
Save