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

Preserve zero decimal (backport to 2.9.x) #839

Merged
merged 3 commits into from
Jan 23, 2023

Conversation

trbogart
Copy link

@trbogart trbogart commented Jan 17, 2023

Pull Request Checklist

  • Updated documentation in code
  • Have you added tests for any changed functionality?

Fixes

See #831 for more information. This backports that to 2.9.x.

@trbogart trbogart changed the title Preserve zero decimal 2.9.x Preserve zero decimal (backport to 2.9.x) Jan 17, 2023
@trbogart trbogart marked this pull request as draft January 17, 2023 21:50
@trbogart trbogart force-pushed the preserveZeroDecimal-2.9.x branch from 481e661 to 78c69cb Compare January 17, 2023 22:01
@trbogart trbogart changed the base branch from main to 2.9.x January 17, 2023 22:02
@trbogart trbogart marked this pull request as ready for review January 17, 2023 22:28
@ihostage ihostage closed this Jan 20, 2023
@ihostage ihostage reopened this Jan 20, 2023
@mkurz
Copy link
Member

mkurz commented Jan 20, 2023

@trbogart
First: You need to run sbt headerCreateAll to pass the "code style" checks.
Second: There are binary incompatibles, see https://github.com/playframework/play-json/actions/runs/3967093076/jobs/6798660172, not sure if we are able to backport this pull request, @gmethvin What do you think?

@trbogart You would need to add following filters to https://github.com/playframework/play-json/blob/main/build.sbt#L53-L59 to the 2.9.x branch's build.sbt if we want to get this merged:

