apache / apache/netbeans

Variables show wrong value when debugging

Open
#7,696 9 comments 0 reactions 0 assignees View on GitHub
debugger Java kind:bug needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 22

### What happened

I am not sure of what triggers the fault, but in the Variables window, the wrong value is displayed for some variables. I have only seen this with java.awt.Point variables. In the attached screenshot, the value of this.curr.p is displayed as four different values in 4 places...

The Watch curr.p says its value is [6,3] in the summary line, yet the individual fields are x=2, y=1
In the Variables, this.curr.p shows [2, 2] in the summary line, with x=0 and y=0 for the individual fields.

The correct value is x=2, y=1

![Screenshot 2024-08-26 045712](https://github.com/user-attachments/assets/51816343-eeb7-46f5-bcb1-4da1f2b5a9b7)

### Language / Project Type / NetBeans Component

_No response_

### How to reproduce

I am sorry, but I don't know what triggers this. I have only ever seen it in my current project in the last few weeks. I don't recall when it first happened, but certainly not 6 months ago. Possibly it was introduced in the latest Netbeans update? However, I have only seen it for java.awt.Point variables, and I have only been using that type recently.

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Win11

### JDK

jdk21

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

It seems intermittent... some variables display correct values, other don't. Usually looking at individual fields shows the correct values, whereas the summary line is often wrong. Creating a new Watch seems to give correct values... it is the update of a pre-existing Watch or Variable that shows the wrong value

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in Apache NetBeans 22 using java.awt.Point variables, comparing existing Watch and Variables entries with their summary and individual field values. The issue is done when refreshed debugger values consistently match the correct x and y fields, including for pre-existing Watches and Variables.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.