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 194789 - Stale class cleanup broken by generated sources
Summary: Stale class cleanup broken by generated sources
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Harness (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-27 22:14 UTC by Jan Lahoda
Modified: 2013-01-24 17:13 UTC (History)
1 user (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 Jan Lahoda 2011-01-27 22:14:06 UTC
$ hg tip
changeset:   187203:2126b176d2e0
tag:         tip
user:        Tomas Zezula <tzezula@netbeans.org>
date:        Tue Jan 25 19:20:25 2011 +0100
summary:     Incrementing spec version

Steps to reproduce:
1. cd java.hints
2. ant
3. touch src/org/netbeans/modules/java/hints/bugs/AnnotationsNotRuntime.java
4. ant
The output will contain:
   [depend] Deleted 1 out of date files in 0 seconds
 [nb-javac] /usr/local/home/lahvac/src/nb/outgoing/java.hints/build/classes/org/netbeans/modules/java/hints/errors/Bundle.class appears to be stale, rebuilding all module sources

followed by recompilation of all module source, even though only one single file on which no other file depends was modified, and there is no Bundle.java/.class defined in the org.netbeans.modules.java.hints.bugs package.
Comment 1 Jesse Glick 2011-01-27 22:36:08 UTC
Bundle.java is in build/classes-generated. When CustomJavac.cleanUpStaleClasses() asks for the sourcepath, only src/ is included, not this dir. I think that is because compile() sets up generatedClassesDir _after_ cleanUpStaleClasses is called.
Comment 2 Jesse Glick 2011-01-27 22:38:53 UTC
core-main #e69eddab943f
Comment 3 Quality Engineering 2011-01-29 05:27:52 UTC
Integrated into 'main-golden', will be available in build *201101290000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/e69eddab943f
User: Jesse Glick <jglick@netbeans.org>
Log: #194789: Stale class cleanup broken by generated sources
Comment 4 ibeaumont 2013-01-18 17:23:29 UTC
I have a module suite that always gives me this warning and recomplies everything in one module all the time.  I've recently moved to a new computer and got all the new sources again hoping it would go away, but no joy.  Having lived with it for years, I would now really like to find the cause/solution as it then recompiles 900 source files for no reason.  Any hints on how to track it down or what additional information I could provide if I log a new defect? (I'm on 7.2.1 and still the problem persists).
Comment 5 Jesse Glick 2013-01-18 18:00:37 UTC
ibeaumont: the known bug here was fixed for NB 7.0. If you are still seeing similar symptoms you may have encountered an unrelated bug, or a corner case in this one, etc. Figure out how to reproduce the problem from scratch, then file it.
Comment 6 ibeaumont 2013-01-18 18:15:53 UTC
Is there no logging or anything I could turn on to try to help figure out why it thinks the class is stale?
Comment 7 Jesse Glick 2013-01-21 15:28:32 UTC
Well, ant -v may give some useful information, but in general the most brainless way to proceed is to make sure you have a reproducible test case of some kind, then use bisection to narrow it down to a minimal test case that omits any proprietary information and will often make the cause (and fix) obvious.
Comment 8 ibeaumont 2013-01-24 16:54:09 UTC
Just before I go further and waste too much time in creating a test case, can I check it isn't supposed to do this...

I have Module 1 containing classes A,B,C.  Module 2 has classes X, Y.  Module 2 has a dependency on Module 1, and class X imports class A. 

Now, if I change any line of code in any class in Module 1 - then class X in Module 2 is marked out of date and recompiled when I build the project.
Comment 9 Jesse Glick 2013-01-24 17:13:22 UTC
IIRC this is normal as the dependency check is done by JAR rather than by *.class entry.