jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1461540 - in /jackrabbit/oak/trunk/oak-solr-core/src: main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/ test/java/org/apache/jackrabbit/oak/plugins/index/solr/server/
Date Wed, 27 Mar 2013 11:47:06 GMT
Author: tommaso
Date: Wed Mar 27 11:47:05 2013
New Revision: 1461540

URL: http://svn.apache.org/r1461540
Log:
OAK-720 - UpToDate NSC should return null NS if the corresponding path doesn't exist

Modified:
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/OakSolrNodeStateConfiguration.java
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/UpToDateNodeStateConfiguration.java
    jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultOakSolrProviderTest.java

Modified: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/OakSolrNodeStateConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/OakSolrNodeStateConfiguration.java?rev=1461540&r1=1461539&r2=1461540&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/OakSolrNodeStateConfiguration.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/OakSolrNodeStateConfiguration.java
Wed Mar 27 11:47:05 2013
@@ -106,9 +106,12 @@ public abstract class OakSolrNodeStateCo
 
     protected String getStringValueFor(String propertyName, String defaultValue) {
         String value = null;
-        PropertyState property = getConfigurationNodeState().getProperty(propertyName);
-        if (property != null) {
-            value = property.getValue(Type.STRING);
+        NodeState configurationNodeState = getConfigurationNodeState();
+        if (configurationNodeState != null) {
+            PropertyState property = configurationNodeState.getProperty(propertyName);
+            if (property != null) {
+                value = property.getValue(Type.STRING);
+            }
         }
         if (value == null || value.length() == 0) {
             value = defaultValue;

Modified: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/UpToDateNodeStateConfiguration.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/UpToDateNodeStateConfiguration.java?rev=1461540&r1=1461539&r2=1461540&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/UpToDateNodeStateConfiguration.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/UpToDateNodeStateConfiguration.java
Wed Mar 27 11:47:05 2013
@@ -37,9 +37,9 @@ public class UpToDateNodeStateConfigurat
     protected NodeState getConfigurationNodeState() {
         NodeState currentState = store.getRoot();
         for (String child : path.split("/")) {
-            NodeState childNode = currentState.getChildNode(child);
-            if (childNode != null) {
-                currentState = childNode;
+            currentState = currentState.getChildNode(child);
+            if (currentState == null) {
+                break;
             }
         }
         return currentState;

Modified: jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultOakSolrProviderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultOakSolrProviderTest.java?rev=1461540&r1=1461539&r2=1461540&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultOakSolrProviderTest.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultOakSolrProviderTest.java
Wed Mar 27 11:47:05 2013
@@ -36,7 +36,7 @@ public class DefaultOakSolrProviderTest 
         when(nodeState.getProperty(OakSolrNodeStateConfiguration.Properties.CORE_NAME)).
                 thenReturn(PropertyValues.create(PropertyValues.newString("oak")));
         when(nodeState.getProperty(OakSolrNodeStateConfiguration.Properties.SOLRHOME_PATH)).
-                thenReturn(PropertyValues.create(PropertyValues.newString("target/solr/")));
+                thenReturn(PropertyValues.create(PropertyValues.newString("target/solr")));
         when(nodeState.getProperty(OakSolrNodeStateConfiguration.Properties.SOLRCONFIG_PATH)).
                 thenReturn(PropertyValues.create(PropertyValues.newString("target/solr/solr.xml")));
         DefaultOakSolrProvider defaultOakSolrProvider = new DefaultOakSolrProvider(nodeState);



Mime
View raw message