lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsmi...@apache.org
Subject lucene-solr:master: SOLR-11314: FastCharStream: re-use the READ_PAST_EOF exception
Date Fri, 08 Sep 2017 01:12:51 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master ce2912472 -> 89feb1500


SOLR-11314: FastCharStream: re-use the READ_PAST_EOF exception


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/89feb150
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/89feb150
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/89feb150

Branch: refs/heads/master
Commit: 89feb1500848d8d566d63be21d351d27a1bdcf6f
Parents: ce29124
Author: David Smiley <dsmiley@apache.org>
Authored: Thu Sep 7 21:12:45 2017 -0400
Committer: David Smiley <dsmiley@apache.org>
Committed: Thu Sep 7 21:12:45 2017 -0400

----------------------------------------------------------------------
 solr/CHANGES.txt                                              | 2 ++
 solr/core/src/java/org/apache/solr/parser/FastCharStream.java | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/89feb150/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index be89fb1..f652fb2 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -139,6 +139,8 @@ Optimizations
 
 * SOLR-11242: QueryParser: re-use the LookaheadSuccess exception. (Michael Braun via David
Smiley)
 
+* SOLR-11314: FastCharStream: re-use the READ_PAST_EOF exception. (Michael Braun via David
Smiley)
+
 Other Changes
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/89feb150/solr/core/src/java/org/apache/solr/parser/FastCharStream.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/parser/FastCharStream.java b/solr/core/src/java/org/apache/solr/parser/FastCharStream.java
index 7039c0a..b9cb27a 100644
--- a/solr/core/src/java/org/apache/solr/parser/FastCharStream.java
+++ b/solr/core/src/java/org/apache/solr/parser/FastCharStream.java
@@ -69,7 +69,7 @@ public final class FastCharStream implements CharStream {
     int charsRead =          // fill space in buffer
       input.read(buffer, newPosition, buffer.length-newPosition);
     if (charsRead == -1)
-      throw new IOException("read past eof");
+      throw READ_PAST_EOF;
     else
       bufferLength += charsRead;
   }
@@ -80,6 +80,11 @@ public final class FastCharStream implements CharStream {
     return readChar();
   }
 
+  /**
+   * This Exception is used as a signal rather than an exceptional state.
+   */
+  private static final IOException READ_PAST_EOF = new IOException("read past eof");
+
   @Override
   public final void backup(int amount) {
     bufferPosition -= amount;


Mime
View raw message