-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compatibility with jackson 2.6.7 and json-smart 1.3.1 #242
Conversation
@@ -24,7 +24,7 @@ | |||
static <T> T convertJsonToObject(final String json, final Class<T> clazz) { | |||
try { | |||
return mapper.readValue(json, clazz); | |||
} catch (JsonProcessingException e) { | |||
} catch (IOException e) { | |||
throw new RuntimeException("JsonProcessingException: " + e.getMessage(), e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JsonProcessingException [](start = 40, length = 23)
nit: consider changing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point - going to change message
} | ||
|
||
long expiresIn = 0; | ||
if (jsonObject.containsKey("expires_in")) { | ||
expiresIn = jsonObject.getAsNumber("expires_in").longValue(); | ||
expiresIn = Long.parseLong(jsonObject.getAsString("expires_in")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long.parseLong( [](start = 24, length = 15)
should this have been a mthod in the JSONObjectUtils instead? to align behavior and parsing logic in one place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but that method expects json value as JSON number, so fails if it is string. AAD returns those values as JSON number, B2C as JSON String, so can not rely on JSONObjectUtils
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://google.github.io/styleguide/javaguide.html#s3.3.1-wildcard-imports. This is shared by most style guides.
Intellij defaults to this, but you can update it.
#240
#213