Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 52905 - PrivilegedTemplates customization not possible
PrivilegedTemplates customization not possible
Product: projects
Classification: Unclassified
Component: Ant Freeform
PC Linux
: P2 (vote)
: 4.x
Assigned To: David Konecny
Depends on:
  Show dependency treegraph
Reported: 2005-01-04 14:51 UTC by Martin Adamek
Modified: 2005-01-17 17:42 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT

solution (18.84 KB, patch)
2005-01-07 08:24 UTC, David Konecny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Adamek 2005-01-04 14:51:14 UTC
There is Java-specific implementation of
(FreeformProject.PrivilegedTemplatesImpl) in
freeform project. Other freeform types (web, ejb)
don't have possibility to change it or register
new one.
Comment 1 David Konecny 2005-01-04 15:13:14 UTC
I will move it to where it belongs (i.e. java/freeform) and ensure
that all templates defined by natures as priviledged will be merged
and shown.

This is related to fix of issue 52498 which is still on my radar:
should freeform project merge impls of the same interface comming from
different natures or should it be documented that >1 impls are allowed
in project's lookup. I will resolve that as part of this issue.
Comment 2 David Konecny 2005-01-07 08:24:58 UTC
Created attachment 19542 [details]
Comment 3 David Konecny 2005-01-07 08:29:26 UTC
As said earlier there exist following problem: freeform natures can
enhance project lookup and this can result in situation where project
lookup contains two entries, but lookup contract says that there will
be only one. Example can be PrivilegedTemplates or ClassPathProvider
which are implemented both by Java freeform nature and Web freeform

The solution I propose is to add support for merging of lookup
entries. Mergining is domain knowledge and therefore cannot be done by
the freeform core without help of project natures.

Attached is diff of API and impl which works. No unit tests at the
moment. Please review. Questions/suggestions welcome. LookupMerger may
not be the best name.
Comment 4 Jesse Glick 2005-01-10 18:32:37 UTC
getMergableClasses should be getMergeableClasses.

This is definitely a good place to have unit tests; the lookup merging
code is not obvious.

BTW: clazz.equals(X.class) can be simplified to clazz == X.class.

getMerg[e]ableClasses Javadoc should emphasize that the Class's are
for the interfaces, not implementations. Probably obvious but can't
hurt to state it.

LookupMergerImpl.PrivilegedTemplatesImpl should probably remove
duplicates, e.g. using a LinkedHashSet rather than an ArrayList.

Otherwise, looks good to me.
Comment 5 David Konecny 2005-01-17 15:41:10 UTC
Fixed for all freeforms. madamek, please see the diff and verify or
update web/j2ee nature as needed.

new revision: 1.6; previous revision: 1.5
new revision: 1.32; previous revision: 1.31
initial revision: 1.1
initial revision: 1.1
initial revision: 1.1
initial revision: 1.1
new revision: 1.4; previous revision: 1.3
new revision: 1.3; previous revision: 1.2
initial revision: 1.1
new revision: 1.4; previous revision: 1.3
new revision: 1.4; previous revision: 1.3
new revision: 1.3; previous revision: 1.2
new revision: 1.5; previous revision: 1.4
new revision: 1.5; previous revision: 1.4
Comment 6 Martin Adamek 2005-01-17 17:42:59 UTC
Looks fine for EJB.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo