incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject git commit: Fixing java compiling issue.
Date Tue, 13 Oct 2015 19:59:25 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/master 0e6aed41b -> fcc88b168


Fixing java compiling issue.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/fcc88b16
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/fcc88b16
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/fcc88b16

Branch: refs/heads/master
Commit: fcc88b1687e09a937b9ba6166c02db1c72f61a05
Parents: 0e6aed4
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Oct 13 15:59:17 2015 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Oct 13 15:59:17 2015 -0400

----------------------------------------------------------------------
 .../blur/lucene/security/index/AccessControlWriter.java | 10 +++++-----
 .../security/index/FilterAccessControlFactory.java      | 12 ++++++------
 .../apache/blur/lucene/security/IndexSearcherTest.java  |  5 +----
 .../security/index/SecureAtomicReaderTestBase.java      |  2 +-
 .../java/org/apache/blur/analysis/BaseFieldManager.java |  9 +++++----
 .../org/apache/blur/analysis/FieldTypeDefinition.java   |  3 ++-
 .../blur/analysis/type/ReadMaskFieldTypeDefinition.java |  5 ++---
 7 files changed, 22 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fcc88b16/blur-document-security/src/main/java/org/apache/blur/lucene/security/index/AccessControlWriter.java
----------------------------------------------------------------------
diff --git a/blur-document-security/src/main/java/org/apache/blur/lucene/security/index/AccessControlWriter.java
b/blur-document-security/src/main/java/org/apache/blur/lucene/security/index/AccessControlWriter.java
index e351745..31e9191 100644
--- a/blur-document-security/src/main/java/org/apache/blur/lucene/security/index/AccessControlWriter.java
+++ b/blur-document-security/src/main/java/org/apache/blur/lucene/security/index/AccessControlWriter.java
@@ -27,19 +27,19 @@ public abstract class AccessControlWriter {
   /**
    * Adds document read visibility rule to document.
    */
-  public abstract Iterable<IndexableField> addReadVisiblity(String read, Iterable<IndexableField>
fields);
+  public abstract Iterable<? extends IndexableField> addReadVisiblity(String read,
Iterable<? extends IndexableField> fields);
 
   /**
    * Adds document discover visibility rule to document.
    */
-  public abstract Iterable<IndexableField> addDiscoverVisiblity(String discover, Iterable<IndexableField>
fields);
+  public abstract Iterable<? extends IndexableField> addDiscoverVisiblity(String discover,
Iterable<? extends IndexableField> fields);
 
   /**
    * Adds a read mask to document. If a field has been masked the value can not
    * be viewed, but if a search utilizes the tokens from the field the document
    * can be found.
    */
-  public abstract Iterable<IndexableField> addReadMask(String fieldToMask, Iterable<IndexableField>
fields);
+  public abstract Iterable<? extends IndexableField> addReadMask(String fieldToMask,
Iterable<? extends IndexableField> fields);
 
   /**
    * This method should be called as the document is being added to the index
@@ -48,9 +48,9 @@ public abstract class AccessControlWriter {
    * @param fields
    * @return
    */
-  public abstract Iterable<IndexableField> lastStepBeforeIndexing(Iterable<IndexableField>
fields);
+  public abstract Iterable<? extends IndexableField> lastStepBeforeIndexing(Iterable<?
extends IndexableField> fields);
 
-  protected Iterable<IndexableField> addField(Iterable<IndexableField> fields,
IndexableField... fieldsToAdd) {
+  protected Iterable<? extends IndexableField> addField(Iterable<? extends IndexableField>
fields, IndexableField... fieldsToAdd) {
     if (fields instanceof Document) {
       Document document = (Document) fields;
       if (fieldsToAdd != null) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fcc88b16/blur-document-security/src/main/java/org/apache/blur/lucene/security/index/FilterAccessControlFactory.java
----------------------------------------------------------------------
diff --git a/blur-document-security/src/main/java/org/apache/blur/lucene/security/index/FilterAccessControlFactory.java
b/blur-document-security/src/main/java/org/apache/blur/lucene/security/index/FilterAccessControlFactory.java
index dcd3a1c..4db0ce2 100644
--- a/blur-document-security/src/main/java/org/apache/blur/lucene/security/index/FilterAccessControlFactory.java
+++ b/blur-document-security/src/main/java/org/apache/blur/lucene/security/index/FilterAccessControlFactory.java
@@ -306,26 +306,26 @@ public class FilterAccessControlFactory extends AccessControlFactory
{
   public static class FilterAccessControlWriter extends AccessControlWriter {
 
     @Override
-    public Iterable<IndexableField> addReadVisiblity(String read, Iterable<IndexableField>
fields) {
+    public Iterable<? extends IndexableField> addReadVisiblity(String read, Iterable<?
extends IndexableField> fields) {
       return addField(fields, new DocumentVisiblityField(READ_FIELD, read, Store.YES));
     }
 
     @Override
-    public Iterable<IndexableField> addDiscoverVisiblity(String discover, Iterable<IndexableField>
fields) {
+    public Iterable<? extends IndexableField> addDiscoverVisiblity(String discover,
Iterable<? extends IndexableField> fields) {
       return addField(fields, new DocumentVisiblityField(DISCOVER_FIELD, discover, Store.YES));
     }
 
     @Override
-    public Iterable<IndexableField> addReadMask(String fieldToMask, Iterable<IndexableField>
fields) {
+    public Iterable<? extends IndexableField> addReadMask(String fieldToMask, Iterable<?
extends IndexableField> fields) {
       return addField(fields, new StoredField(READ_MASK_FIELD, fieldToMask));
     }
 
     @Override
-    public Iterable<IndexableField> lastStepBeforeIndexing(Iterable<IndexableField>
fields) {
+    public Iterable<? extends IndexableField> lastStepBeforeIndexing(Iterable<?
extends IndexableField> fields) {
       return processFieldMasks(fields);
     }
 
-    public static Iterable<IndexableField> processFieldMasks(Iterable<IndexableField>
fields) {
+    public static Iterable<? extends IndexableField> processFieldMasks(Iterable<?
extends IndexableField> fields) {
       Set<String> fieldsToMask = getFieldsToMask(fields);
       if (fieldsToMask.isEmpty()) {
         return fields;
@@ -354,7 +354,7 @@ public class FilterAccessControlFactory extends AccessControlFactory {
       return result;
     }
 
-    private static Set<String> getFieldsToMask(Iterable<IndexableField> fields)
{
+    private static Set<String> getFieldsToMask(Iterable<? extends IndexableField>
fields) {
       Set<String> result = new HashSet<String>();
       for (IndexableField field : fields) {
         if (field.name().equals(READ_MASK_FIELD)) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fcc88b16/blur-document-security/src/test/java/org/apache/blur/lucene/security/IndexSearcherTest.java
----------------------------------------------------------------------
diff --git a/blur-document-security/src/test/java/org/apache/blur/lucene/security/IndexSearcherTest.java
b/blur-document-security/src/test/java/org/apache/blur/lucene/security/IndexSearcherTest.java
index 55ad9f5..601b8dd 100644
--- a/blur-document-security/src/test/java/org/apache/blur/lucene/security/IndexSearcherTest.java
+++ b/blur-document-security/src/test/java/org/apache/blur/lucene/security/IndexSearcherTest.java
@@ -27,9 +27,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.blur.lucene.security.DocumentAuthorizations;
-import org.apache.blur.lucene.security.DocumentVisibility;
-import org.apache.blur.lucene.security.DocumentVisibilityEvaluator;
 import org.apache.blur.lucene.security.index.AccessControlFactory;
 import org.apache.blur.lucene.security.index.AccessControlWriter;
 import org.apache.blur.lucene.security.index.FilterAccessControlFactory;
@@ -219,7 +216,7 @@ public class IndexSearcherTest {
     doc.add(new StringField("f1", field1, Store.YES));
     doc.add(new StringField("f2", field2, Store.YES));
     doc.add(new TextField("text", "constant text", Store.YES));
-    Iterable<IndexableField> fields = doc;
+    Iterable<? extends IndexableField> fields = doc;
     if (read != null) {
       fields = writer.addReadVisiblity(read, doc);
     }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fcc88b16/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/SecureAtomicReaderTestBase.java
----------------------------------------------------------------------
diff --git a/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/SecureAtomicReaderTestBase.java
b/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/SecureAtomicReaderTestBase.java
index fc40f42..68e72f8 100644
--- a/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/SecureAtomicReaderTestBase.java
+++ b/blur-document-security/src/test/java/org/apache/blur/lucene/security/index/SecureAtomicReaderTestBase.java
@@ -345,7 +345,7 @@ public abstract class SecureAtomicReaderTestBase {
 
   private void addDoc(IndexWriter writer, AccessControlWriter accessControlWriter, String
read, String discover,
       int doc, String... readMaskFields) throws IOException {
-    Iterable<IndexableField> fields = getDoc(doc);
+    Iterable<? extends IndexableField> fields = getDoc(doc);
     fields = accessControlWriter.addReadVisiblity(read, fields);
     fields = accessControlWriter.addDiscoverVisiblity(discover, fields);
     if (readMaskFields != null) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fcc88b16/blur-query/src/main/java/org/apache/blur/analysis/BaseFieldManager.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/analysis/BaseFieldManager.java b/blur-query/src/main/java/org/apache/blur/analysis/BaseFieldManager.java
index c4ed8c8..250f33d 100644
--- a/blur-query/src/main/java/org/apache/blur/analysis/BaseFieldManager.java
+++ b/blur-query/src/main/java/org/apache/blur/analysis/BaseFieldManager.java
@@ -60,6 +60,7 @@ import org.apache.lucene.document.Field.Store;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.StringField;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.SortField;
 
@@ -281,7 +282,7 @@ public abstract class BaseFieldManager extends FieldManager {
     }
     if (!postProcessingFieldTypes.isEmpty()) {
       Collections.sort(postProcessingFieldTypes, POST_PROCESSING_COMPARATOR);
-      Iterable<? extends Field> iterable = fields;
+      Iterable<? extends IndexableField> iterable = fields;
       for (FieldTypeDefinition fieldTypeDefinition : postProcessingFieldTypes) {
         iterable = fieldTypeDefinition.executePostProcessing(iterable);
       }
@@ -291,10 +292,10 @@ public abstract class BaseFieldManager extends FieldManager {
     }
   }
 
-  private List<Field> toList(Iterable<? extends Field> iterable) {
+  private List<Field> toList(Iterable<? extends IndexableField> iterable) {
     List<Field> fields = new ArrayList<Field>();
-    for (Field field : iterable) {
-      fields.add(field);
+    for (IndexableField field : iterable) {
+      fields.add((Field) field);
     }
     return fields;
   }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fcc88b16/blur-query/src/main/java/org/apache/blur/analysis/FieldTypeDefinition.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/analysis/FieldTypeDefinition.java b/blur-query/src/main/java/org/apache/blur/analysis/FieldTypeDefinition.java
index c000426..2fdb18e 100644
--- a/blur-query/src/main/java/org/apache/blur/analysis/FieldTypeDefinition.java
+++ b/blur-query/src/main/java/org/apache/blur/analysis/FieldTypeDefinition.java
@@ -26,6 +26,7 @@ import org.apache.blur.thrift.generated.Column;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IndexableField;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.SortField;
 import org.apache.lucene.util.BytesRef;
@@ -290,7 +291,7 @@ public abstract class FieldTypeDefinition {
     return 0;
   }
 
-  public Iterable<? extends Field> executePostProcessing(Iterable<? extends Field>
fields) {
+  public Iterable<? extends IndexableField> executePostProcessing(Iterable<? extends
IndexableField> fields) {
     throw new RuntimeException("Not Implemented.");
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/fcc88b16/blur-query/src/main/java/org/apache/blur/analysis/type/ReadMaskFieldTypeDefinition.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/analysis/type/ReadMaskFieldTypeDefinition.java
b/blur-query/src/main/java/org/apache/blur/analysis/type/ReadMaskFieldTypeDefinition.java
index cba8c57..2e48e43 100644
--- a/blur-query/src/main/java/org/apache/blur/analysis/type/ReadMaskFieldTypeDefinition.java
+++ b/blur-query/src/main/java/org/apache/blur/analysis/type/ReadMaskFieldTypeDefinition.java
@@ -94,9 +94,8 @@ public class ReadMaskFieldTypeDefinition extends FieldTypeDefinition {
 
   @SuppressWarnings("unchecked")
   @Override
-  public Iterable<? extends Field> executePostProcessing(Iterable<? extends Field>
fields) {
-    Iterable<IndexableField> doc = FilterAccessControlWriter.processFieldMasks((Iterable<IndexableField>)
fields);
-    return (Iterable<? extends Field>) doc;
+  public Iterable<? extends IndexableField> executePostProcessing(Iterable<? extends
IndexableField> fields) {
+    return FilterAccessControlWriter.processFieldMasks(fields);
   }
 
   @Override


Mime
View raw message