[
https://issues.apache.org/jira/browse/GOBBLIN-2158?focusedWorklogId=935123&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-935123
]
ASF GitHub Bot logged work on GOBBLIN-2158:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 18/Sep/24 05:28
Start Date: 18/Sep/24 05:28
Worklog Time Spent: 10m
Work Description: 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
Issue Time Tracking
-------------------
Worklog Id: (was: 935123)
Time Spent: 1h 50m (was: 1h 40m)
> Upgrade GSON version to 2.8.9
> -----------------------------
>
> Key: GOBBLIN-2158
> URL: https://issues.apache.org/jira/browse/GOBBLIN-2158
> Project: Apache Gobblin
> Issue Type: Task
> Reporter: Vivek Rai
> Priority: Major
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> Upgrade GSON version to 2.8.9 and add a custom ObjectToIntegerDeserialize
> policy to avoid getting integer converted to double or long while deserialize.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)