You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2010/10/01 23:55:09 UTC

svn commit: r1003663 - /lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/automaton/RegExp.java

Author: rmuir
Date: Fri Oct  1 21:55:09 2010
New Revision: 1003663

URL: http://svn.apache.org/viewvc?rev=1003663&view=rev
Log:
fix test failure in TestUTF32ToUTF8 (the random regex-generator generates invalid ranges)

Modified:
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/automaton/RegExp.java

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/automaton/RegExp.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/automaton/RegExp.java?rev=1003663&r1=1003662&r2=1003663&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/automaton/RegExp.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/automaton/RegExp.java Fri Oct  1 21:55:09 2010
@@ -785,6 +785,8 @@ public class RegExp {
   }
   
   static RegExp makeCharRange(int from, int to) {
+    if (from > to) 
+      throw new IllegalArgumentException("invalid range: from (" + from + ") cannot be > to (" + to + ")");
     RegExp r = new RegExp();
     r.kind = Kind.REGEXP_CHAR_RANGE;
     r.from = from;