-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
chore: add java21 support #2640
Conversation
482470b
to
026ce0b
Compare
- name: Setup Java JDK | ||
uses: actions/setup-java@v3 | ||
- name: Setup Java & Gradle | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be updated to 21 aswell?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting question.. I guess we should be targeting java17 as more stable one. But perhaps it'd make sense to run unit tests against both 17 and 21. Added that in this 1ddcfd7
|
||
class MaxSizeHashMapTest { | ||
|
||
@Test | ||
void maxSizeMap_Test() { | ||
int maxSize = 50_000; | ||
void maxSizeMapTest() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this test updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are couple of reasons: first, this test tries to "test" the feature not as a "blackbox", but an internal state of the instance of a system class. Secondly and mosts importantly, this test uses reflection to obtain an internal field of the system class (via field.setAccessible(true)
), which is prohibited for non-open java packages in recent versions of junit. There's a workaround by opening system package (via --add-opens java.base/java.util=ALL-UNNAMED
), but I'm not sure that worth it
|
e86e8f3
to
a808164
Compare
1ddcfd7
to
0a5f8a2
Compare
0a5f8a2
to
2cc5bef
Compare
|
Description
Motivation and Context
How Has This Been Tested?
Types of changes
Checklist:
fed:vovchyk/java21-support