Skip to content

compatibility with jackson 2.6.7 and json-smart 1.3.1#242

Merged
SomkaPe merged 3 commits intodevfrom
pesomka/versionsD
Jun 3, 2020
Merged

compatibility with jackson 2.6.7 and json-smart 1.3.1#242
SomkaPe merged 3 commits intodevfrom
pesomka/versionsD

Conversation

@SomkaPe
Copy link
Copy Markdown
Contributor

@SomkaPe SomkaPe commented Jun 2, 2020

return mapper.readValue(json, clazz);
} catch (JsonProcessingException e) {
} catch (IOException e) {
throw new RuntimeException("JsonProcessingException: " + e.getMessage(), e);
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@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