Index: oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/Aggregate.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/Aggregate.java (date 1435637519000) +++ oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/Aggregate.java (date 1435643892000) @@ -78,7 +78,7 @@ return includes; } - public void collectAggregates(NodeState root, ResultCollector collector) throws CommitFailedException { + public void collectAggregates(NodeState root, ResultCollector collector) { if (nodeTypeName.equals(ConfigUtil.getPrimaryTypeName(root))) { List matchers = createMatchers(); collectAggregates(root, matchers, collector); @@ -112,7 +112,7 @@ } private static void collectAggregates(NodeState nodeState, List matchers, - ResultCollector collector) throws CommitFailedException { + ResultCollector collector) { for (ChildNodeEntry cne : nodeState.getChildNodeEntries()) { List nextSet = newArrayListWithCapacity(matchers.size()); for (Matcher m : matchers) { @@ -190,13 +190,12 @@ } public void collectResults(T rootInclude, String rootIncludePath, - String nodePath, NodeState nodeState, ResultCollector results) - throws CommitFailedException { + String nodePath, NodeState nodeState, ResultCollector results) { collectResults(nodePath, nodeState, results); } public void collectResults(String nodePath, NodeState nodeState, - ResultCollector results) throws CommitFailedException { + ResultCollector results) { } @@ -240,7 +239,7 @@ @Override public void collectResults(NodeInclude rootInclude, String rootIncludePath, String nodePath, - NodeState nodeState, ResultCollector results) throws CommitFailedException { + NodeState nodeState, ResultCollector results) { //For supporting jcr:contains(jcr:content, 'foo') if (rootInclude.relativeNode){ results.onResult(new NodeIncludeResult(nodePath, rootIncludePath, nodeState)); @@ -309,8 +308,7 @@ } @Override - public void collectResults(String nodePath, NodeState nodeState, ResultCollector results) - throws CommitFailedException { + public void collectResults(String nodePath, NodeState nodeState, ResultCollector results) { if (pattern != null) { for (PropertyState ps : nodeState.getProperties()) { if (pattern.matcher(ps.getName()).matches()) { @@ -340,9 +338,9 @@ } public static interface ResultCollector { - void onResult(NodeIncludeResult result) throws CommitFailedException; + void onResult(NodeIncludeResult result); - void onResult(PropertyIncludeResult result) throws CommitFailedException; + void onResult(PropertyIncludeResult result); } public static class NodeIncludeResult { @@ -508,8 +506,7 @@ null, currentPath)); } - public void collectResults(ResultCollector results) - throws CommitFailedException { + public void collectResults(ResultCollector results) { checkArgument(status == Status.MATCH_FOUND); //If result being collected as part of reaggregation then take path Index: oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java (date 1435637519000) +++ oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java (date 1435643892000) @@ -297,13 +297,12 @@ throw new CommitFailedException("Lucene", 3, "Failed to index the node " + path, e); } catch (IllegalArgumentException ie) { - throw new CommitFailedException("Lucene", 3, - "Failed to index the node " + path, ie); + log.warn("Failed to index the node [{}]" + path, ie); } return false; } - private Document makeDocument(String path, NodeState state, boolean isUpdate) throws CommitFailedException { + private Document makeDocument(String path, NodeState state, boolean isUpdate) { if (!isIndexable()) { return null; } @@ -386,7 +385,7 @@ NodeState state, PropertyState property, String pname, - PropertyDefinition pd) throws CommitFailedException { + PropertyDefinition pd) { boolean includeTypeForFullText = indexingRule.includePropertyType(property.getType().tag()); if (Type.BINARY.tag() == property.getType().tag() && includeTypeForFullText) { @@ -433,7 +432,7 @@ return pname; } - private boolean addTypedFields(List fields, PropertyState property, String pname) throws CommitFailedException { + private boolean addTypedFields(List fields, PropertyState property, String pname) { int tag = property.getType().tag(); boolean fieldAdded = false; for (int i = 0; i < property.count(); i++) { @@ -460,7 +459,7 @@ private boolean addTypedOrderedFields(List fields, PropertyState property, String pname, - PropertyDefinition pd) throws CommitFailedException { + PropertyDefinition pd) { // Ignore and warn if property multi-valued as not supported if (property.getType().isArray()) { log.warn( @@ -648,11 +647,11 @@ } private boolean indexAggregates(final String path, final List fields, - final NodeState state) throws CommitFailedException { + final NodeState state) { final AtomicBoolean dirtyFlag = new AtomicBoolean(); indexingRule.getAggregate().collectAggregates(state, new Aggregate.ResultCollector() { @Override - public void onResult(Aggregate.NodeIncludeResult result) throws CommitFailedException { + public void onResult(Aggregate.NodeIncludeResult result) { boolean dirty = indexAggregatedNode(path, fields, result); if (dirty) { dirtyFlag.set(true); @@ -660,7 +659,7 @@ } @Override - public void onResult(Aggregate.PropertyIncludeResult result) throws CommitFailedException { + public void onResult(Aggregate.PropertyIncludeResult result) { boolean dirty = false; if (result.pd.ordered) { dirty |= addTypedOrderedFields(fields, result.propertyState, @@ -684,10 +683,8 @@ * @param fields indexed fields * @param result aggregate result * @return true if a field was created for passed node result - * @throws CommitFailedException */ - private boolean indexAggregatedNode(String path, List fields, Aggregate.NodeIncludeResult result) - throws CommitFailedException { + private boolean indexAggregatedNode(String path, List fields, Aggregate.NodeIncludeResult result) { //rule for node being aggregated might be null if such nodes //are not indexed on there own. In such cases we rely in current //rule for some checks Index: oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/AggregateTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/AggregateTest.java (date 1435637519000) +++ oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/AggregateTest.java (date 1435643892000) @@ -386,12 +386,12 @@ final ListMultimap nodeResults = ArrayListMultimap.create(); final Map propResults = newHashMap(); @Override - public void onResult(NodeIncludeResult result) throws CommitFailedException{ + public void onResult(NodeIncludeResult result) { nodeResults.put(result.nodePath, result); } @Override - public void onResult(PropertyIncludeResult result) throws CommitFailedException { + public void onResult(PropertyIncludeResult result) { propResults.put(result.propertyPath, result); }