Buggy code:
private Map < String , SequenceMetaData > _seqs = new HashMap < String , SequenceMetaData > ( ) ; private Map < String , List < Class < ? > > > _aliases = Collections . synchronizedMap ( new HashMap < String , List < Class < ? > > > ( ) ) ; private Map < Class < ? > , NonPersistentMetaData > _pawares = Collections . synchronizedMap ( new HashMap < Class < ? > , NonPersistentMetaData > ( ) ) ; private Map < Class < ? > , NonPersistentMetaData > _nonMapped = Collections . synchronizedMap ( new HashMap < Class < ? > , NonPersistentMetaData > ( ) ) ; private Map < Class < ? > , Class < ? > > _metamodel = Collections . synchronizedMap ( new HashMap < Class < ? > , Class < ? > > ( ) ) ; private Map < Class < ? > , List < Class < ? > > > _subs = Collections . synchronizedMap ( new HashMap < Class < ? > , List < Class < ? > > > ( ) ) ; protected final XMLMetaData [ ] EMPTY_XMLMETAS ; private final Map < Class < ? > , XMLMetaData > _xmlmetas = new HashMap < Class < ? > , XMLMetaData > ( ) ; private transient OpenJPAConfiguration _conf = null ; private transient Log _log = null ; private transient InterfaceImplGenerator _implGen = null ; private transient MetaDataFactory _factory = null ; private int _resMode = ( MODE_META ) | ( MODE_MAPPING ) ; private int _sourceMode = ( ( MODE_META ) | ( MODE_MAPPING ) ) | ( MODE_QUERY ) ; private int _validate = ( MetaDataRepository . VALIDATE_META ) | ( MetaDataRepository . VALIDATE_UNENHANCED ) ; private final Collection < Class < ? > > _registered = new HashSet < Class < ? > > ( ) ; private final InheritanceOrderedMetaDataList _resolving = new InheritanceOrderedMetaDataList ( ) ; private final InheritanceOrderedMetaDataList _mapping = new InheritanceOrderedMetaDataList ( ) ; private final List < RuntimeException > _errs = new LinkedList < RuntimeException > ( ) ; private ListenerList _listeners = new LifecycleEventManager . ListenerList ( 3 ) ; protected boolean _preload = false ; protected boolean _preloadComplete = false ; protected boolean _locking = true ; private static final String PRELOAD_STR = "Preload" ; private boolean _reorderMetaDataResolution = false ; public MetaDataRepository ( ) { } public OpenJPAConfiguration getConfiguration ( ) { } public Log getLog ( ) { } public MetaDataFactory getMetaDataFactory ( ) { } public void setMetaDataFactory ( MetaDataFactory factory ) { } public int getValidate ( ) { } public void setValidate ( int validate ) { } public void setValidate ( int validate , boolean on ) { } public int getResolve ( ) { } public void setResolve ( int mode ) { } public void setResolve ( int mode , boolean on ) { } public int getSourceMode ( ) { } public void setSourceMode ( int mode ) { } public void setSourceMode ( int mode , boolean on ) { } public boolean getPreload ( ) { } public void setPreload ( boolean l ) { } public synchronized void preload ( ) { } public ClassMetaData getMetaData ( Class < ? > cls , ClassLoader envLoader , boolean mustExist ) { } private ClassMetaData getMetaDataInternal ( Class < ? > cls , ClassLoader envLoader , boolean mustExist ) { } public ClassMetaData getMetaData ( String alias , ClassLoader envLoader , boolean mustExist ) { } private ClassMetaData throwNoRegisteredAlias ( String alias ) { } public String getClosestAliasName ( String alias ) { } public Collection < String > getAliasNames ( ) { } private final Collection < String > getAliasNamesInternal ( ) { } private ClassMetaData getMetaDataInternal ( Class < ? > cls , ClassLoader envLoader ) { } private static String toModeString ( int mode ) { <START_BUG> StringBuffer buf = new StringBuffer ( 31 ) ; <END_BUG> if ( ( mode & ( MODE_META ) ) != 0 ) buf . append ( "[META]" ) ; if ( ( mode & ( MODE_QUERY ) ) != 0 ) buf . append ( "[QUERY]" ) ; if ( ( mode & ( MODE_MAPPING ) ) != 0 ) buf . append ( "[MAPPING]" ) ; if ( ( mode & ( MODE_MAPPING_INIT ) ) != 0 ) buf . append ( "[MAPPING_INIT]" ) ; return buf . toString ( ) ; } protected void prepareMapping ( ClassMetaData meta ) { } private void resolve ( ClassMetaData meta ) { } private List < ClassMetaData > resolveMeta ( ClassMetaData meta ) { } private void loadMapping ( ClassMetaData meta ) { } private void preMapping ( ClassMetaData meta ) { } private boolean resolveMapping ( ClassMetaData meta ) { } private List < ClassMetaData > processBuffer ( ClassMetaData meta , InheritanceOrderedMetaDataList buffer , int mode ) { } public ClassMetaData [ ] getMetaDatas ( ) { } private ClassMetaData [ ] getMetaDatasInternal ( ) { } public ClassMetaData getCachedMetaData ( Class < ? > cls ) { } public ClassMetaData addMetaData ( Class < ? > cls ) { } public ClassMetaData addMetaData ( Class < ? > cls , int access ) { } public ClassMetaData addMetaData ( Class < ? > cls , int access , boolean ignoreTransient ) { } private ClassMetaData metasPutInternal ( Class < ? > cls , ClassMetaData meta ) { } protected ClassMetaData newClassMetaData ( Class < ? > type ) { } protected ClassMetaData [ ] newClassMetaDataArray ( int length ) { } protected FieldMetaData newFieldMetaData ( String name , Class < ? > type , ClassMetaData owner ) { } protected FieldMetaData [ ] newFieldMetaDataArray ( int length ) { } protected XMLMetaData [ ] newXMLClassMetaDataArray ( int length ) { }

Fix:
StringBuilder buf = new StringBuilder ( 31 ) ;