Skip to content

More improvements for Java 21#74

Merged
ctubbsii merged 4 commits intoapache:mainfrom
ctubbsii:more-java-21-updates
Feb 18, 2026
Merged

More improvements for Java 21#74
ctubbsii merged 4 commits intoapache:mainfrom
ctubbsii:more-java-21-updates

Conversation

@ctubbsii
Copy link
Member

Future-proof for Java 21:

  • Avoid deprecated URL constructor
  • Use URI instead of String in some places to make it easier to create a URL when we need it
  • Avoid Thread.getId (deprecated in Java 19), and just use the Thread.toString (which includes the thread name and the thread ID)
  • Use URI.resolve to construct HDFS URLs in tests rather than String concatenation (must be used cautiously, due to HADOOP-19815, but still better than String concatenation)
  • Avoid deprecated exec method for launching umask by removing unnecessary DFS config code (default behavior is sufficient for these)
  • Put spotbugs and auto-service-annotations as optional compile time dependency for every module (simplifies POMs) to ensure consistent annotation processor execution

Also improve the build a bit more:

  • Remove unused commons-vfs2-bom import dependency
  • Improve concurrent delete test slightly to guarantee at least one classloader per thread, and make test pass when it creates fewer classloaders than we hope (it makes as many as it can in 10 seconds, but it might not make as many as the 50 it was previously expecting)

Future-proof for Java 21:

* Avoid deprecated URL constructor
* Use URI instead of String in some places to make it easier to create a
  URL when we need it
* Avoid Thread.getId (deprecated in Java 19), and just use the
  Thread.toString (which includes the thread name and the thread ID)
* Use URI.resolve to construct HDFS URLs in tests rather than String
  concatenation (must be used cautiously, due to HADOOP-19815, but still
  better than String concatenation)
* Avoid deprecated exec method for launching umask by removing
  unnecessary DFS config code (default behavior is sufficient for these)
* Put spotbugs and auto-service-annotations as optional compile time
  dependency for every module (simplifies POMs) to ensure consistent
  annotation processor execution

Also improve the build a bit more:

* Remove unused commons-vfs2-bom import dependency
* Improve concurrent delete test slightly to guarantee at least one
  classloader per thread, and make test pass when it creates fewer
  classloaders than we hope (it makes as many as it can in 10 seconds,
  but it might not make as many as the 50 it was previously expecting)
@ctubbsii ctubbsii self-assigned this Feb 18, 2026
@ctubbsii ctubbsii merged commit c0dfb1f into apache:main Feb 18, 2026
1 check passed
@ctubbsii ctubbsii deleted the more-java-21-updates branch February 18, 2026 19:50
@ctubbsii ctubbsii added this to the 1.0.0 milestone Mar 2, 2026
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.

1 participant