digama0 / mmj2

mmj2 GUI Proof Assistant for the Metamath project
GNU General Public License v2.0
72 stars 25 forks source link

Deprecated methods #52

Open billh0420 opened 3 years ago

billh0420 commented 3 years ago

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));"
digama0 commented 3 years ago

Try not to use anything that doesn't work on JDK 1.5, but otherwise this should be fine.

billh0420 commented 3 years ago

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?

digama0 commented 3 years ago

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.

billh0420 commented 3 years ago

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.

benjub commented 3 years ago

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.