Buggy code:
PersistenceUnitInfoImpl . put ( map , added , "ConnectionFactoryMode" , "managed" ) ; hasJta = true ; } ds = info . getNonJtaDataSource ( ) ; if ( ds != null ) { if ( ! hasJta ) PersistenceUnitInfoImpl . put ( map , added , "ConnectionFactory" , ds ) ; else PersistenceUnitInfoImpl . put ( map , added , "ConnectionFactory2" , ds ) ; } else if ( ( info instanceof PersistenceUnitInfoImpl ) && ( ( ( ( PersistenceUnitInfoImpl ) ( info ) ) . getNonJtaDataSourceName ( ) ) != null ) ) { String nonJtaName = ( ( PersistenceUnitInfoImpl ) ( info ) ) . getNonJtaDataSourceName ( ) ; if ( ! hasJta ) PersistenceUnitInfoImpl . put ( map , added , "ConnectionFactoryName" , nonJtaName ) ; else PersistenceUnitInfoImpl . put ( map , added , "ConnectionFactory2Name" , nonJtaName ) ; } if ( ( info . getClassLoader ( ) ) != null ) PersistenceUnitInfoImpl . put ( map , added , "ClassResolver" , new PersistenceUnitInfoImpl . ClassResolverImpl ( info . getClassLoader ( ) ) ) ; Properties props = info . getProperties ( ) ; if ( props != null ) { for ( String key : added ) { if ( Configurations . containsProperty ( key , props ) ) Configurations . removeProperty ( key , props ) ; } map . putAll ( props ) ; map . remove ( CLASS_TRANSFORMER_OPTIONS ) ; } if ( ! ( Configurations . containsProperty ( "Id" , map ) ) ) map . put ( "openjpa.Id" , info . getPersistenceUnitName ( ) ) ; Properties metaFactoryProps = new Properties ( ) ; if ( ( ( info . getManagedClassNames ( ) ) != null ) && ( ! ( info . getManagedClassNames ( ) . isEmpty ( ) ) ) ) { StringBuffer types = new StringBuffer ( ) ; for ( String type : info . getManagedClassNames ( ) ) { if ( ( types . length ( ) ) > 0 ) types . append ( ';' ) ; types . append ( type ) ; } metaFactoryProps . put ( "Types" , types . toString ( ) ) ; } if ( ( ( ( info . getJarFileUrls ( ) ) != null ) && ( ! ( info . getJarFileUrls ( ) . isEmpty ( ) ) ) ) || ( ( ! ( info . excludeUnlistedClasses ( ) ) ) && ( ( info . getPersistenceUnitRootUrl ( ) ) != null ) ) ) { StringBuffer jars = new StringBuffer ( ) ; String file = null ; if ( ( ! ( info . excludeUnlistedClasses ( ) ) ) && ( ( info . getPersistenceUnitRootUrl ( ) ) != null ) ) { URL url = info . getPersistenceUnitRootUrl ( ) ; if ( "file" . equals ( url . getProtocol ( ) ) ) file = URLDecoder . decode ( url . getPath ( ) ) ; else jars . append ( url ) ; } for ( URL jar : info . getJarFileUrls ( ) ) { if ( ( jars . length ( ) ) > 0 ) jars . append ( ';' ) ; jars . append ( jar ) ; } if ( file != null ) metaFactoryProps . put ( "Files" , file ) ; if ( ( jars . length ( ) ) != 0 ) metaFactoryProps . put ( "URLs" , jars . toString ( ) ) ; } if ( ( ( info . getMappingFileNames ( ) ) != null ) && ( ! ( info . getMappingFileNames ( ) . isEmpty ( ) ) ) ) { StringBuffer rsrcs = new StringBuffer ( ) ; for ( String rsrc : info . getMappingFileNames ( ) ) { if ( ( rsrcs . length ( ) ) > 0 ) rsrcs . append ( ';' ) ; rsrcs . append ( rsrc ) ; } metaFactoryProps . put ( "Resources" , rsrcs . toString ( ) ) ; } if ( ! ( metaFactoryProps . isEmpty ( ) ) ) { String key = ProductDerivations . getConfigurationKey ( "MetaDataFactory" , map ) ; map . put ( key , Configurations . combinePlugins ( ( ( String ) ( map . get ( key ) ) ) , Configurations . serializeProperties ( metaFactoryProps ) ) ) ; } if ( ( info . getPersistenceProviderClassName ( ) ) != null ) map . put ( PersistenceUnitInfoImpl . KEY_PROVIDER , info . getPersistenceProviderClassName ( ) ) ; if ( ( info . getValidationMode ( ) ) != null ) <START_BUG> map . put ( PersistenceUnitInfoImpl . VALIDATION_MODE , String . valueOf ( info . getValidationMode ( ) ) ) ; <END_BUG> if ( ( info . getPersistenceXMLSchemaVersion ( ) ) != null ) { map . put ( PersistenceUnitInfoImpl . PERSISTENCE_VERSION , info . getPersistenceXMLSchemaVersion ( ) ) ; } return map ; } 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 ) { } public void setValidationMode ( ValidationMode mode ) { } public SharedCacheMode getSharedCacheMode ( ) { } }

Fix:
map . put ( PersistenceUnitInfoImpl . VALIDATION_MODE , String . valueOf ( info . getValidationMode ( ) ) . toLowerCase ( ) ) ;