Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

IDE fails to resolve correct class when duplicate classes exist across multiple JARs (shaded vs non-shaded)

未關閉
#4,251 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
42/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
java, typescript, vscode

研究方向

從 issue 中描述的 Gradle 重現開始,使用來自 shaded 和 unshaded JAR 的重複類別。追蹤 VS Code Java extension 相較於 Gradle CLI 如何解析該類別,並驗證在選取 unshaded AuthenticationHandler 且不存在型別不匹配時補全是否正常。

由索引模型根據 Issue 內容生成。

描述

Description

The class org.apache.hadoop.security.authentication.server.AuthenticationHandler is present in both the jars i have:

  • hadoop-client-api.jar (shaded version)
  • hadoop-auth.jar (non-shaded version)

In the shaded JAR (hadoop-client-api.jar), AuthenticationHandler references HttpServletRequest from a relocated (shaded) servlet package.
In hadoop-auth.jar, the same class references javax.servlet.HttpServletRequest.

This leads to ambiguous class resolution in VS Code.
In our case, the VS Code Java extension mistakenly resolves the shaded AuthenticationHandler from hadoop-client-api.jar instead of the correct one from hadoop-auth.jar, resulting in a type mismatch when extending the class.

Reference screenshot

Image

Environment

Hadoop version: 3.4.0
Java version: 17.0.16
Build tool: Gradle 8.14
IDE: VS Code with Java extension (vscjava.vscode-gradle 3.17.1)

Steps to Reproduce

  • Create a Gradle project depending on two JARs that contain the same class name.
  • One JAR uses a shaded package (e.g., org.apache.hadoop.shaded.*).
  • Reference the class from the unshaded JAR.
  • Observe that VS Code reports type mismatch or class conflict, while Gradle CLI builds successfully.
主要語言
TypeScript
星號
2.3k
分支
547
平均合併
5 小時 36 分鐘
30 天內合併 PR
10

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

redhat-developer/vscode-java 的其他 Issue

查看 redhat-developer/vscode-java 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。