You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2011/06/30 14:53:14 UTC

svn commit: r1141518 - in /lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example: multiCL/MultiCLIndexer.java simple/SimpleIndexer.java simple/SimpleUtils.java

Author: uschindler
Date: Thu Jun 30 12:53:13 2011
New Revision: 1141518

URL: http://svn.apache.org/viewvc?rev=1141518&view=rev
Log:
Facets: Remove stupid array->List method and use Array.asList in example

Modified:
    lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/multiCL/MultiCLIndexer.java
    lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleIndexer.java
    lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleUtils.java

Modified: lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/multiCL/MultiCLIndexer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/multiCL/MultiCLIndexer.java?rev=1141518&r1=1141517&r2=1141518&view=diff
==============================================================================
--- lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/multiCL/MultiCLIndexer.java (original)
+++ lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/multiCL/MultiCLIndexer.java Thu Jun 30 12:53:13 2011
@@ -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 document

Modified: lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleIndexer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleIndexer.java?rev=1141518&r1=1141517&r2=1141518&view=diff
==============================================================================
--- lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleIndexer.java (original)
+++ lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleIndexer.java Thu Jun 30 12:53:13 2011
@@ -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 called

Modified: lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleUtils.java?rev=1141518&r1=1141517&r2=1141518&view=diff
==============================================================================
--- lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleUtils.java (original)
+++ lucene/dev/trunk/modules/facet/src/examples/org/apache/lucene/facet/example/simple/SimpleUtils.java Thu Jun 30 12:53:13 2011
@@ -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;
-  }
-
 }