redhat-developer / redhat-developer/vscode-java

Visual Studio Code's Java Compiler Not Showing Certain Errors

オープン
#1,185 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

compile
主要言語
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
  1. 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.

  2. 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.

VSCodeBugReport

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、記載されている Java と extension のバージョンを使用し、クラスメンバー宣言で Visual Studio Code 上の HashMap のジェネリック型の不一致を再現します。表示されたコンパイラー出力を、想定される型不一致およびメソッド引数の診断と比較します。これらのエラーとソース内の位置が、記載されている他のコレクションの場合も含めて表示されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, vscode
領域
developer-experience, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。