RFR: json patches introduced to the OpenJDK copy in JDK-8246435
Magnus Ihse Bursie
ihse at openjdk.java.net
Wed Jun 3 14:36:48 UTC 2020
On Wed, 3 Jun 2020 14:31:39 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> json/src/main/java/org/openjdk/skara/json/JSONArray.java line 42:
>>
>>> 41:
>>> 42: private void append(JSONValue value) {
>>> 43: if (value instanceof JSONArray) {
>>
>> Could you rename this to `concat` and explicitly take a `JSONArray` instead as parameter? I'm fine with having
>> `append`, but `append` should be just `append` (that is, append a single item to the array).
>
> To me there's no deeper semantic difference between "append" and "concat". To be precise, this method do a flattening
> append/concat, and should probably be named something like addAndFlatten to be completely unambiguous. But that kind of
> naming did not seem to fit in with the rest of the design here. If you insist that "concat" means "flatten while
> adding" but "append" does not, sure, I can rename it.
Ah, sorry, now I see what you mean. You want a concat(JSONArray a) instead. Well, it might be good to have, but that
does not really solve my problem, does it? :-)
-------------
PR: https://git.openjdk.java.net/skara/pull/636
More information about the skara-dev
mailing list