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 50933 - TargetMappingPanel.show calls Util.getAntScriptTargetNames with null when there is no build script defined
Summary: TargetMappingPanel.show calls Util.getAntScriptTargetNames with null when the...
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks: 42682
  Show dependency tree
 
Reported: 2004-10-27 23:30 UTC by Jesse Glick
Modified: 2006-03-24 09:42 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Stack trace (4.23 KB, text/plain)
2004-10-27 23:30 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2004-10-27 23:30:15 UTC
041027 custom. Have a freeform prj w/o build
script ("extbuildroot" example prj in tests).
Tried to open properties dialog. Got an exception
as soon as I tried to move to the next panel.

P2 since it blocks any usage of a project without
a build script, which is a valid case. Obviously
we can't do target mappings for such a project, so
the panel should just be
disabled/hidden/empty/etc. in such a case.
Comment 1 Jesse Glick 2004-10-27 23:30:37 UTC
Created attachment 18572 [details]
Stack trace
Comment 2 David Konecny 2004-10-29 08:33:19 UTC
I disagree that this is valid case. What's the point of Freeform
project for Existing Ant Script when you do not have the script? I
understand that even such a project can be of some use (eg. for
editing), but it was never said that this is a usecase. Wizard will
not let you proceede without Ant script too.

I can make code more robust to behave gracefully, but it is P3, maybe
even P4. Perhaps even better would be to generate empty build.xml in
this case so that user can later add some targets what is highly
probable they will want/need to do.
Comment 3 David Konecny 2004-10-29 09:25:02 UTC
Target Mappings panel is still enabled, but no NPE is thrown and no
targets are offered.

Fixed in:
src/org/netbeans/modules/ant/freeform/Util.java;
new revision: 1.9; previous revision: 1.8
src/org/netbeans/modules/ant/freeform/ui/TargetMappingPanel.java;
new revision: 1.27; previous revision: 1.26
Comment 4 Jesse Glick 2004-10-29 16:31:17 UTC
"What's the point of Freeform project for Existing Ant Script when you
do not have the script?" - just having a project setup for organizing
and editing stuff; you may not need to build anything, in which case
no script is required. For that matter, a freeform project could use
several Ant scripts for different purposes; I would expect the GUI to
politely refuse to help you edit targets in this case.

I know the wizard will not currently let you proceed - that is issue
#49029. Until that is implemented, the least we can do is not throw
exceptions if a power user makes such an empty script by hand. :-)
Comment 5 Jesse Glick 2004-10-29 16:34:41 UTC
Seems better behaved now, thanks.