Skip to content

Deprecated warnings cause build failures with JDK 20 #4312

@ghost

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

Activity

vladak

vladak commented on Apr 21, 2023

@vladak
Member

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

ghost commented on Apr 21, 2023

@ghost

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

xbreizh commented on May 2, 2023

@xbreizh

@vladak Hi, I can take a look if that's fine?

vladak

vladak commented on May 2, 2023

@vladak
Member

@vladak Hi, I can take a look if that's fine?

Sure, all issues are generally open to public :-)

changed the title [-]Deprecated warnings cause build failures[/-] [+]Deprecated warnings cause build failures with JDK 20[/+] on Oct 27, 2023
vladak

vladak commented on Apr 17, 2025

@vladak
Member

The URL class related warnings were addressed in #4750.

vladak

vladak commented on Apr 17, 2025

@vladak
Member

The trouble with Thread.getId() is that until we switch the target bytecode to 19+ (which introduced the Thread.threadId() method) it has to stay that way unless we resort to reflection or conditional compilation.

added 3 commits that reference this issue on Apr 17, 2025
e7e8170
a4d5048
65f71a5
added a commit that references this issue on Apr 17, 2025
447d311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @xbreizh@vladak

        Issue actions

          Deprecated warnings cause build failures with JDK 20 · Issue #4312 · oracle/opengrok