> Well, in my effort to get class tag merging (ie: @ejb:bean in base,
and
> @ejb:bean in concrete ejb to merge), I've done some of the conversion
to
> XDocletTagSupport.
>
> My only concern is that it seems to me that a lot of the code in
xdoclet
> is copy any paste. Meaning many, many places try to lookup a
tag+param
> using DocletUtil but first checking for it in currentTag(), and then
> walking the tree backwards looking for the tag.
>
> I've removed all the instances I came across and replaced them with
the
> simpler XDocletTagSupport::getClassTagValue type lookup (thus removing
> 50+ lines of code in each place).
>
> My concern is, am I being over-zealous in my removal of code? Or is
it
> indeed true that a lot of the code is copy and paste? It's hard to
tell
> since the beautifier makes all the code look like one person wrote it.
> So there's no tell-tale signs (ie: bad formatting) of a copy/paste.
Yes and no. If you see any use of looping for getting a class tag value
then it's wrong:
clazz = clazz.superclass();
}while ( clazz != null );
For methods it's ok, because it's not possible to have tag inheritance
for methods.
Other than that, in some cases we do not want to have class tag
inheritance (for example ejb:bean name="blabla" or generate="false"
attributes should not be inherited at all, you specify generate="false"
for an abstract bean, now you override a class from this bean and you
don't see anything in dd because generate is wrongly inherited).
Obviously DocletUtil.getTagsByName() should be used for cases where
there can be more than one class tag (multiple ejb:ejb-ref class tags
for example), you shouldn't change it to getClassTagValue because it
stops at first tag.
David, I did a quick search for ".superclass();" and I didn't find a
single case where we traverse superclasses for evaluating a class tag
value.
> I just don't want to screw anything up. And since we are lacking a
> testsuite, all I can do to ensure my changes aren't screwing stuff up,
> is build the example apps, and build/deploy my own companies project.
Anyone going to set up a test suite?
Ara.
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel