Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

static variable are not updated in the variable view.

Đang mở
#1,344 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java, typescript

Hướng nghiên cứu

Tái hiện vấn đề với các ví dụ Dog và App, sau đó kiểm tra cách trình gỡ lỗi Java điền vào phần Local của Variables View và xử lý các chỉnh sửa được thực hiện thông qua đó. So sánh phần hiển thị này với watch value sau khi thay đổi d2; hoàn tất khi tất cả các instance tự động hiển thị tên static dùng chung hiện tại hoặc hiển thị tên đó sau một thao tác làm mới khả dụng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
591
Fork
429
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
19

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/vscode-java-debug

Tất cả issue của microsoft/vscode-java-debug

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.