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 46881 - Adding new source folder to freeform project does not add a <compilation-unit>
Summary: Adding new source folder to freeform project does not add a <compilation-unit>
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks: 42682
  Show dependency tree
 
Reported: 2004-08-04 00:09 UTC by Jesse Glick
Modified: 2006-03-24 10:22 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 2004-08-04 00:09:13 UTC
040803, b60. Create a new freeform project for
e.g. Jakarta Xerces-J. Select "src" and "tests"
initially. Skip over classpath panel. project.xml
gets the compilation units. Now open customizer,
add "samples" dir, close dialog. Source folders
list and logical view are updated with new source
root, but there is no <compilation-unit> for it.
Comment 1 Jesse Glick 2004-08-12 01:17:08 UTC
Frankly I don't think I understand this code well enough to fix it.
Seems that updating compilation units is done only by ClasspathPanel,
so if you don't touch this panel, it won't be changed?? Weird design IMHO.
Comment 2 David Konecny 2004-08-16 14:36:06 UTC
Hi Jesse,

"Seems that updating compilation units is done only by ClasspathPanel,
so if you don't touch this panel, it won't be changed?? Weird design
IMHO." - I have to look at the code to be 100% sure, but I think
that's how it works. Compilation units are generated only when you
specify something in ClasspathPanel. I believe they are optional so
why to generate them when I do not have classpath?
Comment 3 Jesse Glick 2004-08-16 22:20:34 UTC
No! Compilation units should *always* be listed explicitly; an empty
classpath (or no <classpath> at all) is fine. If there is no
<compilation-unit>, you get null from ClassPath.getClassPath (even for
SOURCE) which is quite wrong - means e.g. that the fallback provider
is used instead, etc.
Comment 4 David Konecny 2004-08-31 12:25:00 UTC
I refactored the logic from wizard panels into separate class and
fixed this issue. I agree that logic become a bit bloated and was hard
to grasp even for me after my holiday. It is also better unit tested now.

Fixed in:
Checking in
src/org/netbeans/modules/ant/freeform/ui/BasicProjectInfoWizardPanel.java;
new revision: 1.5; previous revision: 1.4
Checking in src/org/netbeans/modules/ant/freeform/ui/ClasspathPanel.java;
new revision: 1.17; previous revision: 1.16
Checking in
src/org/netbeans/modules/ant/freeform/ui/ClasspathWizardPanel.java;
new revision: 1.6; previous revision: 1.5
Checking in src/org/netbeans/modules/ant/freeform/ui/GeneralPanel.java;
new revision: 1.6; previous revision: 1.5
Checking in
src/org/netbeans/modules/ant/freeform/ui/NewJ2SEFreeformProjectWizardIterator.java;
new revision: 1.15; previous revision: 1.14
Checking in
src/org/netbeans/modules/ant/freeform/ui/NewWebFreeformProjectWizardIterator.java;
new revision: 1.10; previous revision: 1.9
Checking in src/org/netbeans/modules/ant/freeform/ui/OutputPanel.java;
new revision: 1.10; previous revision: 1.9
Checking in
src/org/netbeans/modules/ant/freeform/ui/ProjectCustomizer.java;
new revision: 1.14; previous revision: 1.13
Checking in src/org/netbeans/modules/ant/freeform/ui/ProjectModel.java;
initial revision: 1.1
Checking in
src/org/netbeans/modules/ant/freeform/ui/SourceFoldersPanel.form;
new revision: 1.4; previous revision: 1.3
Checking in
src/org/netbeans/modules/ant/freeform/ui/SourceFoldersPanel.java;
new revision: 1.20; previous revision: 1.19
Checking in
src/org/netbeans/modules/ant/freeform/ui/SourceFoldersWizardPanel.java;
new revision: 1.9; previous revision: 1.8
Checking in
src/org/netbeans/modules/ant/freeform/ui/TargetMappingPanel.java;
new revision: 1.21; previous revision: 1.20
Checking in
src/org/netbeans/modules/ant/freeform/ui/TargetMappingWizardPanel.java;
new revision: 1.10; previous revision: 1.9
Checking in
src/org/netbeans/modules/ant/freeform/ui/WebLocationsPanel.java;
new revision: 1.17; previous revision: 1.16
Checking in
src/org/netbeans/modules/ant/freeform/ui/WebLocationsWizardPanel.java;
new revision: 1.10; previous revision: 1.9
Removing
test/unit/src/org/netbeans/modules/ant/freeform/ui/ClasspathPanelTest.java;
new revision: delete; previous revision: 1.1
Checking in
test/unit/src/org/netbeans/modules/ant/freeform/ui/ProjectModelTest.java;
initial revision: 1.1
Comment 5 Jesse Glick 2004-08-31 13:39:13 UTC
Thanks, from the commit log at least it looks that it will be easier
to make fixes in the future...
Comment 6 David Konecny 2004-08-31 13:52:03 UTC
Definitely.
Comment 7 Marian Mirilovic 2005-12-20 15:49:30 UTC
This issue was solved long time ago. Because nobody has reopened it neither
added comments, we are verifying/closing it now. 
If you are still able to reproduce the problem, please reopen. Thanks in advance.