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

static variable are not updated in the variable view.

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

還沒有人認領這個 Issue。

評估

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

研究方向

使用 Dog 和 App 範例重現問題,然後檢查 Java 偵錯器如何填入 Variables View 的 Local 區段,以及如何處理透過該區段進行的編輯。變更 d2 後,將該顯示與 watch value 進行比較;完成的標準是所有執行個體都能自動顯示目前共用的 static 名稱,或在執行可用的重新整理動作後顯示該名稱。

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

描述

ai-triaged bug enhancement variables

The static variables of an instance of a class are not updated in the variable view if another instance is changed.

Environment
  • Operating System: Windows 10
  • JDK version: JDK 1.8.311
  • Visual Studio Code version: 1.78.2
  • Java extension version: Language Support for Java(TM) by Red Hat v1.18.0
  • Java Debugger extension version: 0.50.0
Steps To Reproduce
  1. Create a simple class with a static variable as:
public class Dog {
    private static String name;
    private int age;

    public Dog(String name, int age) {
        Dog.name = name;
        this.age = age;
    }

    public static String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

}
  1. In the main create 3 instance of class Dog :
public class App {
    public static void main(String[] args) throws Exception {
        Dog d1 = new Dog("Medor", 3);
        Dog d2 = new Dog("Rex", 5);
        Dog d3 = new Dog("Fifi", 1);

        System.out.println("Dog 1 name : " + d1.getName());
    }
}
  1. Put a break point on the System.out.println
  2. Run in debug mode and check in the Variables View - Local if all dog have the same name.
  3. Edit the name of d2
Current Result

Only the name of d2 is changed and no possibility to update the name of the other dog. We can see if we add a watch that the name of the other dog changes correctly but not in the Variable view.

Expected Result

In the Variable view the name of all instance of dog should be updated, automatically or with a refresh button

Additional Informations

Very important for teachers to explains what happen with static variables.

主要語言
TypeScript
星號
591
分支
429
平均合併
1 天 1 小時
30 天內合併 PR
20

貢獻指南

開啟貢獻指南

從這裡開始

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

microsoft/vscode-java-debug 的其他 Issue

查看 microsoft/vscode-java-debug 的全部 Issue

相似的 Issue

更多 TypeScript Issue

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

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