From 8fde7229fea58370e291b8fefe2e06800d27379c Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Thu, 24 Sep 2015 11:50:59 -0500 Subject: [PATCH] HHH-10119 - EhCacheRegionFactory cannot find configurationResourceName set in .cfg.xml (cherry picked from commit 0c628fa9aaac089209c0972841a7277b9b99ebbe) --- .../java/org/hibernate/boot/cfgxml/spi/LoadedConfig.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/boot/cfgxml/spi/LoadedConfig.java b/hibernate-core/src/main/java/org/hibernate/boot/cfgxml/spi/LoadedConfig.java index 828d4d799f..f2e4f2f696 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/cfgxml/spi/LoadedConfig.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/cfgxml/spi/LoadedConfig.java @@ -156,11 +156,12 @@ public class LoadedConfig { @SuppressWarnings("unchecked") private void addConfigurationValue(String propertyName, String value) { - if ( !propertyName.startsWith( "hibernate." ) ) { - propertyName = "hibernate." + propertyName; - } + value = trim( value ); + configurationValues.put( propertyName, value ); - configurationValues.put( propertyName, trim( value ) ); + if ( !propertyName.startsWith( "hibernate." ) ) { + configurationValues.put( "hibernate." + propertyName, value ); + } } private void addMappingReference(MappingReference mappingReference) {