microsoft / microsoft/vscode-java-debug

can't refer to java.lang static methods in expression

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

@testforstephen がすでに取り組んでいます。

2024年1月9日 から。

ai-triaged bug
主要言語
TypeScript
スター
591
フォーク
429
平均マージ
1日 9時間
マージ済み PR(30日)
19

説明

Add breakpoint in a constructor (such as NoSuchMethodError) with this log expression:

new StringBuilder().append(s).append("->").append(java.util.Arrays.stream(Thread.currentThread().getStackTrace()).map(StackTraceElement::toString).collect(java.util.stream.Collectors.joining("\n"))).toString()

This works in intellij but in vscode I get:

[Logpoint] Log message '{new StringBuilder().append(s).append("->").append(java.util.Arrays.stream(Thread.currentThread().getStackTrace()).map(StackTraceElement::toString).collect(java.util.stream.Collectors.joining("\n"))).toString()}' error: Cannot evaluate because of compilation error(s): [The package java.lang collides with a type, The package java.lang conflicts with a package accessible from another module: java.base].

When works it should print the message + stacktrace.

I expect the error has something to do with the static java.lang.Thread implicit reference for Thread.currentThread() call. I also added explicit java.lang.Thread but same error.

Environment
  • Operating System: osx
  • JDK version: temurin java 21
  • Visual Studio Code version: 1.84.2
  • Java extension version: "v1.25.1"
  • Java Debugger extension version: "v0.55.0"

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

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

はじめの一歩

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

評価

この issue はまだ評価されていません。

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

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