Buggy code:
public class PersistenceUnitInfoImpl implements PersistenceUnitInfo , SourceTracker { public static final String KEY_PROVIDER = "javax.persistence.provider" ; public static final String VALIDATION_MODE = "javax.persistence.validation.mode" ; public static final String PERSISTENCE_VERSION = "PersistenceVersion" ; private static final Localizer s_loc = Localizer . forPackage ( PersistenceUnitInfoImpl . class ) ; private String _name ; private final Properties _props = new Properties ( ) ; private PersistenceUnitTransactionType _transType = PersistenceUnitTransactionType . RESOURCE_LOCAL ; private String _providerClassName ; private List < String > _mappingFileNames ; private List < String > _entityClassNames ; private List < URL > _jarFiles ; private String _jtaDataSourceName ; private DataSource _jtaDataSource ; private String _nonJtaDataSourceName ; private DataSource _nonJtaDataSource ; private boolean _excludeUnlisted ; private URL _persistenceXmlFile ; private String _schemaVersion = "1.0" ; private ValidationMode _validationMode ; private URL _root ; public ClassLoader getClassLoader ( ) { } public ClassLoader getNewTempClassLoader ( ) { } public String getPersistenceUnitName ( ) { } public void setPersistenceUnitName ( String emName ) { } public String getPersistenceProviderClassName ( ) { } public void setPersistenceProviderClassName ( String providerClassName ) { } public PersistenceUnitTransactionType getTransactionType ( ) { } public void setTransactionType ( PersistenceUnitTransactionType transType ) { } public String getJtaDataSourceName ( ) { } public void setJtaDataSourceName ( String jta ) { } public DataSource getJtaDataSource ( ) { } public void setJtaDataSource ( DataSource ds ) { } public String getNonJtaDataSourceName ( ) { } public void setNonJtaDataSourceName ( String nonJta ) { } public DataSource getNonJtaDataSource ( ) { } public void setNonJtaDataSource ( DataSource ds ) { } public URL getPersistenceUnitRootUrl ( ) { } public void setPersistenceUnitRootUrl ( URL root ) { } public boolean excludeUnlistedClasses ( ) { } public void setExcludeUnlistedClasses ( boolean excludeUnlisted ) { } public List < String > getMappingFileNames ( ) { } public void addMappingFileName ( String name ) { } public List < URL > getJarFileUrls ( ) { } public void addJarFile ( URL jar ) { } public void addJarFileName ( String name ) { } public List < String > getManagedClassNames ( ) { } public void addManagedClassName ( String name ) { } public Properties getProperties ( ) { } public void setProperty ( String key , String value ) { } public void addTransformer ( ClassTransformer transformer ) { } public URL getPersistenceXmlFileUrl ( ) { } public void setPersistenceXmlFileUrl ( URL url ) { } public void fromUserProperties ( Map map ) { } public Map toOpenJPAProperties ( ) { } public static Map toOpenJPAProperties ( PersistenceUnitInfo info ) { } private static void put ( Map map , Set added , String key , Object val ) { } public File getSourceFile ( ) { } public Object getSourceScope ( ) { } public int getSourceType ( ) { } public int getLineNumber ( ) { } public int getColNumber ( ) { } public String getResourceName ( ) { } public static class ClassResolverImpl implements ClassResolver { private final ClassLoader _loader ; public ClassResolverImpl ( ClassLoader loader ) { } public ClassLoader getClassLoader ( Class ctx , ClassLoader env ) { } } public String getPersistenceXMLSchemaVersion ( ) { } public void setPersistenceXMLSchemaVersion ( String version ) { } public SharedCacheMode getCaching ( ) { } public void setCaching ( SharedCacheMode cache ) { } public ValidationMode getValidationMode ( ) { } protected void setValidationMode ( String mode ) { <START_BUG> setValidationMode ( Enum . valueOf ( ValidationMode . class , mode ) ) ; <END_BUG> } public void setValidationMode ( ValidationMode mode ) { } public SharedCacheMode getSharedCacheMode ( ) { } }

Fix:
setValidationMode ( Enum . valueOf ( ValidationMode . class , mode . toUpperCase ( ) ) ) ;