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

Replaced usage of deprecated Long class constructor to fix warnings. #445

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

23rd
Copy link
Contributor

@23rd 23rd commented Nov 8, 2021

Hi, I had tried build with OpenJDK 17 — seems to be good but I got two warnings about the deprecated constructor. So this small PR fixes them.
https://docs.oracle.com/javase/9/docs/api/java/lang/Long.html#Long-long-

Logs:
chatty\src\chatty\gui\components\settings\SliderLongSetting.java:66: warning: [removal] Long(long) in Long has been deprecated and marked for removal
        valueLabel.setText(LABEL_PREFIX+new Long(value).toString());
                                        ^
chatty\src\chatty\util\SimpleCache.java:53: warning: [removal] Long(long) in Long has been deprecated and marked for removal
            writer.write(new Long(System.currentTimeMillis() / 1000).toString()+"\n");
                         ^

Copy link

@tedyoung tedyoung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use String concatenation? No need for the Long wrapper at all, e.g.:

valueLabel.setText(LABEL_PREFIX + value);

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

Successfully merging this pull request may close these issues.

None yet

2 participants