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 11183 - "Up-to-date" badge on Java sources not reliably updated after compile
Summary: "Up-to-date" badge on Java sources not reliably updated after compile
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker with 1 vote (vote)
Assignee: rmatous
URL:
Keywords:
: 13133 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-04-07 18:32 UTC by Jesse Glick
Modified: 2007-09-26 09:14 UTC (History)
2 users (show)

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 Jesse Glick 2001-04-07 18:32:13 UTC
[release32 apr 6] "Needs compile" badge on Java sources seems to
update at strange times. Often it is cleared about twenty seconds
after compiling. I thought this was due to the folders not being
refreshed after an external compilation (which would also be a bug in
Java module's external compilers) but on one occasion I saw a class
which I compile not change at all, and I waited for it and even
manually refreshed the folder, to no effect. After hitting Compile on
it again, however, it said that it was up-to-date, and cleared the
badge.

Note that in some circumstances the badge updates rather quickly. So I am not
sure what causes it to wait this long at other times. Perhaps varies according
to number of mounted sources??
Comment 1 Svata Dedic 2001-04-10 16:06:11 UTC
Maybe the clue is, that during up-to-date checking, refresh() is explicitly 
invoked on individual FileObjects. Up-to-date checks are also performed when 
you hit Compile button.
Also, whenever the External Compiler is given a filename, the IDE does refresh 
of the file's folder after the compiler completes its work (invoking refresh() 
on the apropriate folder's FileObject).
Comment 2 Svata Dedic 2001-04-19 13:54:49 UTC
Sorry, Jesse, I couldn't find a reproducible case. If something has been done 
in filesystems with events, it might solve this issue as well.
Comment 3 Jesse Glick 2001-04-19 17:24:24 UTC
Yeah, I am not sure how to reproduce either, though I think it still happens to
me sometimes (at least the delays are random, sometimes very short, sometimes
long). If the external compiler after finishing really correctly refreshed the
folder, you would expect that the badge would update immediately after
compiling. But it does not seem to work always. If I find out more I will
reopen.
Comment 4 Jesse Glick 2001-05-23 15:44:39 UTC
This is definitely still true, both in release32 final and in [dev may 19].

I saw it in dev-may-19 with nothing but sampledir mounted. As
usual, after compiling the "needs to be compiled" badge stays on; if
you hit Compile again (and says everything was up to date) the badge
disappears at that time. If you do nothing, it will disappear after
maybe ten or twenty seconds.

In my r32 build (many things mounted), after changing some source and
recompiling (external compiler - Jikes), sometimes the badge clears almost
immediately; sometimes after five seconds; sometimes after ten; once not for
thirty seconds, after which I selected Refresh on the folder to no effect, then
I pressed Compile once again and it cleared immediately.
Comment 5 Jan Becicka 2001-06-25 14:01:25 UTC
*** Issue 13133 has been marked as a duplicate of this issue. ***
Comment 6 Jan Becicka 2001-06-25 14:05:03 UTC
*** Issue 13133 has been marked as a duplicate of this issue. ***
Comment 7 Jan Becicka 2001-06-25 14:07:45 UTC
Looks like P4 is not enough... 
Comment 8 Svata Dedic 2001-06-26 19:53:12 UTC
Confirmed; reproduction steps:
- make file up-to-date
- modify it in the editor
- press F9. File gets saved, compiled, but the badge stays on.
I cannot reproduce it reliably but from testing, it seems that file change 
events are not always delivered. In most cases, the change event is fired on 
the base XXX.class file, but not on XXX$1.class and XXX$2.class which are also 
watched for. In cases, when the badge did not disappear, no change event is 
fired.
The change events are fired later, when I trigger "compile" once more; 
up-to-date check in the compiler does explicit refresh() on individual 
FileObjects, so maybe that wakes up the changes recognizer.
Note that I am also intercepting changes to the set of files managed by the 
data object, no debug message was printed out about PROP_FILES change on the 
data object.

Comment 9 emmanuel 2001-06-26 20:17:00 UTC
I use target folder when compiling - this seems to be the cause in my case.

Regards
Emmanuel
Comment 10 emmanuel 2001-06-26 20:36:27 UTC
Actually it occurs when switching projects, irrespective of whether same or 
target folder used for compiling.
Comment 11 Svata Dedic 2001-06-27 09:10:38 UTC
Reassigning to Radek - according to stacktraces, events are not always fired 
after refresh is called on a folder. 
Radek, please reassign the issue back, after you fix the event mechanism (or 
discover that it is irrelevant to this cause). Thanks.

Comment 12 Svata Dedic 2001-08-16 17:21:27 UTC
Fixed in dev-trunk. All files which can be affected by the 
compilation are explicitly refreshed, not just folders.
Comment 13 Jan Becicka 2001-09-19 10:06:44 UTC
[200109190100] Verified
I'm not sure, if following behavior is correct or not:
1. Compile .java file (needs compile badge disappears)
2. Modify this file, but do not save. Badge appears -> is this 
correct, or badge should appear after save action?
3. Perform Undo -> Although editor shows, that file is not modified, 
needs compile badge is on.
Comment 14 Jan Becicka 2001-09-19 10:11:24 UTC
oops, verified should not be above.
Comment 15 Jesse Glick 2001-09-19 13:51:13 UTC
I think 2. is fine, the badge can appear immediately after edit. As
for 3., I have not observed this; for me it works fine, i.e. after
undoing the last edit to previously up-to-date file, the badge
disappears again.
Comment 16 Svata Dedic 2001-09-19 15:45:48 UTC
The 2nd is as designed (tm). The reason is, that if the file is 
modified in the editor so it will be saved before compilation anyway.
The 3rd is a bug and I'll have it fixed.
Comment 17 Svata Dedic 2001-09-19 16:54:30 UTC
Fixed in trunk.
Comment 18 emmanuel 2001-09-19 20:38:02 UTC
Please help!

I learnt some days ago that I can set how quickly the line number in 
the editor status line can be updated, when not using line numbers.

Is there a way of setting the refresh option for this badge?

Kind regards
Emmanuel
Comment 19 Svata Dedic 2001-09-20 08:48:22 UTC
It's refreshed as soon as the filesystem delivers the a notification
that a file was changed. In fact, the compiler is _forcing_ refresh on
affected folders/files before it says "Compile finished."
Comment 20 Svata Dedic 2001-09-20 08:56:09 UTC
eh - the last reply meant: I have no idea - there's no timeout or
threshold of updates and filesystems are required not to block change
events as well. If you observe some strangeness (badges not updating
after compile finishes), try to reproduce it, describe the environment
(OS/VM version/IDE version will greatly matter in such case) and
reopen the bug.
Comment 21 Jan Becicka 2001-10-03 14:58:20 UTC
[200110030100] Verified
Comment 22 Quality Engineering 2003-07-01 13:17:52 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.