[error] play-json: Failed binary compatibility check against com.typesafe.play:play-json_2.12:2.9.3! Found 22 potential problems
[error]  * method parse(java.lang.String,play.api.libs.json.JsonParserSettings)play.api.libs.json.JsResult in object play.api.libs.json.BigDecimalParser's type is different in current version, where it is (java.lang.String,play.api.libs.json.JsonConfig)play.api.libs.json.JsResult instead of (java.lang.String,play.api.libs.json.JsonParserSettings)play.api.libs.json.JsResult
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("play.api.libs.json.BigDecimalParser.parse")
[error]  * static method parse(java.lang.String,play.api.libs.json.JsonParserSettings)play.api.libs.json.JsResult in class play.api.libs.json.BigDecimalParser's type is different in current version, where it is (java.lang.String,play.api.libs.json.JsonConfig)play.api.libs.json.JsResult instead of (java.lang.String,play.api.libs.json.JsonParserSettings)play.api.libs.json.JsResult
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("play.api.libs.json.BigDecimalParser.parse")
[error]  * method parseJsValue(Array[Byte])play.api.libs.json.JsValue in object play.api.libs.json.jackson.JacksonJson does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.libs.json.jackson.JacksonJson.parseJsValue")
[error]  * method parseJsValue(java.lang.String)play.api.libs.json.JsValue in object play.api.libs.json.jackson.JacksonJson does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.libs.json.jackson.JacksonJson.parseJsValue")
[error]  * method parseJsValue(java.io.InputStream)play.api.libs.json.JsValue in object play.api.libs.json.jackson.JacksonJson does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.libs.json.jackson.JacksonJson.parseJsValue")
[error]  * method generateFromJsValue(play.api.libs.json.JsValue,Boolean)java.lang.String in object play.api.libs.json.jackson.JacksonJson does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.libs.json.jackson.JacksonJson.generateFromJsValue")
[error]  * method prettyPrint(play.api.libs.json.JsValue)java.lang.String in object play.api.libs.json.jackson.JacksonJson does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.libs.json.jackson.JacksonJson.prettyPrint")
[error]  * method jsValueToBytes(play.api.libs.json.JsValue)Array[Byte] in object play.api.libs.json.jackson.JacksonJson does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.libs.json.jackson.JacksonJson.jsValueToBytes")
[error]  * method jsValueToJsonNode(play.api.libs.json.JsValue)com.fasterxml.jackson.databind.JsonNode in object play.api.libs.json.jackson.JacksonJson does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.libs.json.jackson.JacksonJson.jsValueToJsonNode")
[error]  * method jsonNodeToJsValue(com.fasterxml.jackson.databind.JsonNode)play.api.libs.json.JsValue in object play.api.libs.json.jackson.JacksonJson does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("play.api.libs.json.jackson.JacksonJson.jsonNodeToJsValue")
[error]  * method this(com.fasterxml.jackson.databind.type.TypeFactory,java.lang.Class,play.api.libs.json.JsonParserSettings)Unit in class play.api.libs.json.jackson.JsValueDeserializer's type is different in current version, where it is (com.fasterxml.jackson.databind.type.TypeFactory,java.lang.Class,play.api.libs.json.JsonConfig)Unit instead of (com.fasterxml.jackson.databind.type.TypeFactory,java.lang.Class,play.api.libs.json.JsonParserSettings)Unit
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("play.api.libs.json.jackson.JsValueDeserializer.this")
[error]  * method this(play.api.libs.json.JsonParserSettings)Unit in class play.api.libs.json.jackson.JsValueSerializer's type is different in current version, where it is (play.api.libs.json.JsonConfig)Unit instead of (play.api.libs.json.JsonParserSettings)Unit
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("play.api.libs.json.jackson.JsValueSerializer.this")
[error]  * method this(play.api.libs.json.JsonParserSettings)Unit in class play.api.libs.json.jackson.PlayDeserializers's type is different in current version, where it is (play.api.libs.json.JsonConfig)Unit instead of (play.api.libs.json.JsonParserSettings)Unit
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("play.api.libs.json.jackson.PlayDeserializers.this")
[error]  * static method jsonNodeToJsValue(com.fasterxml.jackson.databind.JsonNode)play.api.libs.json.JsValue in class play.api.libs.json.jackson.JacksonJson is non-static in current version
[error]    filter with: ProblemFilters.exclude[StaticVirtualMemberProblem]("play.api.libs.json.jackson.JacksonJson.jsonNodeToJsValue")
[error]  * static method jsValueToJsonNode(play.api.libs.json.JsValue)com.fasterxml.jackson.databind.JsonNode in class play.api.libs.json.jackson.JacksonJson is non-static in current version
[error]    filter with: ProblemFilters.exclude[StaticVirtualMemberProblem]("play.api.libs.json.jackson.JacksonJson.jsValueToJsonNode")
[error]  * static method jsValueToBytes(play.api.libs.json.JsValue)Array[Byte] in class play.api.libs.json.jackson.JacksonJson is non-static in current version
[error]    filter with: ProblemFilters.exclude[StaticVirtualMemberProblem]("play.api.libs.json.jackson.JacksonJson.jsValueToBytes")
[error]  * static method prettyPrint(play.api.libs.json.JsValue)java.lang.String in class play.api.libs.json.jackson.JacksonJson is non-static in current version
[error]    filter with: ProblemFilters.exclude[StaticVirtualMemberProblem]("play.api.libs.json.jackson.JacksonJson.prettyPrint")
[error]  * static method generateFromJsValue(play.api.libs.json.JsValue,Boolean)java.lang.String in class play.api.libs.json.jackson.JacksonJson is non-static in current version
[error]    filter with: ProblemFilters.exclude[StaticVirtualMemberProblem]("play.api.libs.json.jackson.JacksonJson.generateFromJsValue")
[error]  * static method parseJsValue(java.io.InputStream)play.api.libs.json.JsValue in class play.api.libs.json.jackson.JacksonJson is non-static in current version
[error]    filter with: ProblemFilters.exclude[StaticVirtualMemberProblem]("play.api.libs.json.jackson.JacksonJson.parseJsValue")
[error]  * static method parseJsValue(java.lang.String)play.api.libs.json.JsValue in class play.api.libs.json.jackson.JacksonJson is non-static in current version
[error]    filter with: ProblemFilters.exclude[StaticVirtualMemberProblem]("play.api.libs.json.jackson.JacksonJson.parseJsValue")
[error]  * static method parseJsValue(Array[Byte])play.api.libs.json.JsValue in class play.api.libs.json.jackson.JacksonJson is non-static in current version
[error]    filter with: ProblemFilters.exclude[StaticVirtualMemberProblem]("play.api.libs.json.jackson.JacksonJson.parseJsValue")
[error]  * method this(play.api.libs.json.JsonParserSettings)Unit in class play.api.libs.json.jackson.PlaySerializers's type is different in current version, where it is (play.api.libs.json.JsonConfig)Unit instead of (play.api.libs.json.JsonParserSettings)Unit
[error]    filter with: ProblemFilters.exclude[IncompatibleMethTypeProblem]("play.api.libs.json.jackson.PlaySerializers.this")

@gmethvin
Copy link
Member

@mkurz The changed methods are all package-private, not part of the public API, so they should be ok to change. We just need to add the filters.

@mkurz
Copy link
Member

mkurz commented Jan 20, 2023

@gmethvin OK cool, I didn't check the diff actually 😉

@gmethvin
Copy link
Member

Yeah, there were actually a lot of useful changes here to make it easier to evolve these APIs in a binary-compatible way in the future as well.

@gmethvin gmethvin merged commit 43f7a61 into playframework:2.9.x Jan 23, 2023
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.

Double values with 0 fraction written without fraction
4 participants