mmj2
mmj2 copied to clipboard
Deprecated methods
There are several places where deprecated methods are being used.
For example: "final Double d = new Double(value);"
The suggested correction is: "final Double d = Double.valueOf(value);"
I am willing to make these changes and submit a pull request from my fork. Is this worthwhile doing? Will it be accepted? Thanks.
Other examples:
"this.put(key, new Integer(value));"
"this.put(index, new Long(value));"
Try not to use anything that doesn't work on JDK 1.5, but otherwise this should be fine.
The Installation instructions say "We recommend JDK version 11 (at least) to run." Should it be backward compatible to JDK 1.5?
In Eclipse IDE, there is a preference to set "compiler compliance level" to 1.5, 11, or 14 and things in between. Is this the setting I should change?
It is definitely supported on at least JDK 9, and JDK 5 is from memory (certainly not before that, because we use generics, and in fact I think we use the diamond operator new T<>()
which was only introduced in JDK 6, and lambdas from JDK 8). So actually I probably want to say JDK 8. Most accurately, you should ensure that you aren't bumping the minimum supported version, whatever it is (and I guess you can play with that compliance setting to get eclipse to tell you what it is for sure). The JDK 11 mention you found is the latest tested version, not the minimum supported version.
These deprecated methods appear in "lib/JSON-java/org" which doesn't seem to be a real part of mmj2. Therefore, I will not make any modifications to them.
As for the java version, I encounter warnings and unwanted behavior of mmj2 with JDK >= 9 and I have to downgrade to JDK 8 (see thread https://groups.google.com/g/metamath/c/WFoQTXy17lU/m/cm4tqs6yDQAJ), so I'm not sure why the installation instructions (https://github.com/digama0/mmj2/blob/master/INSTALL.md) recommend JDK >= 11.