Buggy code:
public class FullDVFactory extends BaseDVFactory { static final String URI_SCHEMAFORSCHEMA = "http:////www.w3.org//2001//XMLSchema" ; static SymbolHash fFullTypes = new SymbolHash ( 89 ) ; public XSSimpleType getBuiltInType ( String name ) { } public SymbolHash getBuiltInTypes ( ) { } static void createBuiltInTypes ( SymbolHash types ) { BaseDVFactory . createBuiltInTypes ( types ) ; final String DOUBLE = "double" ; final String DURATION = "duration" ; final String ENTITY = "ENTITY" ; final String ENTITIES = "ENTITIES" ; final String FLOAT = "float" ; final String HEXBINARY = "hexBinary" ; final String ID = "ID" ; final String IDREF = "IDREF" ; final String IDREFS = "IDREFS" ; final String NAME = "Name" ; final String NCNAME = "NCName" ; final String NMTOKEN = "NMTOKEN" ; final String NMTOKENS = "NMTOKENS" ; final String LANGUAGE = "language" ; final String NORMALIZEDSTRING = "normalizedString" ; final String NOTATION = "NOTATION" ; final String QNAME = "QName" ; final String STRING = "string" ; final String TOKEN = "token" ; final XSFacets facets = new XSFacets ( ) ; XSSimpleTypeDecl anySimpleType = XSSimpleTypeDecl . fAnySimpleType ; XSSimpleTypeDecl stringDV = ( ( XSSimpleTypeDecl ) ( types . get ( STRING ) ) ) ; types . put ( FLOAT , new XSSimpleTypeDecl ( anySimpleType , FLOAT , XSSimpleTypeDecl . DV_FLOAT , XSSimpleType . ORDERED_TOTAL , true , true , true , true ) ) ; types . put ( DOUBLE , new XSSimpleTypeDecl ( anySimpleType , DOUBLE , XSSimpleTypeDecl . DV_DOUBLE , XSSimpleType . ORDERED_TOTAL , true , true , true , true ) ) ; types . put ( DURATION , new XSSimpleTypeDecl ( anySimpleType , DURATION , XSSimpleTypeDecl . DV_DURATION , XSSimpleType . ORDERED_PARTIAL , false , false , false , true ) ) ; types . put ( HEXBINARY , new XSSimpleTypeDecl ( anySimpleType , HEXBINARY , XSSimpleTypeDecl . DV_HEXBINARY , XSSimpleType . ORDERED_FALSE , false , false , false , true ) ) ; types . put ( QNAME , new XSSimpleTypeDecl ( anySimpleType , QNAME , XSSimpleTypeDecl . DV_QNAME , XSSimpleType . ORDERED_FALSE , false , false , false , true ) ) ; types . 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 , FullDVFactory . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; normalizedDV . applyFacets1 ( facets , FACET_WHITESPACE , ( ( short ) ( 0 ) ) ) ; types . put ( NORMALIZEDSTRING , normalizedDV ) ; facets . whiteSpace = XSSimpleType . WS_COLLAPSE ; XSSimpleTypeDecl tokenDV = new XSSimpleTypeDecl ( normalizedDV , TOKEN , FullDVFactory . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; tokenDV . applyFacets1 ( facets , FACET_WHITESPACE , ( ( short ) ( 0 ) ) ) ; types . 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 , FullDVFactory . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; languageDV . applyFacets1 ( facets , ( ( short ) ( ( XSSimpleType . FACET_WHITESPACE ) | ( XSSimpleType . FACET_PATTERN ) ) ) , ( ( short ) ( 0 ) ) ) ; types . put ( LANGUAGE , languageDV ) ; facets . whiteSpace = XSSimpleType . WS_COLLAPSE ; XSSimpleTypeDecl nameDV = new XSSimpleTypeDecl ( tokenDV , NAME , FullDVFactory . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; nameDV . applyFacets1 ( facets , FACET_WHITESPACE , ( ( short ) ( 0 ) ) , SPECIAL_PATTERN_NAME ) ; types . put ( NAME , nameDV ) ; facets . whiteSpace = XSSimpleType . WS_COLLAPSE ; XSSimpleTypeDecl ncnameDV = new XSSimpleTypeDecl ( nameDV , NCNAME , FullDVFactory . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; ncnameDV . applyFacets1 ( facets , FACET_WHITESPACE , ( ( short ) ( 0 ) ) , SPECIAL_PATTERN_NCNAME ) ; types . put ( NCNAME , ncnameDV ) ; types . 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 ) ; types . put ( IDREF , idrefDV ) ; facets . minLength = 1 ; XSSimpleTypeDecl tempDV = new XSSimpleTypeDecl ( null , FullDVFactory . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , idrefDV , true ) ; XSSimpleTypeDecl idrefsDV = new XSSimpleTypeDecl ( tempDV , IDREFS , FullDVFactory . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; idrefsDV . applyFacets1 ( facets , FACET_MINLENGTH , ( ( short ) ( 0 ) ) ) ; types . put ( IDREFS , idrefsDV ) ; XSSimpleTypeDecl entityDV = new XSSimpleTypeDecl ( ncnameDV , ENTITY , XSSimpleTypeDecl . DV_ENTITY , XSSimpleType . ORDERED_FALSE , false , false , false , true ) ; types . put ( ENTITY , entityDV ) ; facets . minLength = 1 ; tempDV = new XSSimpleTypeDecl ( null , FullDVFactory . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , entityDV , true ) ; XSSimpleTypeDecl entitiesDV = new XSSimpleTypeDecl ( tempDV , ENTITIES , FullDVFactory . URI_SCHEMAFORSCHEMA , ( ( short ) ( 0 ) ) , false ) ; entitiesDV . applyFacets1 ( facets , FACET_MINLENGTH , ( ( short ) ( 0 ) ) ) ; types . put ( ENTITIES , entitiesDV ) ;

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