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.
Summary: | [65cat] after disabling, CoS is still in action | ||
---|---|---|---|
Product: | java | Reporter: | ulfzibis <ulfzibis> |
Component: | Project | Assignee: | Tomas Zezula <tzezula> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | jbecicka, olangr, pjiricka, pkeegan |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
ulfzibis
2008-08-30 10:14:48 UTC
*** Issue 145669 has been marked as a duplicate of this issue. *** *** This issue has been marked as a duplicate of 145669 *** Please let the NetBeans guy's decide. A solution that comes to my mind is that the project would delete the marking file (${build.dir}/.netbeans_automatic_build) when the compile on save is disabled and the project properties dialog closed. I do not think this qualifies as P1 - there is a simple workaround: Clean & Build the project (also any of Build, Clean and Run should suffice in the case of J2SE Project). I'm OK with P2. I tried your simple workaround: Clean & Build the project (J2SE Project), then disabled CoS. I modified some java file. After Save All the the changed class was compile newly. :-( The marker file is still there, but it's at ${build.dir}/classes/, not at ${build.dir}/ ??? After ~20 minutes the marker was disappeared by itself. :-)( There are several things: 1) The issue is reproduceable only on Windows, the COS sets timestamps of generated files to 1.1.1970 0:0 which doesn't work on Windows. This causes that the COS class file is always overwritten by the ant build script. 2) Cleaning the .netbeans_automatic_* file doesn't help since the check is not done for run single. So the build script needs to be changed to call verify-automatic even for run single and debug single. Unfortunately on Windows cleaning the .netbeans_automatic_build makes the situation even worse since the COS generated files are not cleaned and become part of deployed application. You are any more sure, this issue is only P2 ? ;-) -Ulf The solution seems to be cleaning the project when user closes customizer and (s)he disabled the COS. I will try. Suggestion: possible Clean of the project should be notified to the user in the customizer! >possible Clean of the project should be notified to the user in the customizer
Not probably needed, disabling of COS always forced clean (by ant script), the problem was that it was later than needed.
But it's no problem to add it, except of it needs an ui review.
I have the fix ready to integrate. Now I need to approve the following UI change: The Compile tab will display a warning message (in the bottom) when the COS changed state from yes to no. Message: Disabling of Compile on Save will cause clean of the project. >possible Clean of the project should be notified to the user in the customizer
Yes, it should be simple:
Instead:
X Compile on Save
Better:
X Compile on Save (Note: Change forces Clean of the Project after OK)
BTW:
1. In build 200808260201, disabling of CoS didn't force clean on my system.
2. It's curious, that in NetBeans dialogues (but not in Help!) nouns are capitalized like in German. Is it like that
also in Czech? I found some inconsistencies, e.g. in Project Properties->Libraries: "Compile-time libraries are
propagated to all categories."
Also see my comment (IMHO:) at issue 145790 Oops, cross-posting! I correct: X Compile on Save (Note: Disabling [forces|will cause] Clean of the Project after OK) ... additional bottom line is not needed. ;-) What's about 'Track Java Dependencies'? Shouldn't it force a clean too? >1. In build 200808260201, disabling of CoS didn't force clean on my system. When you disable the COS and run the build script the Ant check existence of .netbeans_automatic_build, if it exists it does the clean, unfortunately there was a issue that the checks is not done in compile-single, so if you invoke run file the project is not cleaned, i've fixed it as part of fix of this issue. >2. It's curious, that in NetBeans dialogues (but not in Help!) nouns are capitalized like in German. Is it like that >also in Czech? I found some inconsistencies, e.g. in Project Properties->Libraries: "Compile-time libraries are >propagated to all categories." No, in Czech nouns start with lower case. An UI rule suggest start nouns with upper case, but it should be consistent. > When you disable the COS and run the build script ...
OK, clean is processed after 1st "Build Main Project", ... but not directly after disabling CoS.
Track Java Dependencies doesn't need to clean project, it just doesn't call ant depend task when disabled. I'm not sure a message is really needed to notify people that the project will be cleaned. In fact, I think putting that parenthetical message after the Compile on Save checkbox would be confusing as it mixes general behavior (no Compile on Save) with one-time behavior (project will be cleaned this one time). Are there any clear use cases where it would be a nasty surprise for users that their project has been cleaned? If there are some use cases where it is important that the user know about the cleaning, maybe it would be better to provide a warning dialog or text directly in the Project Properties that appears after deselecting Compile on Save. Ondra would know better than me. Such text could be something like "After you disable Compile on Save, the project is cleaned." Hm, I must admit, that I don't understand why clean is a *must* after disabling CoS, but not after enabling 'Track Java Dependencies' In both cases just a property in private.properties will be changed which doesn't need an Ant run. In both cases not until the first build run, the state of the project/build is according the property settings. > Such text could be something like "After you disable Compile on Save, the project is cleaned."
Better (IMHO): "If you disable Compile on Save, the project will be cleaned by the first build run after."
(According to: "When you disable the COS _and_ run the build script ... it does the clean")
The clean is needed since the .netbeans_automatic_build file + all the created files which may come from uncompilable code has to be deleted. The question is if we should do it quietly or warn a user about it. Currently the clean was quietly done when the user firstly called build (run, debug,...) Turning off the COS is not just changing state of single property it's much more. In case of depend (Track Java Dependencies) there is no need to clean the class files, they come from compilable code which may become part of final distribution. I have no strong opinion about the need of warning. Another solution is to display a warning in the bottom of customizer when the user disables the COS, but maybe no warning is needed at all. >"If you disable Compile on Save, the project will be cleaned by the first build run after"
This is the current behavior which doesn't work, the project needs to be cleaned immediately when you accept the options (OK) otherwise the
class files will be generated by saving java file until the clean.
I talked to tzezula and pkeegan and none of us is aware of any real-life situation when not warning the user could pose a problem. So let's go with the no-warning option and just run clean silently on the background after user hits the OK button. The warning can be added later if it proves to be a problem in some marginal cases. > This is the current behavior ...
Ok, I misunderstood your "When you disable the COS _and_ run the build script ... it does the clean" as meant for the
current behaviour, not for the future fix.
How is CoS designed? Does it always force, that no file remains in "Needs compile", or does it just compile the modified
file (which only includes minimal dependencies)?
I often had the case, that is was beneficial, that I had "Compile File" + "Run File" when trying some modifications,
without the need of adapting the whole project (to be completely compilable) to my current work in some single file.
... but I assume, since ~ NB 4.1 (see issue 58122) it's unfortunatly no more possible to run-single without having *all*
files compiled.
While running COS enabled, the IDE compiles just the saved files, when you do run (run single) nothing is needed to compile. But when you disable COS you don't want to use compile on save anymore, but there can be files which come from sources which are not compilable (which is impossible when COS is disabled), so the project needs to clean the classes to get into the consistent state. The classes are deleted only in situation when you disable COS. Integrated into 'main-golden', will be available in build *200809031401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/2cd160b17fd9 User: Tomas Zezula <tzezula@netbeans.org> Log: #145671:after disabling, CoS is still in action |