Skip to content

AVRO-3120: Support Next Java LTS (Java 17) - #1454

Merged
martin-g merged 5 commits into
masterfrom
avro-3120-fix-build-with-jdk16+
Jan 13, 2022
Merged

martin-g merged 5 commits into
masterfrom
avro-3120-fix-build-with-jdk16+

Conversation

@martin-g

Copy link
Copy Markdown
Member

Jira

  • My PR addresses the following AVRO-3120 issue

Tests

  • My PR updates several unit tests to use Mockito instead of Easymock

Commits

  • My commits all reference Jira issues in their subject lines.

Documentation

  • [] TODO: Probably I should update the website and/or README

Disable Spotless' removeUnusedImports
(diffplug/spotless#834). It will be re-enabled
once Avro is updated to JDK 11+. Then we can add .mvn/jvm.config (see
diffplug/spotless#834 (comment))

Replace Easymock with Mockito.

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
@github-actions github-actions Bot added build Java Pull Requests for Java binding labels Jan 11, 2022
Comment thread lang/java/pom.xml
</eclipse>
<removeUnusedImports/>
<!-- Temporarily disabled for JDK 16+ builds -->
<!--<removeUnusedImports/>-->

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I hope we can leave with this being disabled until we update Avro to JDK 11. Then we can add the needed --add-exports ... for Spotless Maven plugin in .mvn/jvm.config

…rts JDK 8

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
@martin-g

Copy link
Copy Markdown
Member Author

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>

@opwvhk opwvhk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@martin-g
martin-g merged commit 3a8423f into master Jan 13, 2022
@martin-g
martin-g deleted the avro-3120-fix-build-with-jdk16+ branch January 13, 2022 11:32
@martin-g

Copy link
Copy Markdown
Member Author

This PR changed only test related code, so I don't see a reason to backport it to branch-1.11

@iemejia

iemejia commented Jan 13, 2022

Copy link
Copy Markdown
Member

Nice, well done @martin-g ! I wonder if we can argueable say then that Avro 1.11.0 was already Java 17 compatible, we were just not testing it :)

@martin-g

Copy link
Copy Markdown
Member Author

Right! It looks safe to say this! :-)

But don't mention JDK 18/19 EAs yet!
Here we still have few problems:

[ERROR] Failures: 
[ERROR]   TestSpecificCompiler.testInvalidParameterCounts:212->assertCompilesWithJavaCompiler:86->assertCompilesWithJavaCompiler:129 Warnings produced when compiling generated code with -Xlint:all expected:<0> but was:<100>
[ERROR]   TestSpecificCompiler.testLogicalTypesWithMultipleFieldsDateTime:746->assertCompilesWithJavaCompiler:86->assertCompilesWithJavaCompiler:129 Warnings produced when compiling generated code with -Xlint:all expected:<0> but was:<3>
[ERROR]   TestSpecificCompiler.testMaxValidParameterCounts:200->assertCompilesWithJavaCompiler:86->assertCompilesWithJavaCompiler:129 Warnings produced when compiling generated code with -Xlint:all expected:<0> but was:<100>
[ERROR]   TestSpecificCompiler.testUnionAndFixedFields:738->assertCompilesWithJavaCompiler:86->assertCompilesWithJavaCompiler:129 Warnings produced when compiling generated code with -Xlint:all expected:<0> but was:<2>

@iemejia

iemejia commented Jan 14, 2022

Copy link
Copy Markdown
Member

I think we should cherry pick it, for 1.11.1 because it is safe enough, and also to avoid eventual cherry pick conflicts. WDYT? Would you mind to open a cherry pick PR?

@martin-g

Copy link
Copy Markdown
Member Author

Do we need a PR for cherry-picks ? I'd just cherry-pick it and update fixVersion in JIRA.

@martin-g

Copy link
Copy Markdown
Member Author

About JDK 18+: #1459

martin-g added a commit that referenced this pull request Jan 14, 2022
* AVRO-3120: Support Next Java LTS (Java 17)

Disable Spotless' removeUnusedImports
(diffplug/spotless#834). It will be re-enabled
once Avro is updated to JDK 11+. Then we can add .mvn/jvm.config (see
diffplug/spotless#834 (comment))

Replace Easymock with Mockito.

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>

* AVRO-3120: Downgrade eclipse-java-formatter to the version that supports JDK 8

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>

* AVRO-3120: Fix formatting for Spotless

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>

* AVRO-3120: Add JDK 17 for the interop tests

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>

* AVRO-3120: Install JDK 17 in the Docker image

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
(cherry picked from commit 3a8423f)
@martin-g

Copy link
Copy Markdown
Member Author

Cherry-picked the changes to branch-1.11!

@RyanSkraba

Copy link
Copy Markdown
Contributor

Do we need a PR for cherry-picks ? I'd just cherry-pick it and update fixVersion in JIRA.

Hey -- I would only create a PR for a cherry-pick if there was a good reason (an unexpected merge-conflict, a potential break or doubt, or anything that might need extra eyes).

Thanks for this update!

StitchMl pushed a commit to StitchMl/avro that referenced this pull request Jul 13, 2026
* AVRO-3120: Support Next Java LTS (Java 17)

Disable Spotless' removeUnusedImports
(diffplug/spotless#834). It will be re-enabled
once Avro is updated to JDK 11+. Then we can add .mvn/jvm.config (see
diffplug/spotless#834 (comment))

Replace Easymock with Mockito.

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>

* AVRO-3120: Downgrade eclipse-java-formatter to the version that supports JDK 8

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>

* AVRO-3120: Fix formatting for Spotless

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>

* AVRO-3120: Add JDK 17 for the interop tests

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>

* AVRO-3120: Install JDK 17 in the Docker image

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Java Pull Requests for Java binding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants