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 152728 - JavaRunner.QUICK_CLEAN pops up Ant window
Summary: JavaRunner.QUICK_CLEAN pops up Ant window
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks: 145243
  Show dependency tree
 
Reported: 2008-11-07 20:21 UTC by Jesse Glick
Modified: 2011-06-23 15:55 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 Jesse Glick 2008-11-07 20:21:33 UTC
My initial impl of issue #145243 did not work out so well. QUICK_CLEAN is supposed to delete any NB-generated *.class
files, and it does. I wanted to do this before the user runs any real Ant target on the project. Unfortunately, the
JavaRunner implementation uses Ant to implement QUICK_CLEAN, and this displays an Ant window "clean" which is very
distracting. The problem is worse because autoproject does not know whether QUICK_CLEAN is really needed -
BuildArtifactMapperImpl makes this decision - so it always runs the clean target.

As a partial workaround, I will change autoproject to run QUICK_CLEAN only if .netbeans_automatic_build can be found in
the classes dir, at least reducing the number of times the problem happens. If this bug is not fixed, I may be forced to
implement the equivalent of QUICK_CLEAN by hand.

Please change JavaRunnerImpl to perform cleaning without using Ant. There is no advantage to going through Ant for this
purpose.
Comment 1 Jesse Glick 2008-11-07 20:34:38 UTC
Working around in contrib #569eae9475a4. I had also mistakenly failed to wait for the ExecutorTask from QUICK_CLEAN to
complete before running the regular Ant task. With that fixed, the situation is a bit better because usually the real
task will reuse the same process window. Of course this will not be true for Maven projects.
Comment 2 Jan Lahoda 2008-11-10 15:53:18 UTC
http://hg.netbeans.org/main/rev/ab1d44805f9b
Comment 3 Milos Kleint 2008-11-10 17:48:09 UTC
just a quick question. 
What are the cannonical usecases for the QUICK_CLEAN Java runner?
Comment 4 Jesse Glick 2008-11-10 18:23:16 UTC
Don't forget you can delete clean-snippet.xml and the clean attr of TranslateClassPath.


I will remove the workaround in autoproject: contrib #43462eede110


Milos: QUICK_CLEAN should be run before running any target on the project which might possibly create a production
artifact, to delete any class files generated by the NB internal compiler. These files are made to have an old
timestamp, so they would probably be recompiled by javac anyway, but better safe than sorry.

http://wiki.netbeans.org/CompileOnSave#section-CompileOnSave-LocationOfClassesToExecute

has discussion. You can see

http://hg.netbeans.org/main/contrib/raw-file/tip/autoproject.java/src/org/netbeans/modules/autoproject/java/actions/ActionProviderImpl.java#cleanGeneratedClassfiles

for an example.
Comment 5 Quality Engineering 2008-11-11 05:07:45 UTC
Integrated into 'main-golden', will be available in build *200811110201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/ab1d44805f9b
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #152728: do not execute ant for QUICK_CLEAN.
Comment 6 Jesse Glick 2011-06-23 15:55:30 UTC
Review the parenthetical note in bug #199145 comment #1 if you have not done so already.