I have the following (working code) with old JSONObject jar
String title = "title";
return new JSONObject()
.put("title", title).put("url", null)));
When I start using the latest jar from JSON-java
I get a compile error
The method put(String, Collection<?>) is ambiguous for the type JSONObject
I found an issue that suggest using JSONObject.NULL instead of null
This library has a distinct JSONObject.NULL constant that is used to store JSON null values. It is deliberate. The Java null value is treated in this library like JavaScript undefined.
While not part of the specification, I can't see us undoing this as it would break backwards compatibility.
But there's no middle way to support both JSON versions?
Should a bug be open for support backward for JSON-java project or am I missing something or just using unsupported old version?