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 207524 - Refresh-on-save does not work well with Java code
Summary: Refresh-on-save does not work well with Java code
Status: RESOLVED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Extbrowser (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-19 15:33 UTC by Petr Jiricka
Modified: 2012-09-03 12:55 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 Petr Jiricka 2012-01-19 15:33:28 UTC
Using a build from the easel_css_72 branch:
1. Create a web project
2. Create class p.Helper with the following method:
    public static String getData() { return "1"; }
3. In index.jsp, add this line:
    <%= p.Helper.getData() %>
4. Do Run File on index.jsp - browser will be opened
4. Modify p.Helper to return "2" but do not save.
5. Modify index.jsp (e.g. change the <h1> line to: <h1>Hello World! 8</h1> but do not save.
6. Do Save All.

Refresh-on-save will reload the browser. The change in index.jsp will be picked up, but the change in p.Helper will not. When you refresh the page manually a few seconds later, it will be picked up.

This is because the change in the Java file is redeployed on save, and this takes a while. So the IDE refreshes the browser sooner than this change is redeployed.

(The same is technically true for the JSP file, which is copied-on-save to the build directory, but in practice this is really fast so it is copied to build dir in time before the browser is refreshed.)
Comment 1 Petr Jiricka 2012-01-19 15:56:04 UTC
Sorry, the last comment about JSPs and copy-on-save is not true, this seems to be handled well in the code.
Comment 2 Denis Anisimov 2012-01-27 09:15:54 UTC
web-main#0d8e34e9803b
Comment 3 Petr Jiricka 2012-01-27 15:27:12 UTC
Still does not work reliably for me. Sometimes it works, but sometimes it's refreshed sooner than both files are saved, so only changes in one of the 2 files are reflected. Possibly depends on the order in which they are saved. Also, bug #206064 may be causing some trouble with this.
Comment 4 Denis Anisimov 2012-01-31 13:09:14 UTC
The possible reason of this is fixed here :
web-main#7bc4fcd9b1fe
Comment 5 Quality Engineering 2012-09-03 12:55:13 UTC
Integrated into 'main-golden', will be available in build *201209031048* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0d8e34e9803b
User: Denis Anisimov <ads@netbeans.org>
Log: Fix for BZ#207524 - Refresh-on-save does not work well with Java code and handling save Java sources.