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 210331 - Apply Changes disabled when Compile on Save is ON
Summary: Apply Changes disabled when Compile on Save is ON
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 7.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-29 01:08 UTC by David Konecny
Modified: 2012-06-11 10:37 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample project for testing (12.96 KB, application/x-gzip)
2012-03-29 01:19 UTC, David Konecny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Konecny 2012-03-29 01:08:09 UTC
Create simple Web project with a Servlet, disable CoS and start debugging servlet. You can change servlet code and "Apply Changes". Now enable CoS (and/or DoS) and notice that Apply Changes will be disabled.
Comment 1 David Konecny 2012-03-29 01:19:49 UTC
Created attachment 117441 [details]
sample project for testing
Comment 2 David Konecny 2012-03-29 01:37:42 UTC
Issue 207149 which triggered this report was P2 and voted by 7 users. If fix would be easy we should consider getting it into 7.1.2 patch.
Comment 3 Martin Entlicher 2012-04-05 15:15:43 UTC
I've reproduced the problem with the attached project.
It's similar to issue #199643, but the "Apply Code Changes" is really disabled even after changes are saved. Maybe the problem is, that it does not cooperate with web projects correctly.

This needs to be fixed, but I still think, that the preferred way to propagate changes in Web projects is to use Deploy on Save. It's also more reliable than Apply Code Changes, which is limited in functionality (e.g. it is not able to add fields and methods).

Scheduling for 7.2.
Comment 4 David Konecny 2012-04-10 00:13:27 UTC
(In reply to comment #3)
> I've reproduced the problem with the attached project.
> It's similar to issue #199643, but the "Apply Code Changes" is really disabled
> even after changes are saved. 

Yes, it looks like the same issue. Feel free to close one as duplicate but please keep this at P2 - 7 votes is a strong feedback.

> This needs to be fixed, but I still think, that the preferred way to propagate
> changes in Web projects is to use Deploy on Save. It's also more reliable than
> Apply Code Changes, which is limited in functionality (e.g. it is not able to
> add fields and methods).

One case when Deploy on Save might not work for users is if DoS should result into web container's session being dropped. For example imagine user is debugging an application and they logged in in the browser and there is an active session and user is debugging something and want to apply a change in the code. If that should cause session being dropped and user being forced to login again and start whole workflow from the beginning then that would be very annoying. Even limited Apply Code Changes would be preferred in this case. On the other hand whether session gets dropped or not differs per server - in GlassFish case it should not be an issue and Apply Code Changes might rely fully on Deploy on Save. I'm not sure about other servers like Tomcat.
Comment 5 Martin Entlicher 2012-04-25 15:13:11 UTC
My suspicion is, that this is broken by issue #211005.
I'll check this, after the rescanning is fixed.
Comment 6 David Konecny 2012-04-25 22:07:27 UTC
issue 211005 is for 7.2 but this one was filed for 7.1
Comment 7 Martin Entlicher 2012-06-05 16:02:32 UTC
Fixed by changeset:   223319:81458f8f85cd
http://hg.netbeans.org/main/rev/81458f8f85cd
Comment 8 Quality Engineering 2012-06-06 05:54:32 UTC
Integrated into 'main-golden', will be available in build *201206060001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/81458f8f85cd
User: mentlicher@netbeans.org
Log: #210331: Fix of Apply Code Changes in Web projects.
Comment 9 Petr Jiricka 2012-06-06 07:35:18 UTC
Thanks Martin. Could this also be a problem with other kinds of EE projects (EJB, AppClient, EAR, Maven) and does the fix also need to be done for these project types? Cc'ing also Jirka - Jirko do you know what's the situation for the other project types?
Comment 10 Martin Entlicher 2012-06-10 11:35:25 UTC
In EJB and EAR projects, this works, since they have "debug.fix" action enabled in COS mode, unlike Web project.
As I do not think, that "debug.fix" should be enabled in COS mode, I've applied the changes to EJB and EAR projects as well, for the case, that "debug.fix" gets disabled:
changeset:   224110:d7750941ccb2
http://hg.netbeans.org/main/rev/d7750941ccb2

There is no COS mode in AppClient project.
In Maven, Apply Code Changes works fine for me.
Comment 11 Quality Engineering 2012-06-11 06:27:12 UTC
Integrated into 'main-golden', will be available in build *201206110001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d7750941ccb2
User: mentlicher@netbeans.org
Log: #210331: Apply code changes in COS mode.
Comment 12 Jiri Skrivanek 2012-06-11 10:37:26 UTC
Verified web, ejb, ear projects (both ant and maven).