Buggy code:
private final CMNodeFactory nodeFactory = new CMNodeFactory ( ) ; private final CMBuilder fCMBuilder = new CMBuilder ( nodeFactory ) ; private final XMLSchemaLoader fSchemaLoader = new XMLSchemaLoader ( fXSIErrorReporter . fErrorReporter , fGrammarBucket , fSubGroupHandler , fCMBuilder ) ; private String fValidationRoot ; private int fSkipValidationDepth ; private int fNFullValidationDepth ; private int fNNoneValidationDepth ; private int fElementDepth ; private boolean fSubElement ; private boolean [ ] fSubElementStack = new boolean [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; private XSElementDecl fCurrentElemDecl ; private XSElementDecl [ ] fElemDeclStack = new XSElementDecl [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; private boolean fNil ; private boolean [ ] fNilStack = new boolean [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; private XSNotationDecl fNotation ; private XSNotationDecl [ ] fNotationStack = new XSNotationDecl [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; private XSTypeDefinition fCurrentType ; private XSTypeDefinition [ ] fTypeStack = new XSTypeDefinition [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; private XSCMValidator fCurrentCM ; private XSCMValidator [ ] fCMStack = new XSCMValidator [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; private int [ ] fCurrCMState ; private int [ ] [ ] fCMStateStack = new int [ XMLSchemaValidator . INITIAL_STACK_SIZE ] [ ] ; private boolean fStrictAssess = true ; private boolean [ ] fStrictAssessStack = new boolean [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; private final StringBuffer fBuffer = new StringBuffer ( ) ; private boolean fAppendBuffer = true ; private boolean fSawText = false ; private boolean [ ] fSawTextStack = new boolean [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; private boolean fSawCharacters = false ; private boolean [ ] fStringContent = new boolean [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; private final QName fTempQName = new QName ( ) ; private javax . xml . namespace . QName fRootTypeQName = null ; private int fIgnoreXSITypeDepth ; private boolean fIDCChecking ; private ValidatedInfo fValidatedInfo = new ValidatedInfo ( ) ; private ValidationState fState4XsiType = new ValidationState ( ) ; private ValidationState fState4ApplyDefault = new ValidationState ( ) ; protected XMLSchemaValidator . XPathMatcherStack fMatcherStack = new XMLSchemaValidator . XPathMatcherStack ( ) ; protected XMLSchemaValidator . ValueStoreCache fValueStoreCache = new XMLSchemaValidator . ValueStoreCache ( ) ; public XMLSchemaValidator ( ) { } public void reset ( XMLComponentManager componentManager ) throws XMLConfigurationException { } public void startValueScopeFor ( IdentityConstraint identityConstraint , int initialDepth ) { } public XPathMatcher activateField ( Field field , int initialDepth ) { } public void endValueScopeFor ( IdentityConstraint identityConstraint , int initialDepth ) { } public void setMayMatch ( Field field , Boolean state ) { } public Boolean mayMatch ( Field field ) { } private void activateSelectorFor ( IdentityConstraint ic ) { } void ensureStackCapacity ( ) { } void handleStartDocument ( XMLLocator locator , String encoding ) { } void handleEndDocument ( ) { } XMLString handleCharacters ( XMLString text ) { } private void normalizeWhitespace ( XMLString value , boolean collapse ) { } private void normalizeWhitespace ( String value , boolean collapse ) { } void handleIgnorableWhitespace ( XMLString text ) { } Augmentations handleStartElement ( QName element , XMLAttributes attributes , Augmentations augs ) { } Augmentations handleEndElement ( QName element , Augmentations augs ) { } final Augmentations endElementPSVI ( boolean root , SchemaGrammar [ ] grammars , Augmentations augs ) { } Augmentations getEmptyAugs ( Augmentations augs ) { } void storeLocations ( String sLocation , String nsLocation ) { } SchemaGrammar findSchemaGrammar ( short contextType , String namespace , QName enclosingElement , QName triggeringComponet , XMLAttributes attributes ) { } XSTypeDefinition getAndCheckXsiType ( QName element , String xsiType , XMLAttributes attributes ) { } boolean getXsiNil ( QName element , String xsiNil ) { if ( ( ( fCurrentElemDecl ) != null ) && ( ! ( fCurrentElemDecl . getNillable ( ) ) ) ) { reportSchemaError ( "cvc-elt.3.1" , new Object [ ] { element . rawname , ( ( SchemaSymbols . URI_XSI ) + "," ) + ( SchemaSymbols . XSI_NIL ) } ) ; } else { <START_BUG> String value = xsiNil . trim ( ) ; <END_BUG> if ( ( value . equals ( ATTVAL_TRUE ) ) || ( value . equals ( ATTVAL_TRUE_1 ) ) ) { if ( ( ( fCurrentElemDecl ) != null ) && ( ( fCurrentElemDecl . getConstraintType ( ) ) == ( XSConstants . VC_FIXED ) ) ) { reportSchemaError ( "cvc-elt.3.2.2" , new Object [ ] { element . rawname , ( ( SchemaSymbols . URI_XSI ) + "," ) + ( SchemaSymbols . XSI_NIL ) } ) ; } return true ; } } return false ; } void processAttributes ( QName element , XMLAttributes attributes , XSAttributeGroupDecl attrGrp ) { } void processOneAttribute ( QName element , XMLAttributes attributes , int index , XSAttributeDecl currDecl , XSAttributeUseImpl currUse , AttributePSVImpl attrPSVI ) { } void addDefaultAttributes ( QName element , XMLAttributes attributes , XSAttributeGroupDecl attrGrp ) { } void processElementContent ( QName element ) { } Object elementLocallyValidType ( QName element , Object textContent ) { } Object elementLocallyValidComplexType ( QName element , Object textContent ) { } void reportSchemaError ( String key , Object [ ] arguments ) { } private String expectedStr ( Vector expected ) { } protected static class XPathMatcherStack { protected XPathMatcher [ ] fMatchers = new XPathMatcher [ 4 ] ; protected int fMatchersCount ; protected IntStack fContextStack = new IntStack ( ) ; public XPathMatcherStack ( ) { } public void clear ( ) { } public int size ( ) { } public int getMatcherCount ( ) { } public void addMatcher ( XPathMatcher matcher ) { } public XPathMatcher getMatcherAt ( int index ) { } public void pushContext ( ) { } public void popContext ( ) { } private void ensureMatcherCapacity ( ) { } } protected abstract class ValueStoreBase implements ValueStore { protected IdentityConstraint fIdentityConstraint ; protected int fFieldCount = 0 ; protected Field [ ] fFields = null ;

Fix:
String value = XMLChar . trim ( xsiNil ) ;