You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rj...@apache.org on 2015/05/22 21:28:58 UTC

svn commit: r1681211 - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/CHANGES.txt lucene/core/ lucene/core/src/java/org/apache/lucene/document/FieldType.java

Author: rjernst
Date: Fri May 22 19:28:58 2015
New Revision: 1681211

URL: http://svn.apache.org/r1681211
Log:
LUCENE-6497: Allow subclasses of FieldType to check frozen state (merged r1681207)

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/lucene/   (props changed)
    lucene/dev/branches/branch_5x/lucene/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/lucene/core/   (props changed)
    lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/document/FieldType.java

Modified: lucene/dev/branches/branch_5x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/CHANGES.txt?rev=1681211&r1=1681210&r2=1681211&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/lucene/CHANGES.txt Fri May 22 19:28:58 2015
@@ -179,6 +179,9 @@ API Changes
 * LUCENE-6484: Removed EliasFanoDocIdSet, which was unused.
   (Paul Elschot via Adrien Grand)
 
+* LUCENE-6497: Allow subclasses of FieldType to check frozen state
+  (Ryan Ernst)
+
 Other
 
 * LUCENE-6413: Test runner should report the number of suites completed/ 

Modified: lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/document/FieldType.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/document/FieldType.java?rev=1681211&r1=1681210&r2=1681211&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/document/FieldType.java (original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/document/FieldType.java Fri May 22 19:28:58 2015
@@ -32,7 +32,7 @@ public class FieldType implements Indexa
   /** Data type of the numeric value
    * @since 3.2
    */
-  public static enum NumericType {
+  public enum NumericType {
     /** 32-bit integer numeric type */
     INT, 
     /** 64-bit long numeric type */
@@ -80,7 +80,11 @@ public class FieldType implements Indexa
   public FieldType() {
   }
 
-  private void checkIfFrozen() {
+  /**
+   * Throws an exception if this FieldType is frozen. Subclasses should
+   * call this within setters for additional state.
+   */
+  protected void checkIfFrozen() {
     if (frozen) {
       throw new IllegalStateException("this FieldType is already frozen and cannot be changed");
     }