Author: thomasm
Date: Tue May 28 08:03:38 2019
New Revision: 1860192

URL: http://svn.apache.org/viewvc?rev=1860192&view=rev
Log:
OAK-8261 Indexing lane failing but the index is not marked corrupt (formatting 
changes)

Modified:
    
jackrabbit/oak/trunk/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/BlobStoreBlob.java
    
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java

Modified: 
jackrabbit/oak/trunk/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/BlobStoreBlob.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/BlobStoreBlob.java?rev=1860192&r1=1860191&r2=1860192&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/BlobStoreBlob.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/BlobStoreBlob.java
 Tue May 28 08:03:38 2019
@@ -30,10 +30,10 @@ import org.jetbrains.annotations.Nullabl
  * A blob implementation.
  */
 public class BlobStoreBlob implements Blob {
-    
+
     private final BlobStore blobStore;
     private final String blobId;
-    
+
     public BlobStoreBlob(BlobStore blobStore, String blobId) {
         this.blobStore = blobStore;
         this.blobId = blobId;
@@ -46,7 +46,7 @@ public class BlobStoreBlob implements Bl
             return blobStore.getInputStream(blobId);
         } catch (IOException e) {
             throw new RuntimeException("Error occurred while obtaining " +
-                    "InputStream for blobId ["+ blobId +"]",e);
+                    "InputStream for blobId [" + blobId + "]", e);
         }
     }
 
@@ -59,7 +59,8 @@ public class BlobStoreBlob implements Bl
         }
     }
 
-    @Override @Nullable
+    @Override
+    @Nullable
     public String getReference() {
         return blobStore.getReference(blobId);
     }
@@ -83,7 +84,7 @@ public class BlobStoreBlob implements Bl
     public String toString() {
         return blobId;
     }
-    
+
     @Override
     public int hashCode() {
         return blobId.hashCode();
@@ -93,7 +94,7 @@ public class BlobStoreBlob implements Bl
     public boolean equals(Object other) {
         if (this == other) {
             return true;
-        } 
+        }
         if (other instanceof BlobStoreBlob) {
             BlobStoreBlob b = (BlobStoreBlob) other;
             // theoretically, the data could be the same  

Modified: 
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java?rev=1860192&r1=1860191&r2=1860192&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java
 Tue May 28 08:03:38 2019
@@ -57,13 +57,19 @@ public class LuceneIndexEditor implement
 
     private final LuceneIndexEditorContext context;
 
-    /** Name of this node, or {@code null} for the root node. */
+    /**
+     * Name of this node, or {@code null} for the root node.
+     */
     private final String name;
 
-    /** Parent editor or {@code null} if this is the root editor. */
+    /**
+     * Parent editor or {@code null} if this is the root editor.
+     */
     private final LuceneIndexEditor parent;
 
-    /** Path of this editor, built lazily in {@link #getPath()}. */
+    /**
+     * Path of this editor, built lazily in {@link #getPath()}.
+     */
     private String path;
 
     private boolean propertiesChanged = false;
@@ -96,7 +102,7 @@ public class LuceneIndexEditor implement
     private LuceneIndexEditor(LuceneIndexEditor parent, String name,
                               MatcherState matcherState,
                               PathFilter.Result pathFilterResult,
-            boolean isDeleted) {
+                              boolean isDeleted) {
         this.parent = parent;
         this.name = name;
         this.path = null;
@@ -116,7 +122,7 @@ public class LuceneIndexEditor implement
     @Override
     public void enter(NodeState before, NodeState after)
             throws CommitFailedException {
-        if (EmptyNodeState.MISSING_NODE == before && parent == null){
+        if (EmptyNodeState.MISSING_NODE == before && parent == null) {
             context.enableReindexMode();
         }
 
@@ -147,7 +153,7 @@ public class LuceneIndexEditor implement
             }
         }
 
-        for (Matcher m : matcherState.affectedMatchers){
+        for (Matcher m : matcherState.affectedMatchers) {
             m.markRootDirty();
         }
 
@@ -231,14 +237,14 @@ public class LuceneIndexEditor implement
                 this.context.indexUpdate();
             } catch (IOException e) {
                 CommitFailedException ce = new CommitFailedException("Lucene", 
5, "Failed to remove the index entries of"
-                                + " the removed subtree " + path + "for index 
" + context.getIndexingContext().getIndexPath(), e);
+                        + " the removed subtree " + path + "for index " + 
context.getIndexingContext().getIndexPath(), e);
                 context.getIndexingContext().indexUpdateFailed(ce);
                 throw ce;
             }
         }
 
         MatcherState ms = getMatcherState(name, before);
-        if (!ms.isEmpty()){
+        if (!ms.isEmpty()) {
             return new LuceneIndexEditor(this, name, ms, filterResult, true);
         }
         return null; // no need to recurse down the removed subtree
@@ -291,11 +297,11 @@ public class LuceneIndexEditor implement
         List<Matcher> inherited = Lists.newArrayList();
         for (Matcher m : Iterables.concat(matcherState.inherited, 
currentMatchers)) {
             Matcher result = m.match(name, after);
-            if (result.getStatus() == Matcher.Status.MATCH_FOUND){
+            if (result.getStatus() == Matcher.Status.MATCH_FOUND) {
                 matched.add(result);
             }
 
-            if (result.getStatus() != Matcher.Status.FAIL){
+            if (result.getStatus() != Matcher.Status.FAIL) {
                 inherited.addAll(result.nextSet());
             }
         }
@@ -330,13 +336,13 @@ public class LuceneIndexEditor implement
         final Set<Matcher> affectedMatchers;
 
         public MatcherState(List<Matcher> matched,
-                            List<Matcher> inherited){
+                            List<Matcher> inherited) {
             this.matched = matched;
             this.inherited = inherited;
 
             //Affected matches would only be used when there are
             //some matched matchers
-            if (matched.isEmpty()){
+            if (matched.isEmpty()) {
                 affectedMatchers = Collections.emptySet();
             } else {
                 affectedMatchers = Sets.newIdentityHashSet();
@@ -390,7 +396,7 @@ public class LuceneIndexEditor implement
         return context.getDefinition();
     }
 
-    private boolean isIndexable(){
+    private boolean isIndexable() {
         return indexingRule != null;
     }
 


Reply via email to