Skip to content
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

Merged
merged 3 commits into from
Jun 3, 2020

Conversation

SomkaPe
Copy link
Contributor

@SomkaPe SomkaPe commented Jun 2, 2020

@@ -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);
Copy link
Contributor

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?

Copy link
Contributor Author

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"));
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

@sangonzal sangonzal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.*;
Copy link
Contributor

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.

@SomkaPe SomkaPe merged commit 6deb186 into dev Jun 3, 2020
@siddhijain siddhijain deleted the pesomka/versionsD branch January 19, 2022 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to acquire token Instance discovery fails in Azure Databricks 6.4
4 participants