tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "scott selikoff (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENEJB-756) CMP2 Select Generation does not include VOID return type
Date Wed, 20 Feb 2008 20:57:45 GMT
CMP2 Select Generation does not include VOID return type
--------------------------------------------------------

                 Key: OPENEJB-756
                 URL: https://issues.apache.org/jira/browse/OPENEJB-756
             Project: OpenEJB
          Issue Type: Bug
          Components: cmp2
    Affects Versions: 3.0-beta-2
         Environment: N/A
            Reporter: scott selikoff
            Priority: Minor
             Fix For: 3.0-beta-2


The method Cmp2Generator.createSelectMethod() does not support "none" return type.  If an
ejb.select method is created with result-type-mapping="mapping", then the return type will
return type will get converted to void.  This will throw a non-descriptive NullPointerException
on line 778, since the return of Cmp2Generator.Convert.getConversion() will be null.

Recommendations:

Fix #1:  Better error message than NullPointerException

A better error message would be appreciated here as is seen in the fromObjectTo() method such
as:

public static void fromObjectTo(MethodVisitor mv, Class to) {
            if (to.equals(Object.class)) {
                // direct assignment will work
            } else if (!to.isPrimitive()) {
                mv.visitTypeInsn(CHECKCAST, Type.getInternalName(to));
            } else {
                Convert conversion = getConversion(to);
                if (conversion == null) throw new NullPointerException("unsupported conversion
for EJB select return type " + from.getName());
                conversion.objectToPrimitive(mv);
            }
        }

Fix #2: Add void as a supported type.  Also, verify doing so would not be a spec violation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message