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 144703 - Compile On Save does not reload classes when attached
Summary: Compile On Save does not reload classes when attached
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on: 145421
Blocks:
  Show dependency tree
 
Reported: 2008-08-21 13:11 UTC by tboerkel
Modified: 2010-04-29 09:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tboerkel 2008-08-21 13:11:15 UTC
6.5 Beta, JDK 6.0u7:

- clean and build
- start app externally (classpath on build/classes)
- attach NB
- run through some code
- change code and save (this should include reloading of classes)
- run again through code -> old code runs

In 6.1, without Compile On Save, this worked OK (with "Apply changes"). Classes were recompiled and reloaded.
Comment 1 Martin Entlicher 2008-08-21 13:32:47 UTC
Yes, it was not implemented intentionally. We have planned that for later consideration.
Unfortunately we did not realize that "Apply code changes" is permanently disabled for projects with "compile on save"
turned on, regardless of the type of the debugger connection.

I'm not much fond of such automatic applying of potential uncompilable sources via remote attach
Comment 2 Martin Entlicher 2008-08-28 16:20:10 UTC
We'll wait with resolution of this after issue #145421 is resolved somehow.
Comment 3 Martin Entlicher 2008-09-04 16:45:56 UTC
There will be no automatic class reload yet. See issue #145421.
We'll make the "Apply Code Changes" action to work.
Comment 4 Martin Entlicher 2008-09-05 18:18:45 UTC
It will work on explicit request via "Apply Code Changes" button in toolbar or Debug menu.
Comment 5 Martin Entlicher 2008-09-05 19:28:19 UTC
Fixed in changeset:   100363:e22d62656a39
http://hg.netbeans.org/main/rev/e22d62656a39
Comment 6 Quality Engineering 2008-09-06 05:28:30 UTC
Integrated into 'main-golden', will be available in build *200809060201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/e22d62656a39
User: mentlicher@netbeans.org
Log: #144703 - Listen for artifacts updates in attach mode also.
Comment 7 matusdekanek 2008-11-12 09:40:53 UTC
Compile on save feature does not have to support 'apply code changes' debugger feature in nb 6.5. 

Anyway, actions attach debugger, modify code, apply changes and continue debugging(F5) will correctly continue with new 
code. However, it will not stop on breakpoints in modified file (whether new or old). 
Also, applying changes and trying to step trough new code has some problems. Either it does not continue (step into, 
key F7) or it uses some mix between old and new code(deleted lines are still used as well as new ones) (step over, key 
F8). As fas as I know, this is not problem caused by attaching debugger, the same behaviour is observed with non-
attached debugging. 

Please, could somebody write, whether this is expected behaviour or not? Or where I could find specification of 
limitations of 'apply code changes' feature? Thanks

(note: changes in code involved deleting one line code, adding new line of code and modifying already executed line of 
code)
Comment 8 tboerkel 2009-02-13 07:36:58 UTC
Why does Compile on save not have to do apply code changes? It works that way with Eclipse.
Comment 9 Martin Entlicher 2009-02-13 19:56:14 UTC
Compile on save does not do apply code changes automatically, because it's buggy. See e.g. issue #145421.
It's not so buggy in Eclipse JDK (I wish I would not have to say that!)

We'll have an option to turn it on, for cases that it works fine for you or it happens to be fixed in some future JDK.
Comment 10 tboerkel 2009-02-16 09:59:39 UTC
Thanks für clarification. I thought Eclipse would also run on/use the Sun JDK...
Comment 11 Quality Engineering 2010-04-29 09:43:13 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.