lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1231799 - in /lucene/dev/trunk/lucene/src: java/org/apache/lucene/codecs/lucene40/ java/org/apache/lucene/codecs/memory/ java/org/apache/lucene/codecs/pulsing/ java/org/apache/lucene/codecs/sep/ test-framework/java/org/apache/lucene/codecs...
Date Mon, 16 Jan 2012 00:00:50 GMT
Author: mikemccand
Date: Mon Jan 16 00:00:50 2012
New Revision: 1231799

URL: http://svn.apache.org/viewvc?rev=1231799&view=rev
Log:
LUCENE-3684: use UOE not IAE

Modified:
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsWriter.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.java
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/sep/SepPostingsWriter.java
    lucene/dev/trunk/lucene/src/test-framework/java/org/apache/lucene/codecs/preflexrw/PreFlexFieldsWriter.java
    lucene/dev/trunk/lucene/src/test-framework/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsWriter.java?rev=1231799&r1=1231798&r2=1231799&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsWriter.java
(original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsWriter.java
Mon Jan 16 00:00:50 2012
@@ -156,7 +156,7 @@ public final class Lucene40PostingsWrite
     this.fieldInfo = fieldInfo;
     indexOptions = fieldInfo.indexOptions;
     if (indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >=
0) {
-      throw new IllegalArgumentException("this codec cannot index offsets");
+      throw new UnsupportedOperationException("this codec cannot index offsets");
     }
         
     storePayloads = fieldInfo.storePayloads;

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.java?rev=1231799&r1=1231798&r2=1231799&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.java
(original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/memory/MemoryPostingsFormat.java
Mon Jan 16 00:00:50 2012
@@ -254,7 +254,7 @@ public class MemoryPostingsFormat extend
       @Override
       public TermsConsumer addField(FieldInfo field) {
         if (field.indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS)
>= 0) {
-          throw new IllegalArgumentException("this codec cannot index offsets");
+          throw new UnsupportedOperationException("this codec cannot index offsets");
         }
         if (VERBOSE) System.out.println("\naddField field=" + field.name);
         return new TermsWriter(out, field);

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.java?rev=1231799&r1=1231798&r2=1231799&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.java
(original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/pulsing/PulsingPostingsWriter.java
Mon Jan 16 00:00:50 2012
@@ -116,7 +116,7 @@ public final class PulsingPostingsWriter
   public void setField(FieldInfo fieldInfo) {
     this.indexOptions = fieldInfo.indexOptions;
     if (indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >=
0) {
-      throw new IllegalArgumentException("this codec cannot index offsets: " + indexOptions);
+      throw new UnsupportedOperationException("this codec cannot index offsets: " + indexOptions);
     }
     if (DEBUG) System.out.println("PW field=" + fieldInfo.name + " indexOptions=" + indexOptions);
     storePayloads = fieldInfo.storePayloads;

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/sep/SepPostingsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/sep/SepPostingsWriter.java?rev=1231799&r1=1231798&r2=1231799&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/sep/SepPostingsWriter.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/codecs/sep/SepPostingsWriter.java Mon
Jan 16 00:00:50 2012
@@ -189,7 +189,7 @@ public final class SepPostingsWriter ext
     this.fieldInfo = fieldInfo;
     this.indexOptions = fieldInfo.indexOptions;
     if (indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) >=
0) {
-      throw new IllegalArgumentException("this codec cannot index offsets");
+      throw new UnsupportedOperationException("this codec cannot index offsets");
     }
     skipListWriter.setIndexOptions(indexOptions);
     storePayloads = indexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS &&
fieldInfo.storePayloads;

Modified: lucene/dev/trunk/lucene/src/test-framework/java/org/apache/lucene/codecs/preflexrw/PreFlexFieldsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test-framework/java/org/apache/lucene/codecs/preflexrw/PreFlexFieldsWriter.java?rev=1231799&r1=1231798&r2=1231799&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test-framework/java/org/apache/lucene/codecs/preflexrw/PreFlexFieldsWriter.java
(original)
+++ lucene/dev/trunk/lucene/src/test-framework/java/org/apache/lucene/codecs/preflexrw/PreFlexFieldsWriter.java
Mon Jan 16 00:00:50 2012
@@ -89,7 +89,7 @@ class PreFlexFieldsWriter extends Fields
   public TermsConsumer addField(FieldInfo field) throws IOException {
     assert field.number != -1;
     if (field.indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS)
>= 0) {
-      throw new IllegalArgumentException("this codec cannot index offsets");
+      throw new UnsupportedOperationException("this codec cannot index offsets");
     }
     //System.out.println("w field=" + field.name + " storePayload=" + field.storePayloads
+ " number=" + field.number);
     return new PreFlexTermsWriter(field);

Modified: lucene/dev/trunk/lucene/src/test-framework/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test-framework/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java?rev=1231799&r1=1231798&r2=1231799&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test-framework/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java
(original)
+++ lucene/dev/trunk/lucene/src/test-framework/java/org/apache/lucene/codecs/ramonly/RAMOnlyPostingsFormat.java
Mon Jan 16 00:00:50 2012
@@ -199,7 +199,7 @@ public class RAMOnlyPostingsFormat exten
     @Override
     public TermsConsumer addField(FieldInfo field) {
       if (field.indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS)
>= 0) {
-        throw new IllegalArgumentException("this codec cannot index offsets");
+        throw new UnsupportedOperationException("this codec cannot index offsets");
       }
       RAMField ramField = new RAMField(field.name);
       postings.fieldToTerms.put(field.name, ramField);



Mime
View raw message