-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-19375. Organize JDK version-specific code in IDEA friendly approach #7245
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
Conversation
| <id>jdk1.8</id> | ||
| <id>jdk8</id> | ||
| <activation> | ||
| <jdk>1.8</jdk> |
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.
Maven supports both 1.8 and 8, but seems IDEA only supports 1.8
|
cc @jojochuang |
|
💔 -1 overall
This message was automatically generated. |
|
The files complaint by Yetus are renamed without changes, I tend to keep them as-is to avoid introducing any unnecessary noisy changes. |
|
cc @slfan1989 @cnauroth, it's a minor change that affects developers who use IDEA with JDK 17, could you please take a look, thanks in advance |
|
@pan3793 LGTM. I personally believe that this modification is feasible, but I still need @cnauroth and @steveloughran to review it for confirmation. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
cnauroth
left a comment
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.
+1
This looks fine to me. Thank you, @pan3793 !
Even though this is meant to help with Java 17 support, I wonder if we should merge it down to branch-3.4 and branch-3.3 anyway to reduce potential merge confliclts on cherry-picks.
I won't commit this one right away in case others want to comment.
|
There are some test failures, but I think that's because we're in a partial state with the JUnit5 upgrade. The hadoop-hdfs test subclasses a base class from hadoop-common, where it's using the Jupiter annotations, but hadoop-hdfs doesn't have the new runner yet. |
@cnauroth This seems to be caused by our upgrade of Hadoop-Common. I will continue to follow up on this issue. Once Hadoop Common Part4/Part5 is merged, I will submit Part6 and complete the unit tests for the modules dependent on Hadoop Common. I expect to work on this next week. cc: @pan3793 |
|
into 3.4.x please; I'm always mixing java versions and things get really confused in the IDE. |
|
I have committed this to trunk and branch-3.4. @pan3793 , thank you for the patch. @steveloughran , thank you for adding your feedback. |
…roach Closes apache#7245 Reviewed-by: Steve Loughran <stevel@apache.org> Signed-off-by: Chris Nauroth <cnauroth@apache.org>
…roach Closes apache#7245 Reviewed-by: Steve Loughran <stevel@apache.org> Signed-off-by: Chris Nauroth <cnauroth@apache.org>

Description of PR
The Hadoop codebase has some JDK version-specific code, and uses

maven-compiler-pluginto exclude the specific packages, while IDEA does not work well for this plugin. For example, when setting project JDK to Java 17, the IDEA still loads those excluded source code and complains of class reference issues.The PR proposes to use
build-helper-maven-pluginto organize JDK version-specific code, which gets better support from IDEA.BTW,
hadoop-commonalso uses the same way to organize the arch-specific code, insrc/main/arm-java.How was this patch tested?
When setting the project JDK to Java 8

When setting the project JDK to Java 17

Also, verified by running
mvn clean install -DskipTestsin both Java 8 and 17.For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?