This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 199643

Summary: Apply Code Changes is disabled until changed files are saved.
Product: debugger Reporter: Jiri Skrivanek <jskrivanek>
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: NEW ---    
Severity: normal CC: laubrino, mmirilovic, pcipov, pjiricka
Priority: P4    
Version: 7.0.1   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: Apply code not working

Description Jiri Skrivanek 2011-06-23 07:04:42 UTC
Apply code changes action is disabled when source file is modified. To reproduce:

- create Java Application project (Compile on Save is enabled by default)
- add some code and breakpoint to main class and start debugging (Ctrl+F5)
- wait until debugger stops at breakpoint
- change something in code but the Apply Code Changes action is still disabled and it shouldn't be. If you save the file, it gets enabled.

Product Version: NetBeans IDE 7.0.1 RC1 (Build 201106212100)
Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b16
System: Windows XP version 5.1 running on x86; Cp1250; en_US (nb)
Comment 1 Jiri Kovalsky 2011-06-23 12:06:09 UTC
Product Version: NetBeans IDE 6.8 (Build 200912041610)
Java: 1.6.0_26; Java HotSpot(TM) Client VM 20.1-b02
System: Linux version 2.6.35-22-generic running on i386; UTF-8; cs_CZ (nb)
Userdir: /home/cesilko/.netbeans/6.8

Reproduced in NetBeans IDE 6.8 with JDK 6 Update 26 - see above configuration. Is this as designed Martine?
Comment 2 Jiri Kovalsky 2011-08-15 12:43:12 UTC
Issue #200922 is most probably a duplicate of this bug. Raising priority, this is very confusing.
Comment 3 Martin Entlicher 2011-08-15 12:46:44 UTC
I'm just looking into it. I do not think that issue #200922 is a duplicate of this. I rather think that issues #200376 and #200922 are duplicates.

I still consider this as a P3, since the Apply Code Changes action gets enabled after the file is saved, as described here.
Comment 4 laubrino 2011-08-29 12:35:56 UTC
*** Bug 201322 has been marked as a duplicate of this bug. ***
Comment 5 pcipov 2011-09-16 09:12:12 UTC
I wonder, what software are you using for writing netbeans ? Apply code button disabled is a major bug, it is the same situation as  play button broken, close button broken. It is triviality that makes my life harder and I need to add more sugar to my tee. So please care for my health and fix this bug.
Comment 6 Martin Entlicher 2011-09-18 15:53:05 UTC
The major problem with Apply Code Changes was fixed in issue #200376.
I'm changing the summary to make it clear that this issue is about disabled action until changed files are saved.
Comment 7 laubrino 2011-09-19 07:59:37 UTC
Why did you rename the bug? My Apply Code Changes button is ALWAYS disabled. Regardless changes are saved or not. It got broken with 7.0.1 update.

Product Version: NetBeans IDE 7.0.1 (Build 201107282000)
Java: 1.6.0_19; Java HotSpot(TM) Client VM 16.2-b04
System: Windows 7 version 6.1 running on x86; Cp1250; cs_CZ (nb)

Should I fill a new bug?
Comment 8 Jiri Kovalsky 2011-09-30 10:34:34 UTC
Then you should rather comment on #200376. Please write there what you installed and how you upgraded. Plus which project you debug. Was it 7.0 Full distro -> 7.0.1 -> 7.0.1 with all updates? Or Java SE distro of 7.0.1 -> 7.0.1 with all updates? Or some other scenario? Thanks for your feedback.
Comment 9 pcipov 2011-09-30 11:00:43 UTC
(In reply to comment #8)
> Then you should rather comment on #200376. Please write there what you
> installed and how you upgraded. Plus which project you debug. Was it 7.0 Full
> distro -> 7.0.1 -> 7.0.1 with all updates? Or Java SE distro of 7.0.1 -> 7.0.1
> with all updates? Or some other scenario? Thanks for your feedback.

thanks it seems the same as my problem.
Comment 10 Marian Mirilovic 2011-09-30 13:01:36 UTC
Martine, 
do you plan to fix it into 7.1 ? I faced the same problem couple times today and I have to say it's pretty annoying ;(
Comment 11 Martin Entlicher 2011-09-30 13:09:56 UTC
Hopefully I'll manage to fix it into 7.1.
Currently I'm notified by build artifacts infrastructure only after the files are saved. Thus I need to add a listener for source modifications...
Comment 12 pcipov 2011-10-20 14:17:00 UTC
Created attachment 112267 [details]
Apply code not working

Steps to reproduce.
Create new java web project.
Deploy and debug on tomcat 7
change some method body
save file

expected result:
apply code should be active

current result:
it is disabled

software: Netbeans 7.1 b1 tomcat 7
Comment 13 Martin Entlicher 2013-08-22 15:51:54 UTC
When the file is saved, Apply code changes gets enabled for me.
When the file is modified but not saved yet, the action stays disabled, until it's saved.