Blazer-007 commented on PR #4057:
URL: https://github.com/apache/gobblin/pull/4057#issuecomment-2357529306
@pratapaditya04 this is the default implementation of LONG_OR_DOUBLE enum
policy present in the library
```
LONG_OR_DOUBLE {
@Override public Number readNumber(JsonReader in) throws IOException,
JsonParseException {
String value = in.nextString();
try {
return Long.parseLong(value);
} catch (NumberFormatException longE) {
try {
Double d = Double.valueOf(value);
if ((d.isInfinite() || d.isNaN()) && !in.isLenient()) {
throw new MalformedJsonException("JSON forbids NaN and infinities:
" + d + "; at path " + in.getPath());
}
return d;
} catch (NumberFormatException doubleE) {
throw new JsonParseException("Cannot parse " + value + "; at path "
+ in.getPath(), doubleE);
}
}
}
},
```
I have tried to just add one more layer on top to parse Int that's why
exception and naming i have kept similar to library implementation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]