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 142490 - Serious problems caused by fix of issue #140680
Summary: Serious problems caused by fix of issue #140680
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: Pavel Flaska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-31 23:04 UTC by Jan Lahoda
Modified: 2008-08-02 15:57 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Suggested patch, review if you can (5.81 KB, patch)
2008-08-01 11:53 UTC, Pavel Flaska
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2008-07-31 23:04:11 UTC
I am afraid that the fix of issue #140680 is causing serious problems. In short, the problem is that if the digest
matches, the "clean" conditions (most importantly: the "clean" parameter to the "updateFolder" method, classpath
mismatches and the "dirty" check [the latter two are checked inside the parseFiles method]) are ignored. These
conditions are supposed to compile all files in the given folder from scratch. The fact that these conditions are
ignored leads into incorrect error badges, and incorrect .class files. In the worst case, the .class files may not exist
at all (open a J2SE project with broken platform - this seems not to create the .class files at all. Correct the
platform - the .class files will not be generated.) Simplest reproducible case that I found is: have a J2SE project,
which contains a class (should not be opened in the editor, or at least should not be active in the editor) referencing
other class from a "standalone" .jar file ("standalone" means that no SourceForBinaryQuery will answer for it, so there
will be no sources attached to it). Remove the .jar from the project classpath - the error badges are not going to
appear. IDE restart won't fix it.

I would suggest to check the digest after checking the "clean" conditions in the parseFiles method, and (of course)
recompiling the source root if any of the "clean" conditions is met.

BTW: please use 'ensureAttributeValue(rootUrl, "digest", ..., **true**)' to verify the digest ("markDirty == true" will
ensure that if something goes very wrong during compilation (e.g. VM crash), next time the source root will be compiled
again).

Please either fix this or rollback/disable the digest optimalization ASAP. I personally do not think we should ship M2
with this problem.
Comment 1 Pavel Flaska 2008-08-01 09:14:41 UTC
Reproducible.
Comment 2 Pavel Flaska 2008-08-01 11:53:20 UTC
Created attachment 66294 [details]
Suggested patch, review if you can
Comment 3 Jan Lahoda 2008-08-01 12:23:54 UTC
Seems OK to me.
Comment 4 Pavel Flaska 2008-08-01 13:46:05 UTC
changeset 5669efc6a2e5 in main
Comment 5 Quality Engineering 2008-08-02 15:57:25 UTC
Integrated into 'main-golden', available in build *200808021401* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/5669efc6a2e5
User: Pavel Flaska <pflaska@netbeans.org>
Log: #142490: Do rescan in case of classpath change and when previous source compilation hasn't been finished.