Buggy code:
XSSimpleTypeDecl nonNegativeDV = new XSSimpleTypeDecl ( integerDV , NONNEGATIVEINTEGER , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; nonNegativeDV . applyFacets1 ( facets , FACET_MININCLUSIVE , ( ( short ) ( 0 ) ) ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( NONNEGATIVEINTEGER , nonNegativeDV ) ; facets . maxInclusive = "18446744073709551615" ; XSSimpleTypeDecl unsignedLongDV = new XSSimpleTypeDecl ( nonNegativeDV , UNSIGNEDLONG , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; unsignedLongDV . applyFacets1 ( facets , FACET_MAXINCLUSIVE , ( ( short ) ( 0 ) ) ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( UNSIGNEDLONG , unsignedLongDV ) ; facets . maxInclusive = "4294967295" ; XSSimpleTypeDecl unsignedIntDV = new XSSimpleTypeDecl ( unsignedLongDV , UNSIGNEDINT , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; unsignedIntDV . applyFacets1 ( facets , FACET_MAXINCLUSIVE , ( ( short ) ( 0 ) ) ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( UNSIGNEDINT , unsignedIntDV ) ; facets . maxInclusive = "65535" ; XSSimpleTypeDecl unsignedShortDV = new XSSimpleTypeDecl ( unsignedIntDV , UNSIGNEDSHORT , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; unsignedShortDV . applyFacets1 ( facets , FACET_MAXINCLUSIVE , ( ( short ) ( 0 ) ) ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( UNSIGNEDSHORT , unsignedShortDV ) ; facets . maxInclusive = "255" ; XSSimpleTypeDecl unsignedByteDV = new XSSimpleTypeDecl ( unsignedShortDV , UNSIGNEDBYTE , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; unsignedByteDV . applyFacets1 ( facets , FACET_MAXINCLUSIVE , ( ( short ) ( 0 ) ) ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( UNSIGNEDBYTE , unsignedByteDV ) ; facets . minInclusive = "1" ; XSSimpleTypeDecl positiveIntegerDV = new XSSimpleTypeDecl ( nonNegativeDV , POSITIVEINTEGER , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; positiveIntegerDV . applyFacets1 ( facets , FACET_MININCLUSIVE , ( ( short ) ( 0 ) ) ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( POSITIVEINTEGER , positiveIntegerDV ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( FLOAT , new XSSimpleTypeDecl ( anySimpleType , FLOAT , XSSimpleTypeDecl . DV_FLOAT , XSSimpleType . ORDERED_TOTAL , true , true , true , true ) ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( DOUBLE , new XSSimpleTypeDecl ( anySimpleType , DOUBLE , XSSimpleTypeDecl . DV_DOUBLE , XSSimpleType . ORDERED_TOTAL , true , true , true , true ) ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( HEXBINARY , new XSSimpleTypeDecl ( anySimpleType , HEXBINARY , XSSimpleTypeDecl . DV_HEXBINARY , XSSimpleType . ORDERED_FALSE , false , false , false , true ) ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( NOTATION , new XSSimpleTypeDecl ( anySimpleType , NOTATION , XSSimpleTypeDecl . DV_NOTATION , XSSimpleType . ORDERED_FALSE , false , false , false , true ) ) ; facets . whiteSpace = XSSimpleType . WS_REPLACE ; XSSimpleTypeDecl normalizedDV = new XSSimpleTypeDecl ( stringDV , NORMALIZEDSTRING , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; normalizedDV . applyFacets1 ( facets , FACET_WHITESPACE , ( ( short ) ( 0 ) ) ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( NORMALIZEDSTRING , normalizedDV ) ; facets . whiteSpace = XSSimpleType . WS_COLLAPSE ; XSSimpleTypeDecl tokenDV = new XSSimpleTypeDecl ( normalizedDV , TOKEN , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; tokenDV . applyFacets1 ( facets , FACET_WHITESPACE , ( ( short ) ( 0 ) ) ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( TOKEN , tokenDV ) ; facets . whiteSpace = XSSimpleType . WS_COLLAPSE ; <START_BUG> facets . pattern = "([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]+)(-[a-zA-Z]+)*" ; <END_BUG> XSSimpleTypeDecl languageDV = new XSSimpleTypeDecl ( tokenDV , LANGUAGE , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; languageDV . applyFacets1 ( facets , ( ( short ) ( ( XSSimpleType . FACET_WHITESPACE ) | ( XSSimpleType . FACET_PATTERN ) ) ) , ( ( short ) ( 0 ) ) ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( LANGUAGE , languageDV ) ; facets . whiteSpace = XSSimpleType . WS_COLLAPSE ; XSSimpleTypeDecl nameDV = new XSSimpleTypeDecl ( tokenDV , NAME , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; nameDV . applyFacets1 ( facets , FACET_WHITESPACE , ( ( short ) ( 0 ) ) , SPECIAL_PATTERN_NAME ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( NAME , nameDV ) ; facets . whiteSpace = XSSimpleType . WS_COLLAPSE ; XSSimpleTypeDecl ncnameDV = new XSSimpleTypeDecl ( nameDV , NCNAME , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; ncnameDV . applyFacets1 ( facets , FACET_WHITESPACE , ( ( short ) ( 0 ) ) , SPECIAL_PATTERN_NCNAME ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( NCNAME , ncnameDV ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( QNAME , new XSSimpleTypeDecl ( anySimpleType , QNAME , XSSimpleTypeDecl . DV_QNAME , XSSimpleType . ORDERED_FALSE , false , false , false , true ) ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( ID , new XSSimpleTypeDecl ( ncnameDV , ID , XSSimpleTypeDecl . DV_ID , XSSimpleType . ORDERED_FALSE , false , false , false , true ) ) ; XSSimpleTypeDecl idrefDV = new XSSimpleTypeDecl ( ncnameDV , IDREF , XSSimpleTypeDecl . DV_IDREF , XSSimpleType . ORDERED_FALSE , false , false , false , true ) ; SchemaDVFactoryImpl . fBuiltInTypes . put ( IDREF , idrefDV ) ; facets . minLength = 1 ; XSSimpleTypeDecl tempDV = new XSSimpleTypeDecl ( null , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , idrefDV , true ) ; XSSimpleTypeDecl idrefsDV = new XSSimpleTypeDecl ( tempDV , IDREFS , SchemaDVFactoryImpl . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ;

Fix:
facets . pattern = "([a-zA-Z]{1,8})(-[a-zA-Z0-9]{1,8})*" ;