Cleanup oal.util.Constants to use java.lang.Runtime.Version and remove outdated versions [LUCENE-10505]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
In oal.util.Constants we have some constants about the 64 bitness and Java version and vendor info. Especially theres also parsing of system properties to get major and minor Java version.
We should change this in main and 9.x to use and the corresponding `Runtime.Version` class. The `Runtime.Version` class also allows to compare in a safe way. The good thing is that you also get minor bugfix info, so code could disable stuff exactly at specific versions that are buggy.
We should also cleanup the constants. In 9.x and main we still have `JRE_IS_MINIMUM_JAVA8`! We should remove this constants (+ deprecate in 9.x and set to true) and change all code relying on the to execute code for java 8. Same for 11 and 17.
---
Migrated from [LUCENE-10505](https://issues.apache.org/jira/browse/LUCENE-10505) by Uwe Schindler (@uschindler)
Contributor guide
Research direction
Start in oal.util.Constants and read the existing constants that inspect Java version and vendor system properties. Search the main and 9.x code for JRE_IS_MINIMUM_JAVA8, JRE_IS_MINIMUM_JAVA11, and JRE_IS_MINIMUM_JAVA17, then review the relevant compatibility tests or test suite. Done means version handling uses Runtime.version() and obsolete constants and dependent branches are cleaned up as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, search
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100