public static boolean isRealLocation(JsonLocation jsonLocation) {
return (jsonLocation != null) && (jsonLocation != JsonLocation.NA);
}
public static JsonMappingException maybeImproveLocation(JsonLocation wrapLoc, JsonMappingException cause) {
JsonLocation exLoc = cause.getLocation();
if (isRealLocation(wrapLoc) && !isRealLocation(exLoc)) {
if (wrapLoc.getSourceRef() instanceof ConfigValue) {
ConfigValue locRef = (ConfigValue) wrapLoc.getSourceRef();
List<JsonMappingException.Reference> paths = cause.getPath();
for (JsonMappingException.Reference path : paths) {