-
Notifications
You must be signed in to change notification settings - Fork 788
Closed
Labels

Description
OS:
Arch Linux
Package versions:
- jdk-openjdk: 20.0.1.u9
- maven: 3.8.7
- ctags: 6.0.0
- java-jsvc: 1.3.3
- eclipse-ecj: 4.22
Several deprecated warnings are generated when running mvn:
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] /build/opengrok/src/opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/framework/PluginFramework.java:[385,18] java.security.AccessController in java.security has been deprecated and marked for removal
[WARNING] /build/opengrok/src/opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/util/Executor.java:[402,43] getId() in java.lang.Thread has been deprecated
[WARNING] /build/opengrok/src/opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/logger/formatter/LogFormatter.java:[96,23] getThreadID() in java.util.logging.LogRecord has been deprecated
[WARNING] /build/opengrok/src/opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/OpenGrokThreadFactory.java:[47,59] getId() in java.lang.Thread has been deprecated
[WARNING] /build/opengrok/src/opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/web/Util.java:[682,19] URL(java.lang.String) in java.net.URL has been deprecated
[WARNING] /build/opengrok/src/opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/web/Util.java:[1457,19] URL(java.lang.String) in java.net.URL has been deprecated
[WARNING] /build/opengrok/src/opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/web/Util.java:[1474,19] URL(java.lang.String) in java.net.URL has been deprecated
[INFO] 7 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /build/opengrok/src/opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/authorization/AuthorizationFramework.java: warnings found and -Werror specified
[INFO] 1 error
Full build log: opengrok-1.11.7-1-x86_64-build.log
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
vladak commentedon Apr 21, 2023
Thanks for the report ! While OpenGrok is currently on Java 11 (and the switch to Java 17 is considered - #3899), it definitely would not hurt to address these. Is this something you'd like to work on ?
ghost commentedon Apr 21, 2023
Unfortunately I've not touched java code in over 15 years, so this is just a friendly heads-up rather than a volunteer to fix it. :)
Thanks for working on Opengrok!
xbreizh commentedon May 2, 2023
@vladak Hi, I can take a look if that's fine?
vladak commentedon May 2, 2023
Sure, all issues are generally open to public :-)
[-]Deprecated warnings cause build failures[/-][+]Deprecated warnings cause build failures with JDK 20[/+]vladak commentedon Apr 17, 2025
The
URL
class related warnings were addressed in #4750.vladak commentedon Apr 17, 2025
The trouble with
Thread.getId()
is that until we switch the target bytecode to 19+ (which introduced theThread.threadId()
method) it has to stay that way unless we resort to reflection or conditional compilation.use reflection to get thread ID
use reflection to get thread ID
use reflection to get thread ID
use reflection to get thread ID (oracle#4764)