lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r544464 - /lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java
Date Tue, 05 Jun 2007 12:12:34 GMT
Author: mikemccand
Date: Tue Jun  5 05:12:33 2007
New Revision: 544464

URL: http://svn.apache.org/viewvc?view=rev&rev=544464
Log:
LUCENE-843: making a small backwards compatible API change to return the newly added FieldInfo
instance

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java?view=diff&rev=544464&r1=544463&r2=544464
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java Tue Jun  5 05:12:33
2007
@@ -174,12 +174,12 @@
    * @param omitNorms true if the norms for the indexed field should be omitted
    * @param storePayloads true if payloads should be stored for this field
    */
-  public void add(String name, boolean isIndexed, boolean storeTermVector,
-                  boolean storePositionWithTermVector, boolean storeOffsetWithTermVector,
-                  boolean omitNorms, boolean storePayloads) {
+  public FieldInfo add(String name, boolean isIndexed, boolean storeTermVector,
+                       boolean storePositionWithTermVector, boolean storeOffsetWithTermVector,
+                       boolean omitNorms, boolean storePayloads) {
     FieldInfo fi = fieldInfo(name);
     if (fi == null) {
-      addInternal(name, isIndexed, storeTermVector, storePositionWithTermVector, storeOffsetWithTermVector,
omitNorms, storePayloads);
+      return addInternal(name, isIndexed, storeTermVector, storePositionWithTermVector, storeOffsetWithTermVector,
omitNorms, storePayloads);
     } else {
       if (fi.isIndexed != isIndexed) {
         fi.isIndexed = true;                      // once indexed, always index
@@ -201,17 +201,18 @@
       }
 
     }
+    return fi;
   }
 
-
-  private void addInternal(String name, boolean isIndexed,
-                           boolean storeTermVector, boolean storePositionWithTermVector,

-                           boolean storeOffsetWithTermVector, boolean omitNorms, boolean
storePayloads) {
+  private FieldInfo addInternal(String name, boolean isIndexed,
+                                boolean storeTermVector, boolean storePositionWithTermVector,

+                                boolean storeOffsetWithTermVector, boolean omitNorms, boolean
storePayloads) {
     FieldInfo fi =
       new FieldInfo(name, isIndexed, byNumber.size(), storeTermVector, storePositionWithTermVector,
               storeOffsetWithTermVector, omitNorms, storePayloads);
     byNumber.add(fi);
     byName.put(name, fi);
+    return fi;
   }
 
   public int fieldNumber(String fieldName) {



Mime
View raw message