lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rjer...@apache.org
Subject svn commit: r1626920 - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/core/ lucene/core/src/java/org/apache/lucene/index/
Date Tue, 23 Sep 2014 00:27:48 GMT
Author: rjernst
Date: Tue Sep 23 00:27:48 2014
New Revision: 1626920

URL: http://svn.apache.org/r1626920
Log:
LUCENE-5972: IndexFormatTooOldException and IndexFormatTooNewException now extend from IOException
(merged 1626914)

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/index/CorruptIndexException.java
    lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/IndexFormatTooNewException.java
    lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/IndexFormatTooOldException.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=1626920&r1=1626919&r2=1626920&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/lucene/CHANGES.txt Tue Sep 23 00:27:48 2014
@@ -108,6 +108,10 @@ API Changes
 * LUCENE-5965: CorruptIndexException requires a String or DataInput resource.
   (Robert Muir)
 
+* LUCENE-5972: IndexFormatTooOldException and IndexFormatTooNewException now
+               extend from IOException.
+  (Ryan Ernst, Robert Muir)
+
 Bug Fixes
 
 * LUCENE-5650: Enforce read-only access to any path outside the temporary

Modified: lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/CorruptIndexException.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/CorruptIndexException.java?rev=1626920&r1=1626919&r2=1626920&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/CorruptIndexException.java
(original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/CorruptIndexException.java
Tue Sep 23 00:27:48 2014
@@ -44,6 +44,6 @@ public class CorruptIndexException exten
   
   /** Create exception with message and root cause. */
   public CorruptIndexException(String message, String resourceDescription, Throwable cause)
{
-    super(message + " (resource=" + resourceDescription + ")", cause);
+    super(Objects.toString(message) + " (resource=" + resourceDescription + ")", cause);
   }
 }

Modified: lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/IndexFormatTooNewException.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/IndexFormatTooNewException.java?rev=1626920&r1=1626919&r2=1626920&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/IndexFormatTooNewException.java
(original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/IndexFormatTooNewException.java
Tue Sep 23 00:27:48 2014
@@ -17,13 +17,16 @@
 
 package org.apache.lucene.index;
 
+import java.io.IOException;
+import java.util.Objects;
+
 import org.apache.lucene.store.DataInput;
 
 /**
  * This exception is thrown when Lucene detects
  * an index that is newer than this Lucene version.
  */
-public class IndexFormatTooNewException extends CorruptIndexException {
+public class IndexFormatTooNewException extends IOException {
 
   /** Creates an {@code IndexFormatTooNewException}
    *
@@ -34,9 +37,8 @@ public class IndexFormatTooNewException 
    *
    * @lucene.internal */
   public IndexFormatTooNewException(String resourceDesc, int version, int minVersion, int
maxVersion) {
-    super("Format version is not supported: "
-      + version + " (needs to be between " + minVersion + " and " + maxVersion + ")", resourceDesc);
-    assert resourceDesc != null;
+    super("Format version is not supported (resource " + resourceDesc + "): "
+        + version + " (needs to be between " + minVersion + " and " + maxVersion + ")");
   }
 
   /** Creates an {@code IndexFormatTooNewException}
@@ -48,7 +50,8 @@ public class IndexFormatTooNewException 
    *
    * @lucene.internal */
   public IndexFormatTooNewException(DataInput in, int version, int minVersion, int maxVersion)
{
-    this(in.toString(), version, minVersion, maxVersion);
+    this(Objects.toString(in), version, minVersion, maxVersion);
   }
 
+
 }

Modified: lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/IndexFormatTooOldException.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/IndexFormatTooOldException.java?rev=1626920&r1=1626919&r2=1626920&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/IndexFormatTooOldException.java
(original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/index/IndexFormatTooOldException.java
Tue Sep 23 00:27:48 2014
@@ -17,13 +17,16 @@
 
 package org.apache.lucene.index;
 
+import java.io.IOException;
+import java.util.Objects;
+
 import org.apache.lucene.store.DataInput;
 
 /**
  * This exception is thrown when Lucene detects
  * an index that is too old for this Lucene version
  */
-public class IndexFormatTooOldException extends CorruptIndexException {
+public class IndexFormatTooOldException extends IOException {
 
   /** Creates an {@code IndexFormatTooOldException}.
    *
@@ -32,21 +35,20 @@ public class IndexFormatTooOldException 
    * 
    * @lucene.internal */
   public IndexFormatTooOldException(String resourceDesc, String version) {
-    super("Format version is not supported: " +
-        version + ". This version of Lucene only supports indexes created with release 4.0
and later.", resourceDesc);
-    assert resourceDesc != null;
+    super("Format version is not supported (resource " + resourceDesc + "): " +
+        version + ". This version of Lucene only supports indexes created with release 4.0
and later.");
   }
 
   /** Creates an {@code IndexFormatTooOldException}.
    *
    *  @param in the open file that's too old
    *  @param version the version of the file that was too old
-   * 
+   *
    * @lucene.internal */
   public IndexFormatTooOldException(DataInput in, String version) {
-    this(in.toString(), version);
+    this(Objects.toString(in), version);
   }
-  
+
   /** Creates an {@code IndexFormatTooOldException}.
    *
    *  @param resourceDesc describes the file that was too old
@@ -56,10 +58,9 @@ public class IndexFormatTooOldException 
    * 
    * @lucene.internal */
   public IndexFormatTooOldException(String resourceDesc, int version, int minVersion, int
maxVersion) {
-    super("Format version is not supported: " +
+    super("Format version is not supported (resource " + resourceDesc + "): " +
         version + " (needs to be between " + minVersion + " and " + maxVersion +
-    "). This version of Lucene only supports indexes created with release 4.0 and later.",
resourceDesc);
-    assert resourceDesc != null;
+        "). This version of Lucene only supports indexes created with release 4.0 and later.");
   }
 
   /** Creates an {@code IndexFormatTooOldException}.
@@ -71,6 +72,6 @@ public class IndexFormatTooOldException 
    *
    * @lucene.internal */
   public IndexFormatTooOldException(DataInput in, int version, int minVersion, int maxVersion)
{
-    this(in.toString(), version, minVersion, maxVersion);
+    this(Objects.toString(in), version, minVersion, maxVersion);
   }
 }



Mime
View raw message