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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/io/jsonwebtoken/impl/DefaultJwtParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class DefaultJwtParser implements JwtParser {
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)

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

private static final ObjectMapper objectMapper = new ObjectMapper();

private byte[] keyBytes;

Expand Down