[
https://issues.apache.org/jira/browse/HADOOP-19375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17908008#comment-17908008
]
ASF GitHub Bot commented on HADOOP-19375:
-----------------------------------------
pan3793 opened a new pull request, #7245:
URL: https://github.com/apache/hadoop/pull/7245
<!--
Thanks for sending a pull request!
1. If this is your first time, please read our contributor guidelines:
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
2. Make sure your PR title starts with JIRA issue id, e.g.,
'HADOOP-17799. Your PR title ...'.
-->
### Description of PR
The Hadoop codebase has some JDK version-specific code, and uses
`maven-compiler-plugin` to 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.
<img width="1916" alt="image"
src="https://github.com/user-attachments/assets/fe3c37cf-0984-4ea6-83a8-f30742efb544"
/>
The PR proposes to use `build-helper-maven-plugin` to organize JDK
version-specific code, which gets better support from IDEA.
### How was this patch tested?
```
IntelliJ IDEA 2024.3.1.1 (Community Edition)
Build #IC-243.22562.218, built on December 18, 2024
Runtime version: 21.0.5+8-b631.28 aarch64 (JCEF 122.1.9)
macOS 15.2
```
When setting the project JDK to Java 8
<img width="1915" alt="image"
src="https://github.com/user-attachments/assets/d6265616-4c89-4fae-8180-9c6c1367f6c6"
/>
When setting the project JDK to Java 17
<img width="1914" alt="image"
src="https://github.com/user-attachments/assets/0894a751-42e4-402e-815b-d2f1a1b98d91"
/>
Also, verified by running `mvn clean install -DskipTests` in both Java 8 and
17.
### For code changes:
- [x] Does the title or this PR starts with the corresponding JIRA issue id
(e.g. 'HADOOP-17799. Your PR title ...')?
- [ ] Object storage: have the integration tests been executed and the
endpoint declared according to the connector-specific documentation?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`,
`NOTICE-binary` files?
> Orgnize JDK version-specific code in IDEA friendly approach
> -----------------------------------------------------------
>
> Key: HADOOP-19375
> URL: https://issues.apache.org/jira/browse/HADOOP-19375
> Project: Hadoop Common
> Issue Type: Improvement
> Reporter: Cheng Pan
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]