[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    [jira] Resolved: (XMLBEANS-258) Calling
From:       "Luke Peters (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date:       2006-03-29 14:49:06
Message-ID: 662209502.1143643746083.JavaMail.jira () ajax
[Download RAW message or body]

     [ http://issues.apache.org/jira/browse/XMLBEANS-258?page=all ]
     
Luke Peters resolved XMLBEANS-258:
----------------------------------

    Fix Version:     (was: Version 2.1)
     Resolution: Duplicate

Duplicate of 260

> Calling SchemaType.isSkippedAnonymousType() can throw a NPE
> -----------------------------------------------------------
> 
> Key: XMLBEANS-258
> URL: http://issues.apache.org/jira/browse/XMLBEANS-258
> Project: XMLBeans
> Type: Bug
> Components: XmlObject
> Versions: Version 2.1
> Environment: Java 1.5, Windows XP
> Reporter: Luke Peters

> 
> If isSkippedAnonymousType()  is called on a SchemaType instance that does not have \
> _outerSchemaTypeRef set, then a NPE will be thrown. Example: MyXmlBean myBean = \
> MyXmlBean.Factory.newInstance(); boolean isSkipped = \
> myBean.schemaType().isSkippedAnonymousType();  <- throws a NPE It seems that it \
> should return false in this instance, rather than throw an exception. All this \
> needs to fix is to add a null check. I'm not sure which versions exactly are \
> effected, but it is an issue in 2.1. Current code:
> public boolean isSkippedAnonymousType()
> { return  _outerSchemaTypeRef.get().getBaseType() == this ||
> _outerSchemaTypeRef.get().getContentBasedOnType() == this; }
> Potential fix:
> public boolean isSkippedAnonymousType()
> { return _outerSchemaTypeRef == null ? false : \
> _outerSchemaTypeRef.get().getBaseType() == this || \
> _outerSchemaTypeRef.get().getContentBasedOnType() == this; }

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic