Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated methods #52

Open
billh0420 opened this issue Jan 7, 2021 · 5 comments
Open

Deprecated methods #52

billh0420 opened this issue Jan 7, 2021 · 5 comments

Comments

@billh0420
Copy link

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
Copy link
Owner

digama0 commented Jan 8, 2021

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

@billh0420
Copy link
Author

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
Copy link
Owner

digama0 commented Jan 8, 2021

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
Copy link
Author

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
Copy link

benjub commented Jan 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants