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 181358 - NB Module file templates generate incorrect code in Maven NB Module project
Summary: NB Module file templates generate incorrect code in Maven NB Module project
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Templates (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 181141 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-01 06:55 UTC by Antonin Nebuzelsky
Modified: 2010-03-10 19:58 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 Antonin Nebuzelsky 2010-03-01 06:55:21 UTC
There are differences between code generated by APIsupport wizards for Module projects in Ant and in Maven.

For example Action wizard generates

   public final class MyNewAction implements ActionListener

in an Ant project

and

   public final class MyAction extends CookieAction

in a Maven project.

o.n.m.apisupport.project.ui.wizard.action.DataModel.regenerate() first checks if org.openide.awt>=7.3 can be added as a dependency and if it can the "actionListener" template is used. If not then "callableSystemAction" template is used. This logic is called before the dependency is really added to the module.

According to Milos: This logic is flawed for maven projects. It cannot effectively tell the "context" what the "possible" dependencies are. You can try adding the dependency on o.o.awt and then somehow wait and somehow read if the specification version is 7.3+. I would suggest to let user pick what to generate (eg. Generate 6.1 compatible codebase checkbox).

Not only Action wizard, but other wizards may have the same problem (seen it in Window component wizard too).
Comment 1 Jesse Glick 2010-03-01 09:22:29 UTC
Will probably just remove code to support older platforms.
Comment 2 Jesse Glick 2010-03-09 08:22:44 UTC
Assuming new versions of APIs are available unless there is specific information to the contrary.

core-main #18fc8c4cd30f
Comment 3 Jesse Glick 2010-03-10 19:58:52 UTC
*** Bug 181141 has been marked as a duplicate of this bug. ***