Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 17 support #2248

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Java 17 support #2248

wants to merge 1 commit into from

Conversation

akatona84
Copy link
Contributor

Summary

  1. Why: To be able to build and test with java 17 too.
  2. What: some spotbugs fixes, version bumps and adjusting jvm args for testing

Expected Behavior

build goes smoothly with java 17

Actual Behavior

build and tests fail with java 17

Steps to Reproduce

  1. set your java to 17
  2. run ./gradlew build and see the crashes

Known Workarounds

Categorization

  • documentation
  • bugfix
  • new feature
  • refactor
  • security/CVE
  • other

Signed-off-by: Andras Katona <akatona@cloudera.com>
@akatona84
Copy link
Contributor Author

akatona84 commented Feb 3, 2025

This change is not moving away from jdk11 yet, it's just making it possible to compile with java17 too.


defaultTestJvmArgs = []
// "JEP 403: Strongly Encapsulate JDK Internals" causes some tests to fail when they try
// to access internals (often via mocking libraries). We use `--add-opens` as a workaround
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

often or always? As I see it is only used in the test task def, so perhaps we could rephrase this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's more about the occurrences rather than temporal frequency. OFC those tests always fail without the add-opens.
BTW I copied it from Kafka :D. Most of the cases tests were failing because of easymock and powermock to be specific, but I have no clue why exactly java.time had to be opened, gradle wasn't kind enough to provide me more info about the failing test(s) before I added it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Kafka easymock/powermock was replaced with mockito over time. It's still not done, but that's the way to get rid of these add-opens lateron.

Copy link
Contributor

@viktorsomogyi viktorsomogyi Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, makes sense. I agree that we should rather use Mockito, however I think that comes with some test refactoring as well, so let's not do that now.

@viktorsomogyi
Copy link
Contributor

@bgrishinko would you please review this?

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.

2 participants