lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1410953 - in /lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index: BytesDVWriter.java NumberDVWriter.java SortedBytesDVWriter.java
Date Sun, 18 Nov 2012 18:39:29 GMT
Author: mikemccand
Date: Sun Nov 18 18:39:28 2012
New Revision: 1410953

URL: http://svn.apache.org/viewvc?rev=1410953&view=rev
Log:
detect illegal multi-valued DV field

Modified:
    lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/BytesDVWriter.java
    lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/NumberDVWriter.java
    lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/SortedBytesDVWriter.java

Modified: lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/BytesDVWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/BytesDVWriter.java?rev=1410953&r1=1410952&r2=1410953&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/BytesDVWriter.java
(original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/BytesDVWriter.java
Sun Nov 18 18:39:28 2012
@@ -49,6 +49,9 @@ class BytesDVWriter {
   }
 
   public void addValue(int docID, BytesRef value) {
+    if (docID < addedValues) {
+      throw new IllegalArgumentException("DocValuesField \"" + fieldInfo.name + "\" appears
more than once in this document (only one value is allowed per field)");
+    }
     if (value == null) {
       // nocommit improve message
       throw new IllegalArgumentException("null binaryValue not allowed (field=" + fieldInfo.name
+ ")");

Modified: lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/NumberDVWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/NumberDVWriter.java?rev=1410953&r1=1410952&r2=1410953&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/NumberDVWriter.java
(original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/NumberDVWriter.java
Sun Nov 18 18:39:28 2012
@@ -51,6 +51,9 @@ class NumberDVWriter {
   }
 
   public void addValue(int docID, long value) {
+    if (docID < pending.size()) {
+      throw new IllegalArgumentException("DocValuesField \"" + fieldInfo.name + "\" appears
more than once in this document (only one value is allowed per field)");
+    }
     mergeValue(value);
 
     // Fill in any holes:

Modified: lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/SortedBytesDVWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/SortedBytesDVWriter.java?rev=1410953&r1=1410952&r2=1410953&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/SortedBytesDVWriter.java
(original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/SortedBytesDVWriter.java
Sun Nov 18 18:39:28 2012
@@ -60,6 +60,9 @@ class SortedBytesDVWriter {
   }
 
   public void addValue(int docID, BytesRef value) {
+    if (docID < pendingIndex) {
+      throw new IllegalArgumentException("DocValuesField \"" + fieldInfo.name + "\" appears
more than once in this document (only one value is allowed per field)");
+    }
     if (value == null) {
       // nocommit improve message
       throw new IllegalArgumentException("null sortedValue not allowed (field=" + fieldInfo.name
+ ")");



Mime
View raw message