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 180220 - Project XML file is being regenerated twice in whitelist test
Summary: Project XML file is being regenerated twice in whitelist test
Status: CLOSED FIXED
Alias: None
Product: qa
Classification: Unclassified
Component: Tests (show other bugs)
Version: 5.x
Hardware: Other Linux
: P2 normal (vote)
Assignee: Oleg Khokhlov
URL:
Keywords: PERFORMANCE, TEST
Depends on:
Blocks:
 
Reported: 2010-02-03 08:47 UTC by Jaroslav Tulach
Modified: 2011-05-24 13:54 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 Jaroslav Tulach 2010-02-03 08:47:01 UTC
Our whitelist tests seem to indicate that start with limewire project now regenerates some XML files (build-impl.xml?). This started recently, did you changed the format of build-impl.xml file? If so, is it necessary to regenerate the scripts before the project is modified (as a user I always find this very disrupting especially when switching between two versions of the IDE and each of them regenerates the build scripts according to its needs)?

The more information about the whitelist test is available at 
http://wiki.netbeans.org/FitnessViaWhiteAndBlackList

The current list of violating classes is at http://deadlock.netbeans.org/hudson/job/ergonomics/ including stacktraces.


This is the stacktrace that is loading in Xalan:

com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:614)
org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1$1.run(GeneratedFilesHelper.java:317)
org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:122)
org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:539)
org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1.run(GeneratedFilesHelper.java:291)
org.netbeans.spi.project.support.ant.GeneratedFilesHelper$1.run(GeneratedFilesHelper.java:284)
org.openide.util.Mutex.writeAccess(Mutex.java:433)
org.netbeans.spi.project.support.ant.GeneratedFilesHelper.generateBuildScriptFromStylesheet(GeneratedFilesHelper.java:284)
org.netbeans.spi.project.support.ant.GeneratedFilesHelper$3.run(GeneratedFilesHelper.java:801)
org.netbeans.spi.project.support.ant.GeneratedFilesHelper$3.run(GeneratedFilesHelper.java:797)
Comment 1 Tomas Zezula 2010-02-03 09:16:49 UTC
The J2SEProject uses GeneratedFilesHelper.refreshBuildScript to regenerate the build-impl.xml.
The GeneratedFilesHelper.refreshBuildScript uses CRCs stored in the genfiles.properties.
Comment 2 Jaroslav Tulach 2010-02-03 10:48:18 UTC
The file is really regenerated during 3rd run. To reproduce:

$ cd ide.kit/test/whitelist
$ ant

after few minutes of downloading and three starts of the IDE, you shall get the results.

During 2nd start, the lime6 project is opened (it contains broken links, but that shall not matter, in my opinion), and the system waits for finish of initial parsing. Then it restarts. I believe there is no reason why the project shall be regenerated on next start.
Comment 3 Jesse Glick 2010-02-03 13:09:25 UTC
(In reply to comment #0)
> did you change the format of build-impl.xml

Sure, jlahoda did some changes recently to java.j2seproject/resources/build-impl.xsl to support annotation processing. I presume this would mean that your test project would need to be kept updated to match changes in this file, unless you grant an exclusion for classes loaded by GeneratedFilesHelper.

> is it necessary to regenerate
> the scripts before the project is modified

In general, yes, since updates to scripts are often needed to support various features, whether or not the user happens to have made unrelated modifications to project configuration.

> when switching between two versions of the IDE and each
> of them regenerates the build scripts according to its needs

This no longer happens. (bug #42735)
Comment 4 Jaroslav Tulach 2010-02-04 02:20:46 UTC
Reopening, please see also comments in #2.

In response to #3. The fact that jlahoda changed the format recently explains why the test started to fail ~two weeks ago. I am glad bug #42735 is fixed. Still, as explained in #2 there is something buggy. The project format shall have been regenerated during its first open (2nd start of the IDE in the whitelist test) and close. Not on subsequent restart (3rd start of the IDE in the whitelist test).
Comment 5 Jaroslav Tulach 2010-02-04 04:00:55 UTC
I've added these classes to whitelist for now (remove them when fixed):
http://hg.netbeans.org/ergonomics/rev/548e1b63f8d7
Comment 6 Jesse Glick 2010-02-04 08:24:57 UTC
Most likely a bug in the test but I will investigate when I get a chance. Not a P2.
Comment 7 Jaroslav Tulach 2010-02-04 09:17:34 UTC
What kind of bug could that be? Improper exit? Broken references in the project? None of this shall prevent the system to properly upgrade the build-impl.xml on first open. We need a resolution (even won'tfix with trustable explanation) by 6.9. Thus it shall be P2.
Comment 8 Tomas Zezula 2010-02-04 09:33:10 UTC
I've tested the used limewire project by hand, I've done what Jarda described.
1st) I've opened the project -> the build-impl.xml is updated, which is OK as there is newer version of build-impl.xsl
2nd) I've deleted user dir
3rd) I've reopened the project -> no update of the build-impl.xml. The getBuildScriptState(path, stylesheet) returned 0. => The GeneratedFilesHelper works fine => the problem is in the test.
BTW the test project has wrong absolute paths causing lots of exceptions during normalization of file in folder /home/pflaska/ergonomics
It may be P2 if you think so, but the category should be performance.
Comment 9 Tomas Zezula 2010-02-04 09:35:41 UTC
The absolute paths are caused by distributing nbproject/private/* files.
Should be removed.
Comment 10 Jesse Glick 2010-02-04 10:04:47 UTC
Reassigning accordingly.
Comment 11 Jaroslav Tulach 2010-02-05 01:06:35 UTC
Thank you Jesse and Tomáš for guiding me to realize that the problem is in the test.

In case anyone ever needs to debug the startup sequence, here is little howto:
http://wiki.netbeans.org/wiki/index.php?title=FitnessViaWhiteAndBlackList&diff=33195&oldid=29435

Oleg, can you please fix the test?
1. create lime6.zip without broken references to avoid negative initial impression as in comment #8 (primarily this needs to remove private/*properties, then there are still two libraries missing)
2. copy the project from data dir elsewhere. The data dir is deleted and recreated before test3 is started, thus changes made in test2 run are not visible in test3.

Thanks, this will prevent future failures when the format of build-impl.xml is changed.
Comment 12 Oleg Khokhlov 2010-02-19 07:56:29 UTC
fixed #1 - updated limewire project and uploaded it to hg binaries, changed build.xml to use updated project.
Comment 13 Oleg Khokhlov 2010-03-01 05:49:27 UTC
should be finally fixed now.