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 188319 - EJBContainer J2EE Category definition has number of problems
Summary: EJBContainer J2EE Category definition has number of problems
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Ide (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: issues@profiler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-02 12:59 UTC by Denis Anisimov
Modified: 2010-08-02 09:34 UTC (History)
0 users

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 Denis Anisimov 2010-07-02 12:59:10 UTC
J2EE category definition file contains EJBContainer category for EJB project.
There are number of problems with this definition :
1) It contains subcategory Persistence .
EJB project category definition contains the same Persistence category on the 
top level.
So the same category are duplicated : its the root category and subcategory of 
other root category.
It has no sense.
Either Persistence should be removed from top level categories or 
it should be not a subcategory of EJBContainer .
2) EJBContainer contains subcategory Lifecycle based on LifecycleEJBMarkingProvider class.
The latter class's method "isValid()" is written incorrectly.
It performs checks of method annotations simple names against  fully qualified annotation names :
if (includedAnnotationsNames.contains(am.getAnnotationType().asElement().getSimpleName().toString()))
'includedAnnotationsNames' is the Set with FQN annotation names.
'am.getAnnotationType().asElement().getSimpleName()' is non-qualified annotation 
name.
As result this condition is always false.
Comment 1 Denis Anisimov 2010-07-02 14:34:04 UTC
One more issue with EJBContainer category definition:
method org.netbeans.modules.profiler.j2ee.marking.EJBMarkingProvider.isValid()
is badly implemented.
It's body is :
!(getLCProvider().isValid(method) || getPersProvider().isValid(method))
but should be 
!(getLCProvider().isValid(method) && getPersProvider().isValid(method))

Otherwise all EJB methods which are is not valid for lifecycle provider 
will be marked.
Comment 2 Denis Anisimov 2010-07-02 14:46:43 UTC
Sorry for last comment. It's wrong.
It seems the method is implemented correctly if one need to 
mark ALL methods in EJB which are not in Lifecycle category and don't contain
ejbLoad() and ejbStore() methods.

In the latter case the role of EJB2PersistenceMarkingProvider class is unknown.
It performs just check for method validness.
In this case it should not contain so much functionality . It should not extend 
BaseEJBMarkingProvider.

It seems EJBContainer/Persistence  category should not be a link to Persistence 
root category but it should be defined via custom marker provider EJB2PersistenceMarkingProvider .
Such definition of EJBContainer make sense.
Comment 3 Denis Anisimov 2010-07-05 14:21:21 UTC
changeset:   173861:b54066d812f8
tag:         tip
user:        Denis Anisimov <ads@netbeans.org>
date:        Mon Jul 05 18:19:34 2010 +0400
summary:     Fixes for BZ#188319, BZ#188278.
Comment 4 Quality Engineering 2010-07-08 03:26:36 UTC
Integrated into 'main-golden', will be available in build *201007080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/b54066d812f8
User: Denis Anisimov <ads@netbeans.org>
Log: Fixes for BZ#188319, BZ#188278.
Comment 5 J Bachorik 2010-08-02 09:34:09 UTC
Seems to be fixed for 6.9.1