redhat-developer / redhat-developer/vscode-java
Editor erroneously reports warning in conditional operator
オープン
まだ誰も着手していません。
bug
diagnostics
upstream
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 546
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 11
説明
Erroneous warnings are reported in the editor in conditional operators.
Environment
- Operating System: Windows 10 Pro
- JDK version: OpenJDK 11.0.1
- Visual Studio Code version: 1.30.1
- Java extension version: 0.40.0
Steps To Reproduce
Write code like the following:
SpeedController motor;
if (RobotMap.isCompetitionRobot)
{
motor = new WPI_TalonSRX(RobotMap.liftMotorCanDeviceId);
}
else
{
motor = new Spark(RobotMap.centerLegMotorPwmChannel);
}
motor = RobotMap.isCompetitionRobot
? new WPI_TalonSRX(RobotMap.liftMotorCanDeviceId)
: new Spark(RobotMap.centerLegMotorPwmChannel);
where the class Spark extends a class that implements AutoCloseable.
Current Result
No warnings are reported in the if statement. However, the warning:
Resource leak: '<unassigned Closeable value>' is never closed
is reported for the code:
new Spark(RobotMap.centerLegMotorPwmChannel)
in the conditional operator.
Expected Result
No warnings should be reported at all.
Additional Informations
None.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、issue にある条件演算子の例で警告を再現します。可能な場合は、記載されている Windows、JDK、VS Code、Java extension のバージョンを使用します。条件式に対する Java extension のリソースリーク解析を追跡します。条件式で誤った警告が生成されず、既存の if 文の動作が変更されないことをもって完了とします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100