Buggy code:
class XSDGroupTraverser extends XSDAbstractParticleTraverser { XSDGroupTraverser ( XSDHandler handler , XSAttributeChecker gAttrCheck ) { } XSParticleDecl traverseLocal ( Element elmNode , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) { } XSGroupDecl traverseGlobal ( Element elmNode , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) { Object [ ] attrValues = fAttrChecker . checkAttributes ( elmNode , true , schemaDoc ) ; String strNameAttr = ( ( String ) ( attrValues [ XSAttributeChecker . ATTIDX_NAME ] ) ) ; if ( strNameAttr == null ) { reportSchemaError ( "s4s-att-must-appear" , new Object [ ] { "group<seq2seq4repair_space>(global)" , "name" } , elmNode ) ; } XSGroupDecl group = null ; XSParticleDecl particle = null ; Element l_elmChild = DOMUtil . getFirstChildElement ( elmNode ) ; if ( l_elmChild == null ) { reportSchemaError ( "s4s-elt-must-match" , new Object [ ] { "group<seq2seq4repair_space>(global)" , "(annotation?,<seq2seq4repair_space>(all<seq2seq4repair_space>|<seq2seq4repair_space>choice<seq2seq4repair_space>|<seq2seq4repair_space>sequence))" } , elmNode ) ; } else { String childName = l_elmChild . getLocalName ( ) ; if ( childName . equals ( ELT_ANNOTATION ) ) { traverseAnnotationDecl ( l_elmChild , attrValues , true , schemaDoc ) ; l_elmChild = DOMUtil . getNextSiblingElement ( l_elmChild ) ; if ( l_elmChild != null ) childName = l_elmChild . getLocalName ( ) ; } if ( l_elmChild == null ) { reportSchemaError ( "s4s-elt-must-match" , new Object [ ] { "group<seq2seq4repair_space>(global)" , "(annotation?,<seq2seq4repair_space>(all<seq2seq4repair_space>|<seq2seq4repair_space>choice<seq2seq4repair_space>|<seq2seq4repair_space>sequence))" } , elmNode ) ; } else if ( childName . equals ( ELT_ALL ) ) { particle = traverseAll ( l_elmChild , schemaDoc , grammar , CHILD_OF_GROUP ) ; } else if ( childName . equals ( ELT_CHOICE ) ) { particle = traverseChoice ( l_elmChild , schemaDoc , grammar , CHILD_OF_GROUP ) ; } else if ( childName . equals ( ELT_SEQUENCE ) ) { particle = traverseSequence ( l_elmChild , schemaDoc , grammar , CHILD_OF_GROUP ) ; } else { Object [ ] args = new Object [ ] { "group" , childName } ; reportSchemaError ( "GroupContentRestricted" , args , l_elmChild ) ; } if ( ( l_elmChild != null ) && ( ( DOMUtil . getNextSiblingElement ( l_elmChild ) ) != null ) ) { Object [ ] args = new Object [ ] { "group" , childName } ; reportSchemaError ( "GroupContentRestricted" , args , l_elmChild ) ; } <START_BUG> if ( ( particle != null ) && ( strNameAttr != null ) ) { <END_BUG> group = new XSGroupDecl ( ) ; group . fName = strNameAttr ; group . fTargetNamespace = schemaDoc . fTargetNamespace ; group . fParticle = particle ; grammar . addGlobalGroupDecl ( group ) ; } } if ( group != null ) { Object redefinedGrp = fSchemaHandler . getGrpOrAttrGrpRedefinedByRestriction ( GROUP_TYPE , new org . apache . xerces . xni . QName ( fSchemaHandler . EMPTY_STRING , strNameAttr , strNameAttr , schemaDoc . fTargetNamespace ) , schemaDoc , elmNode ) ; if ( redefinedGrp != null ) { grammar . addRedefinedGroupDecl ( group , ( ( XSGroupDecl ) ( redefinedGrp ) ) ) ; } } fAttrChecker . returnAttrArray ( attrValues , schemaDoc ) ; return group ; } }

Fix:
if ( strNameAttr != null ) {