Apache Solr open-source search software
Facets: Remove stupid array->List method and use Array.asList in example
Uwe Schindler988b53e499cf
diff --git a/modules/facet/src/examples/org/apache/lucene/facet/example/multiCL/MultiCLIndexer.java b/modules/facet/src/examples/org/apache/lucene/facet/example/multiCL/MultiCLIndexer.javaindex 5291fe16dc3..d9972221c1b 100644--- a/modules/facet/src/examples/org/apache/lucene/facet/example/multiCL/MultiCLIndexer.java+++ b/modules/facet/src/examples/org/apache/lucene/facet/example/multiCL/MultiCLIndexer.java@@ -1,5 +1,6 @@package org.apache.lucene.facet.example.multiCL;+import java.util.Arrays;import java.util.List;import java.util.Random;@@ -162,7 +163,7 @@ public class MultiCLIndexer {int nDocsAdded = 0;int nFacetsAdded = 0;for (int docNum = 0; docNum < SimpleUtils.docTexts.length; docNum++) {- List<CategoryPath> facetList = SimpleUtils.categoryPathArrayToList(cPaths[docNum]);+ List<CategoryPath> facetList = Arrays.asList(cPaths[docNum]);// we do not alter indexing parameters!// a category document builder will add the categories to a documentdiff --git a/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleIndexer.java b/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleIndexer.javaindex de6937667d8..cc5b803b260 100644--- a/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleIndexer.java+++ b/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleIndexer.java@@ -1,5 +1,6 @@package org.apache.lucene.facet.example.simple;+import java.util.Arrays;import java.util.List;import org.apache.lucene.document.Document;@@ -62,7 +63,7 @@ public class SimpleIndexer {for (int docNum=0; docNum<SimpleUtils.docTexts.length; docNum++) {// obtain the sample facets for current document- List<CategoryPath> facetList = SimpleUtils.categoryPathArrayToList(SimpleUtils.categories[docNum]);+ List<CategoryPath> facetList = Arrays.asList(SimpleUtils.categories[docNum]);// we do not alter indexing parameters!// a category document builder will add the categories to a document once build() is calleddiff --git a/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleUtils.java b/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleUtils.javaindex 7765c855489..fda6ab0e628 100644--- a/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleUtils.java+++ b/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleUtils.java@@ -72,16 +72,4 @@ public class SimpleUtils {*/public static final Analyzer analyzer = new WhitespaceAnalyzer(ExampleUtils.EXAMPLE_VER);- /**- * Utility method: List of category paths out of an array of them...- * @param categoryPaths input array of category paths.- */- public static List<CategoryPath> categoryPathArrayToList (CategoryPath...categoryPaths) {- ArrayList<CategoryPath> res = new ArrayList<CategoryPath>();- for (CategoryPath categoryPath : categoryPaths) {- res.add(categoryPath);- }- return res;- }-}