srowen commented on a change in pull request #23419: [SPARK-26507][CORE] Fix
core tests for Java 11
URL: https://github.com/apache/spark/pull/23419#discussion_r244555393
##########
File path: core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala
##########
@@ -761,13 +761,13 @@ private[spark] object JsonProtocolSuite extends
Assertions {
}
private def assertJsonStringEquals(expected: String, actual: String,
metadata: String) {
- val expectedJson = pretty(parse(expected))
- val actualJson = pretty(parse(actual))
+ val expectedJson = parse(expected)
+ val actualJson = parse(actual)
if (expectedJson != actualJson) {
// scalastyle:off
// This prints something useful if the JSON strings don't match
- println("=== EXPECTED ===\n" + expectedJson + "\n")
- println("=== ACTUAL ===\n" + actualJson + "\n")
+ println(s"=== EXPECTED ===\n${pretty(expectedJson)}\n")
Review comment:
The implementation of `Properties`, based on `Hashtable`, is returning
elements in a different order in Java 11. Just comparing the actual JSON
content rather than its string representation shows it still produces
semantically correct output, so I changed the test.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]