You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by al...@apache.org on 2015/08/05 11:46:51 UTC
svn commit: r1694159 -
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
Author: alexparvulescu
Date: Wed Aug 5 09:46:51 2015
New Revision: 1694159
URL: http://svn.apache.org/r1694159
Log:
OAK-3022 DocumentNodeStoreService fails to handle empty strings in the OSGi configuration
- patch provided by Francesco Mari
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java?rev=1694159&r1=1694158&r2=1694159&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java Wed Aug 5 09:46:51 2015
@@ -22,6 +22,7 @@ import static com.google.common.base.Pre
import static org.apache.jackrabbit.oak.commons.PropertiesUtil.toBoolean;
import static org.apache.jackrabbit.oak.commons.PropertiesUtil.toInteger;
import static org.apache.jackrabbit.oak.commons.PropertiesUtil.toLong;
+import static org.apache.jackrabbit.oak.osgi.OsgiUtil.lookupFrameworkThenConfiguration;
import static org.apache.jackrabbit.oak.plugins.document.DocumentMK.Builder.DEFAULT_CHILDREN_CACHE_PERCENTAGE;
import static org.apache.jackrabbit.oak.plugins.document.DocumentMK.Builder.DEFAULT_DIFF_CACHE_PERCENTAGE;
import static org.apache.jackrabbit.oak.plugins.document.DocumentMK.Builder.DEFAULT_DOC_CHILDREN_CACHE_PERCENTAGE;
@@ -641,14 +642,7 @@ public class DocumentNodeStoreService {
}
private Object prop(String propName, String fwkPropName) {
- //Prefer framework property first
- Object value = context.getBundleContext().getProperty(fwkPropName);
- if (value != null) {
- return value;
- }
-
- //Fallback to one from config
- return context.getProperties().get(propName);
+ return lookupFrameworkThenConfiguration(context, propName, fwkPropName);
}
private static String[] getMetadata(DocumentStore ds) {