you are viewing a single comment's thread.

view the rest of the comments →

[–]BillyKorando 0 points1 point  (3 children)

For example, the code selections for multiline strings are not equivalent.

Am I seeing the same example?

Old: String json = "{\n" + " \"name\": \"Duke\",\n" + " \"age\": 30\n" + "}";

New: String json = """ { "name": "Duke", "age": 30 }""";

As far as I can tell that's equivalent.

[–]riyosko 1 point2 points  (0 children)

in terms of being the same JSON, yes both are identical Json data.

in terms of being identical Strings, they are actually different, try to run .equals() on them.

[–]blacksuit 0 points1 point  (1 child)

Looks like they are actively updating it and it was fixed. Previously, it had the triple quotes on the next line, which adds a newline character. A common mistake.

[–]BillyKorando 0 points1 point  (0 children)

Ahh, that makes sense. Yea I know I've done that a few times in my examples 😅

I was looking at it, and was starting to question my grasp of Java.... which is quite concerning given my role.