#84 Rev. fix for 1-valued ejb:finder returns

closed-fixed
nobody
ejbdoclet (29)
5
2002-08-13
2002-07-28
No

This is a replacement for 587583. Sorry about that.

The easiest way to see what's going on is to remove
the "view-type='local'" from AddressBean in the
samples. Rebuild and look at the AddressHome and
AddressLocalHome. The return type for
findByPrimaryKey() is correct in AddressLocalHome, it
is incorrect in AddressHome (it's still AddressLocal...)

Ignoring that there maybe shouldn't *be* a
findByPrimaryKey in the AddressBean (it's always been
generated automatically for me anyway), the problem
with the finder return type not matching the type of
interface is a problem. This patch causes it to generate
correctly.

Committer: This is simply a copy of fullPackageChange
() with a call to
InterfaceTagsHandler.getComponentInterface(). I'm not
clear whether fullPackageChange() ought to just be
changed, but I've found a lot of dead code paths while
tracking this down and adding a new path here is the
safe thing to do....

patch follows:

RCS
file: /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/mo
dules/ejb/home/HomeTagsHandler.java,v
retrieving revision 1.6
diff -r1.6 HomeTagsHandler.java
337a338,367
> * Describe what the method does
> *
> * @param s Describe what the
parameter does
> * @param clazz
> * @param type
> * @return Describe the return value
> * @exception XDocletException
> */
> public static String finderSignatureFunger(String s,
XClass clazz, String type) throws XDocletException
> {
> StringTokenizer st = new StringTokenizer(s, " ");
> String sign = st.nextToken();
> StringBuffer ret = new StringBuffer();
>
> if (sign.equals("Collection") || sign.equals
("java.util.Collection")) {
> ret.append("java.util.Collection");
> }
> else if (sign.equals("Enumeration") || sign.equals
("java.util.Enumeration")) {
> ret.append("java.util.Enumeration");
> }
> else {
> ret.append
(InterfaceTagsHandler.getComponentInterface(type,
clazz));
> }
> while (st.hasMoreTokens()) {
> ret.append(" ").append(st.nextToken());
> }
> return ret.toString();
> }
>
> /**
784c814
< String signature = fullPackageChange(tags
[i].getAttributeValue("signature"));
---
> String signature = finderSignatureFunger(tags
[i].getAttributeValue("signature"), getCurrentClass(),
type);

Discussion

  • Brian Topping

    Brian Topping - 2002-08-12
    • status: open --> pending-fixed
     
  • Brian Topping

    Brian Topping - 2002-08-13
    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks