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

make_objectmapper_static #203

Closed
wants to merge 1 commit into from
Closed

make_objectmapper_static #203

wants to merge 1 commit into from

Conversation

wasifaleem
Copy link

Makes ObjectMapper static in DefaultJwtParser.
See: http://wiki.fasterxml.com/JacksonBestPracticesPerformance

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 96ea956 on wasifaleem:make_objectmapper_static into 5c0cfdc on jwtk:master.

@@ -59,7 +59,7 @@
private static final String ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
private static final int MILLISECONDS_PER_SECOND = 1000;

private ObjectMapper objectMapper = new ObjectMapper();
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure we want to do this - it might be configurable in the future to configure a parser with its own objectmapper instance (e.g. for pretty printing or whatever)

@@ -59,7 +59,7 @@
private static final String ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
private static final int MILLISECONDS_PER_SECOND = 1000;

private ObjectMapper objectMapper = new ObjectMapper();

Choose a reason for hiding this comment

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

I agree with @lhazlewood
It'd be better to be able to set the ObjectMapper. That being said, it is currently not the case and I would say it would be better to be consistant throught the different classes.

If the static is added though, please rename to OBJECT_MAPPER

@lhazlewood
Copy link
Contributor

This has been resolved via #344

@lhazlewood lhazlewood closed this Jul 20, 2018
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.

None yet

4 participants