xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ce...@apache.org
Subject svn commit: r1241699 - /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java
Date Tue, 07 Feb 2012 23:23:11 GMT
Author: cezar
Date: Tue Feb  7 23:23:10 2012
New Revision: 1241699

URL: http://svn.apache.org/viewvc?rev=1241699&view=rev
Log:
Fix NPE in SchemaTypeImpl.getEnumJavaClass().

Thanks to Martin McCallion for investigation.

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java?rev=1241699&r1=1241698&r2=1241699&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java Tue Feb
 7 23:23:10 2012
@@ -1831,10 +1831,17 @@ public final class SchemaTypeImpl implem
         // This field is declared volatile and Class is immutable so this is allowed.
         if (_javaEnumClass == null)
         {
-            try
-                { _javaEnumClass = Class.forName(getBaseEnumType().getFullJavaName() + "$Enum",
false, getTypeSystem().getClassLoader()); }
-            catch (ClassNotFoundException e)
-                { _javaEnumClass = null; }
+            if ( getBaseEnumType() != null )
+            {
+                try
+                {
+                    _javaEnumClass = Class.forName(getBaseEnumType().getFullJavaName() +
"$Enum", false, getTypeSystem().getClassLoader());
+                }
+                catch (ClassNotFoundException e)
+                { 
+                    _javaEnumClass = null;
+                }
+            }
         }
 
         return _javaEnumClass;



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


Mime
View raw message