redhat-developer / redhat-developer/vscode-java
Visual Studio Code's Java Compiler Not Showing Certain Errors
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 546
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 11
説明
Description of the Issue
When running Java code I have noticed that certain compile time errors will not be displayed.
Environment
- Operating System: Windows x64 10
- JDK version: 11.0.4.11
- Visual Studio Code version: 1.41.1
- Java extension version: 0.8.1
- Java Debugger extension version: 0.23.0
Steps To Reproduce
-
Declare the HashMap like,
HashMap<dataTypeA, dataTypeB> name = new HashMap<dataTypeC, dataTypeD>();
Where dataType A - D could be any data type I want it to be. -
The bug only occurs when dataTypeC is different from dataTypeA and or dataTypeD is different from dataTypeB.
Current Result
The compiler displays,
`Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at Test.main(Test.java:10)`
Expected Result
The compiler should display,
Unresolved compilation problems:
Type mismatch: cannot convert from HashMap<dataTypeA,dataTypeB> to HashMap<dataTypeC,dataTypeD>
The method put(dataTypeA,dataTypeB) in the type HashMap<dataTypeC,dataTypeD> is not applicable for the arguments (dataTypeA,dataTypeB)
Additional Informations
If I want to see the error message then I have to read the class file in order to determine what the error is and what line it is on. The bug will only occur if the data structure is declared as a class member. I have been able to reproduce this bug with other data structures such as ArrayList, 1D list, and 2D list.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、記載されている Java と extension のバージョンを使用し、クラスメンバー宣言で Visual Studio Code 上の HashMap のジェネリック型の不一致を再現します。表示されたコンパイラー出力を、想定される型不一致およびメソッド引数の診断と比較します。これらのエラーとソース内の位置が、記載されている他のコレクションの場合も含めて表示されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, vscode
- 領域
- developer-experience, tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100