apache / apache/netbeans

Java Debugger: not working "apply code changes" if "compile on save" mode is enabled in the project

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

Description

### Apache NetBeans version

Apache NetBeans 12.6

### What happened

I am developing large projects using Apache netbeans 12.6. When using debugger in netbeans 8.2, everything worked fine, but starting from version 8.2 above, the "Apply code changes" button stopped working if the "Compile on save" option is enabled in the project, and when saving the file (ctrl+s), code changes are not applied. I have been waiting since 2019 for a solution to this problem :)

in the IDE settings, the checkbox "Apply code changes after save (in "Compile on Save" mode only)" is enabled.

### How to reproduce

Create empty ANT project, turn off "compile on save" in project settings, run this project as Debug.

For example, try this code
```java
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws InterruptedException {
// TODO code application logic here


while (true) {
Thread.sleep(1000);
System.out.println("Hello, Oracle ");
}
}
````
Try changing the string "Hello Oracle" to something else in debug mode and the string does not apply, but in Netbeans 8.2 it worked fine

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

No

### Operating System

Windows 10 x64

### JDK

JDK8

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

_No response_

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

_No response_

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with an empty Ant project on Windows, JDK 8, NetBeans 12.6, the debugger, and Compile on Save enabled. Compare changing the string during debugging and saving with the behavior reported for NetBeans 8.2. Done means Apply code changes works after saving while the project is in Compile on Save mode.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.