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

Fix compilation warning on JDK 9: use deprecated method LogRecord.setMillis [SPR-15453] #20014

spring-projects-issues opened this issue Apr 14, 2017 · 1 comment
in: core type: task


Copy link

@spring-projects-issues spring-projects-issues commented Apr 14, 2017

Brian Clozel opened SPR-15453 and commented

It seems we're using a deprecated method in the spring-core module.
This fails the JDK9 build for now (see SPR-JDK9-180):

error	14-Apr-2017 00:03:04	/opt/bamboo-home/xml-data/build-dir/SPR-JDK9-JOB1/spring-core/src/main/java/org/apache/commons/logging/ warning: [deprecation] setMillis(long) in LogRecord has been deprecated
error	14-Apr-2017 00:03:04				serialized.setMillis(getMillis());
error	14-Apr-2017 00:03:04				          ^
error	14-Apr-2017 00:03:04	error: warnings found and -Werror specified

The setInstant variant (introduced in JDK9) is the preferred one. In the meantime, can we ignore that warning so that the build is green with JDK9 again?

Affects: 5.0 RC1

Reference URL:

Issue Links:

  • #19081 Revisit Commons Logging vs java.util.logging vs SLF4J vs Log4j 2

Referenced from: commits d50dab6

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Apr 14, 2017

Juergen Hoeller commented

Good catch! We're just using this in a copy constructor for LogRecord serialization, so I've simply suppressed the deprecation warning there.

I intend to revisit our JDK 9 alignment story - in particular dedicated documentation on JDK 9 use - soon... probably after 5.0 RC1 though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: core type: task
None yet

No branches or pull requests

2 participants