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

PSM-442 Add AmbiguousJsonCreatorCheck #2

Merged
merged 3 commits into from
Mar 1, 2021
Merged

Conversation

hisener
Copy link
Contributor

@hisener hisener commented Jun 1, 2020

The error prone check that is mentioned in https://github.com/PicnicSupermarket/picnic-java-support-modules/pull/601. But I am not sure if we should merge this. 🤔

@Stephan202
Copy link
Member

Didn't scrutinize the code too much yet, but looks clean. Before I dig in: what would be a reason for not merging this? :)

@hisener
Copy link
Contributor Author

hisener commented Jun 1, 2020

Two reasons:

  1. Correctness. JsonCreator.Mode.DELEGATING might be correct for Picnic code but there might a 3rd party system that uses object serialization/deserialization for a single field enum. We could just flag the issue without providing a fix. 🤔
  2. I couldn't prove this check covers all cases.

@Stephan202
Copy link
Member

Something's better than nothing in this case, I think :)

@hisener
Copy link
Contributor Author

hisener commented Jun 2, 2020

Then, reviews are more than welcome.

@Stephan202
Copy link
Member

On the list :)

@hisener
Copy link
Contributor Author

hisener commented Jul 17, 2020

Rebased.

@Stephan202
Copy link
Member

Rebased and added a small commit following a look I had yesterday. Should focus on other stuff today, but as you can see I have not forgotten :)

Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

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

Rebased and added a commit. Suggested commit message:

PSM-442 Flag likely-wrong `@JsonCreator` usages (#2)

Will merge if you're okay with the changes.

Comment on lines 10 to 13
.expectErrorMessage(
"X",
Predicates.containsPattern(
"JsonCreator.Mode should be set for single-argument creators"));
Copy link
Member

Choose a reason for hiding this comment

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

This is really cool; should also do this elsewhere.

Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

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

Rebased. @hisener okay to merge? :)

@hisener
Copy link
Contributor Author

hisener commented Mar 1, 2021

I think it's fine to merge. It's no-op anyway.

@Stephan202 Stephan202 merged commit cbc886d into master Mar 1, 2021
@Stephan202 Stephan202 deleted the hsener/PSM-442 branch March 1, 2021 17:50
@Stephan202 Stephan202 added this to the 0.1.0 milestone Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants