Buggy code:
abstract class XSDAbstractTraverser { protected static final String NO_NAME = "(no<seq2seq4repair_space>name)" ; protected static final int NOT_ALL_CONTEXT = 0 ; protected static final int PROCESSING_ALL_EL = 1 ; protected static final int GROUP_REF_WITH_ALL = 2 ; protected static final int CHILD_OF_GROUP = 4 ; protected static final int PROCESSING_ALL_GP = 8 ; protected XSDHandler fSchemaHandler = null ; protected SymbolTable fSymbolTable = null ; protected XSAttributeChecker fAttrChecker = null ; protected boolean fValidateAnnotations = false ; ValidationState fValidationState = new ValidationState ( ) ; XSDAbstractTraverser ( XSDHandler handler , XSAttributeChecker attrChecker ) { } void reset ( SymbolTable symbolTable , boolean validateAnnotations ) { } XSAnnotationImpl traverseAnnotationDecl ( Element annotationDecl , Object [ ] parentAttrs , boolean isGlobal , XSDocumentInfo schemaDoc ) { } XSAnnotationImpl traverseSyntheticAnnotation ( Element annotationParent , String initialContent , Object [ ] parentAttrs , boolean isGlobal , XSDocumentInfo schemaDoc ) { } private static final XSSimpleType fQNameDV = ( ( XSSimpleType ) ( SG_SchemaNS . getGlobalTypeDecl ( ATTVAL_QNAME ) ) ) ; private StringBuffer fPattern = new StringBuffer ( ) ; private final XSFacets xsFacets = new XSFacets ( ) ; static final class FacetInfo { final XSFacets facetdata ; final Element nodeAfterFacets ; final short fPresentFacets ; final short fFixedFacets ; FacetInfo ( XSFacets facets , Element nodeAfterFacets , short presentFacets , short fixedFacets ) { } } XSDAbstractTraverser . FacetInfo traverseFacets ( Element content , XSSimpleType baseValidator , XSDocumentInfo schemaDoc ) { } private boolean containsQName ( XSSimpleType type ) { } Element traverseAttrsAndAttrGrps ( Element firstAttr , XSAttributeGroupDecl attrGrp , XSDocumentInfo schemaDoc , SchemaGrammar grammar , XSComplexTypeDecl enclosingCT ) { } void reportSchemaError ( String key , Object [ ] args , Element ele ) { } void checkNotationType ( String refName , XSTypeDefinition typeDecl , Element elem ) { } protected XSParticleDecl checkOccurrences ( XSParticleDecl particle , String particleName , Element parent , int allContextFlags , long defaultVals ) { int min = particle . fMinOccurs ; int max = particle . fMaxOccurs ; boolean defaultMin = ( defaultVals & ( 1 << ( XSAttributeChecker . ATTIDX_MINOCCURS ) ) ) != 0 ; boolean defaultMax = ( defaultVals & ( 1 << ( XSAttributeChecker . ATTIDX_MAXOCCURS ) ) ) != 0 ; boolean processingAllEl = ( allContextFlags & ( XSDAbstractTraverser . PROCESSING_ALL_EL ) ) != 0 ; boolean processingAllGP = ( allContextFlags & ( XSDAbstractTraverser . PROCESSING_ALL_GP ) ) != 0 ; boolean groupRefWithAll = ( allContextFlags & ( XSDAbstractTraverser . GROUP_REF_WITH_ALL ) ) != 0 ; boolean isGroupChild = ( allContextFlags & ( XSDAbstractTraverser . CHILD_OF_GROUP ) ) != 0 ; if ( isGroupChild ) { if ( ! defaultMin ) { Object [ ] args = new Object [ ] { particleName , "minOccurs" } ; reportSchemaError ( "s4s-att-not-allowed" , args , parent ) ; min = 1 ; } if ( ! defaultMax ) { Object [ ] args = new Object [ ] { particleName , "maxOccurs" } ; reportSchemaError ( "s4s-att-not-allowed" , args , parent ) ; max = 1 ; } } if ( ( min == 0 ) && ( max == 0 ) ) { particle . fType = XSParticleDecl . PARTICLE_EMPTY ; return null ; } if ( processingAllEl ) { if ( max != 1 ) { reportSchemaError ( "cos-all-limited.2" , new Object [ ] { new Integer ( max ) , ( ( org . apache . xerces . impl . xs . XSElementDecl ) ( particle . fValue ) ) . getName ( ) } , parent ) ; max = 1 ; if ( min > 1 ) min = 1 ; } } else if ( processingAllGP || groupRefWithAll ) { if ( max != 1 ) { reportSchemaError ( "cos-all-limited.1.2" , null , parent ) ; if ( min > 1 ) min = 1 ; max = 1 ; } } <START_BUG> particle . fMaxOccurs = min ; <END_BUG> particle . fMaxOccurs = max ; return particle ; } private static String processAttValue ( String original ) { } private static String escapeAttValue ( String original , int from ) { } }

Fix:
particle . fMinOccurs = min ;