Hi,

> I think I've spotted a bug in the code, though.  For each 
> method it finds 
> whose name matches, it does
> >Parameter[] params = methods[i].parameters();
> >for( int j = 0; j < params.length; j++ )
> >{
> >  if( parameters == null || !params[j].typeName().equals( 
> parameters[j] 
> >) )
> >  {
> >    continue methodLoop;
> >  }
> >}
> Suppose we're looking for foobar(String) and it finds foobar() first. 
> params.length will be zero, so won't it skip straight past 
> and so generate 
> the block for that method instead of the one we're actually 
> looking for?

You are right.

> 
> > > In which case, how about "forMethod"?
> > > (it's
> > > similar to forAllMethods, but does it for only the one that's 
> > > specified rather than for each of them...)
> >
> >... and have 2 forMethod loops, one for the getters and one for the 
> >setters ?  I think it is better that both are generated 
> inside a unique 
> >loop : the "entity bean attributes loop".
> 
> No need for two loops, since (at least the last time I looked) 
> forAllPersistentFields goes through both setters and getters, 
> storing each 
> field as it goes and skipping if it comes up again.  So, if 
> there's only a 
> setter it should still include it and we can use
> 
> forAllPersistentFields
>     ifHasMethod(getter)
>         forMethod(getter)
>             ifIsNotAbstract
>                 <getter stuff>
>     ifHasMethod(setter)
>         forMethod(setter)
>             ifIsNotAbstract
>                 <setter stuff>
> 

Again right.

> > > Also, what happens if the bean class only defines a setter for a 
> > > field and not a getter?  Not very likely, I know, but 
> possible e.g. 
> > > for a password
> > > field.  Perhaps the getterMethod bits should also have an 
> ifHasMethod
> > > around
> > > them too?
> >
> >Can you do that in cmp 2.0 abstract classes ?   If yes then I guess
> >xdoclet need it too, don't see how right now...
> 
> Without going an having a look through the spec, I've no 
> idea.  However, I'm 
> still using 1.1 and BMP, and I don't know any reason it can't 
> be done with 
> those.  So long as we still allow ejbspec="1.1", I guess we 
> ought to cater 
> for it.

OK.

> 
> 
> Andrew.
> 

vincent



_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to