Buggy code:
for ( int j = 0 ; j < ( types . length ) ; j ++ ) dTValidators . addElement ( types [ j ] ) ; } else { dTValidators . addElement ( baseValidator ) ; } } } } if ( baseTypeName == null ) { content = DOMUtil . getNextSiblingElement ( content ) ; } else { content = DOMUtil . getFirstChildElement ( content ) ; if ( content != null ) { if ( DOMUtil . getLocalName ( content ) . equals ( ELT_ANNOTATION ) ) { traverseAnnotationDecl ( content , attrValues , false , schemaDoc ) ; content = DOMUtil . getNextSiblingElement ( content ) ; } } } if ( union ) { if ( memberTypes != null ) { if ( content != null ) { if ( DOMUtil . getLocalName ( content ) . equals ( ELT_ANNOTATION ) ) { traverseAnnotationDecl ( content , attrValues , false , schemaDoc ) ; content = DOMUtil . getNextSiblingElement ( content ) ; } } if ( content != null ) { if ( DOMUtil . getLocalName ( content ) . equals ( ELT_ANNOTATION ) ) { Object [ ] args = new Object [ ] { nameProperty } ; reportSchemaError ( "dt-union-memberType" , args ) ; } } } while ( content != null ) { baseValidator = traverseLocal ( content , schemaDoc , grammar ) ; if ( baseValidator != null ) { if ( ( ( fListName . length ( ) ) != 0 ) && ( ( baseValidator . getVariety ( ) ) == ( XSSimpleType . VARIETY_LIST ) ) ) { reportCosListOfAtomic ( qualifiedName ) ; return null ; } if ( ( baseValidator . getVariety ( ) ) == ( XSSimpleType . VARIETY_UNION ) ) { XSSimpleType [ ] types = ( ( org . apache . xerces . impl . dv . XSUnionSimpleType ) ( baseValidator ) ) . getMemberTypes ( ) ; for ( int i = 0 ; i < ( types . length ) ; i ++ ) dTValidators . addElement ( types [ i ] ) ; } else { dTValidators . addElement ( baseValidator ) ; } } if ( baseValidator == null ) { Object [ ] args = new Object [ ] { content . getAttribute ( ATT_BASE ) , nameProperty } ; reportSchemaError ( "dt-unknown-basetype" , args ) ; baseValidator = SchemaGrammar . fAnySimpleType ; } content = DOMUtil . getNextSiblingElement ( content ) ; } } if ( ( fListName . length ( ) ) != 0 ) { if ( fListName . equals ( qualifiedName ) ) { fListName = SchemaSymbols . EMPTY_STRING ; } } XSFacets facetData = null ; short presentFacets = 0 ; short fixedFacets = 0 ; if ( restriction && ( content != null ) ) { FacetInfo fi = traverseFacets ( content , contentAttrs , nameProperty , baseValidator , schemaDoc , grammar ) ; content = fi . nodeAfterFacets ; if ( content != null ) { content = null ; reportSchemaError ( "s4s-elt-must-match" , new Object [ ] { SchemaSymbols . ELT_RESTRICTION , "(annotation?,<seq2seq4repair_space>(simpleType?,<seq2seq4repair_space>(minExclusive<seq2seq4repair_space>|<seq2seq4repair_space>minInclusive<seq2seq4repair_space>|<seq2seq4repair_space>maxExclusive<seq2seq4repair_space>|<seq2seq4repair_space>maxInclusive<seq2seq4repair_space>|<seq2seq4repair_space>totalDigits<seq2seq4repair_space>|<seq2seq4repair_space>fractionDigits<seq2seq4repair_space>|<seq2seq4repair_space>length<seq2seq4repair_space>|<seq2seq4repair_space>minLength<seq2seq4repair_space>|<seq2seq4repair_space>maxLength<seq2seq4repair_space>|<seq2seq4repair_space>enumeration<seq2seq4repair_space>|<seq2seq4repair_space>whiteSpace<seq2seq4repair_space>|<seq2seq4repair_space>pattern)*))" } ) ; } facetData = fi . facetdata ; presentFacets = fi . fPresentFacets ; fixedFacets = fi . fFixedFacets ; } else if ( list && ( content != null ) ) { if ( baseTypeName != null ) { if ( DOMUtil . getLocalName ( content ) . equals ( ELT_ANNOTATION ) ) { traverseAnnotationDecl ( content , attrValues , false , schemaDoc ) ; content = DOMUtil . getNextSiblingElement ( content ) ; } if ( content != null ) { Object [ ] args = new Object [ ] { nameProperty } ; reportSchemaError ( "dt-list-itemType" , args ) ; } } else { reportSchemaError ( "s4s-elt-must-match" , new Object [ ] { SchemaSymbols . ELT_LIST , "(annotation?,<seq2seq4repair_space>(simpleType?))" } ) ; } } else if ( union && ( content != null ) ) { reportSchemaError ( "s4s-elt-must-match" , new Object [ ] { SchemaSymbols . ELT_UNION , "(annotation?,<seq2seq4repair_space>(simpleType?))" } ) ; } XSSimpleType newDecl = null ; if ( list ) { newDecl = schemaFactory . createTypeList ( nameProperty , schemaDoc . fTargetNamespace , ( ( short ) ( finalProperty ) ) , baseValidator ) ; } else if ( restriction ) { newDecl = schemaFactory . createTypeRestriction ( nameProperty , schemaDoc . fTargetNamespace , ( ( short ) ( finalProperty ) ) , baseValidator ) ; try { fValidationState . setNamespaceSupport ( schemaDoc . fNamespaceSupport ) ; newDecl . applyFacets ( facetData , presentFacets , fixedFacets , fValidationState ) ; } catch ( InvalidDatatypeFacetException ex ) { <START_BUG> reportSchemaError ( "cvc-simple-type" , new Object [ ] { ( ( "facet<seq2seq4repair_space>error<seq2seq4repair_space>when<seq2seq4repair_space>creating<seq2seq4repair_space>type<seq2seq4repair_space>'" + qualifiedName ) + "':<seq2seq4repair_space>" ) + ( ex . getLocalizedMessage ( ) ) } ) ; <END_BUG> } } else { XSSimpleType [ ] memberDecls = new XSSimpleType [ dTValidators . size ( ) ] ; for ( int i = 0 ; i < ( dTValidators . size ( ) ) ; i ++ ) memberDecls [ i ] = ( ( XSSimpleType ) ( dTValidators . elementAt ( i ) ) ) ; newDecl = schemaFactory . createTypeUnion ( nameProperty , schemaDoc . fTargetNamespace , ( ( short ) ( finalProperty ) ) , memberDecls ) ; } if ( ( nameProperty == null ) && isGlobal ) { return null ; } if ( ( newDecl != null ) && isGlobal ) { grammar . addGlobalTypeDecl ( newDecl ) ; } return newDecl ; } private void reportCosListOfAtomic ( String qualifiedName ) { } private XSSimpleType findDTValidator ( Element elm , QName baseTypeStr , short baseRefContext , XSDocumentInfo schemaDoc ) { } private boolean isListDatatype ( XSSimpleType validator ) { } }

Fix:
reportSchemaError ( ex . getKey ( ) , ex . getArgs ( ) ) ;