[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-665) Seam throws NPE when a component without a @Name is specified in components.xml

Shane Bryzak (JIRA) jira-events at jboss.com
Wed Jan 17 07:57:54 EST 2007


     [ http://jira.jboss.com/jira/browse/JBSEAM-665?page=all ]

Shane Bryzak closed JBSEAM-665.
-------------------------------

    Fix Version/s: 1.1.1.GA
       Resolution: Done
         Assignee: Shane Bryzak

Fixed in CVS.

> Seam throws NPE when a component without a @Name is specified in components.xml
> -------------------------------------------------------------------------------
>
>                 Key: JBSEAM-665
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-665
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.0.GA
>         Environment: Win XP Pro
> Java 1.5.0
> Tomcat 6.0.7
>            Reporter: Mike Quilleash
>         Assigned To: Shane Bryzak
>             Fix For: 1.1.1.GA
>
>         Attachments: Initialization.diff
>
>
> Example line in components.xml
>   <component class="com.xxx.ElementDetail"/>
> Class ElementDetail does not have a @Name (which it should) but class Initialization method installComponentFromXmlElement() throws an NPE on this line.
>   name = clazz.getAnnotation(Name.class).value();
> Would be nice to check for the null condition and throw a more descriptive exception of the problem. e.g
> Name nameAnnotation = clazz.getAnnotation( Name.class );
> if ( nameAnnotation == null )
>     throw new IllegalArgumentException( "Component class " + class.getName() + " requires a @Name annotation or it's components.xml reference requires a name attribute" );
> name = nameAnnotation.value();

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list