lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1442821 [2/2] - in /lucene/dev/branches/lucene4547: ./ dev-tools/ dev-tools/maven/lucene/highlighter/ lucene/ lucene/analysis/ lucene/analysis/uima/src/java/org/apache/lucene/analysis/uima/ lucene/analysis/uima/src/test-files/uima/ lucene/...
Date Wed, 06 Feb 2013 00:58:31 GMT
Modified: lucene/dev/branches/lucene4547/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java (original)
+++ lucene/dev/branches/lucene4547/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java Wed Feb  6 00:58:30 2013
@@ -1070,22 +1070,29 @@ public abstract class QueryParserBase im
     } else if (regexp) {
       q = getRegexpQuery(qfield, term.image.substring(1, term.image.length()-1));
     } else if (fuzzy) {
-      float fms = fuzzyMinSim;
-      try {
-        fms = Float.valueOf(fuzzySlop.image.substring(1)).floatValue();
-      } catch (Exception ignored) { }
-      if(fms < 0.0f){
-        throw new ParseException("Minimum similarity for a FuzzyQuery has to be between 0.0f and 1.0f !");
-      } else if (fms >= 1.0f && fms != (int) fms) {
-        throw new ParseException("Fractional edit distances are not allowed!");
-      }
-      q = getFuzzyQuery(qfield, termImage, fms);
+      q = handleBareFuzzy(qfield, fuzzySlop, termImage);
     } else {
       q = getFieldQuery(qfield, termImage, false);
     }
     return q;
   }
 
+  Query handleBareFuzzy(String qfield, Token fuzzySlop, String termImage)
+      throws ParseException {
+    Query q;
+    float fms = fuzzyMinSim;
+    try {
+      fms = Float.valueOf(fuzzySlop.image.substring(1)).floatValue();
+    } catch (Exception ignored) { }
+    if(fms < 0.0f){
+      throw new ParseException("Minimum similarity for a FuzzyQuery has to be between 0.0f and 1.0f !");
+    } else if (fms >= 1.0f && fms != (int) fms) {
+      throw new ParseException("Fractional edit distances are not allowed!");
+    }
+    q = getFuzzyQuery(qfield, termImage, fms);
+    return q;
+  }
+
   // extracted from the .jj grammar
   Query handleQuotedTerm(String qfield, Token term, Token fuzzySlop) throws ParseException {
     int s = phraseSlop;  // default

Modified: lucene/dev/branches/lucene4547/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserTokenManager.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserTokenManager.java?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserTokenManager.java (original)
+++ lucene/dev/branches/lucene4547/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserTokenManager.java Wed Feb  6 00:58:30 2013
@@ -47,7 +47,7 @@ private int jjMoveStringLiteralDfa0_2()
       case 41:
          return jjStopAtPos(0, 15);
       case 42:
-         return jjStartNfaWithStates_2(0, 17, 43);
+         return jjStartNfaWithStates_2(0, 17, 49);
       case 43:
          return jjStartNfaWithStates_2(0, 11, 15);
       case 45:
@@ -87,7 +87,7 @@ static final long[] jjbitVec4 = {
 private int jjMoveNfa_2(int startState, int curPos)
 {
    int startsAt = 0;
-   jjnewStateCnt = 43;
+   jjnewStateCnt = 49;
    int i = 1;
    jjstateSet[0] = startState;
    int kind = 0x7fffffff;
@@ -102,12 +102,20 @@ private int jjMoveNfa_2(int startState, 
          {
             switch(jjstateSet[--i])
             {
+               case 49:
+               case 33:
+                  if ((0xfbff7cf8ffffd9ffL & l) == 0L)
+                     break;
+                  if (kind > 23)
+                     kind = 23;
+                  jjCheckNAddTwoStates(33, 34);
+                  break;
                case 0:
                   if ((0xfbff54f8ffffd9ffL & l) != 0L)
                   {
                      if (kind > 23)
                         kind = 23;
-                     jjCheckNAddTwoStates(27, 28);
+                     jjCheckNAddTwoStates(33, 34);
                   }
                   else if ((0x100002600L & l) != 0L)
                   {
@@ -139,14 +147,6 @@ private int jjMoveNfa_2(int startState, 
                   if (curChar == 38)
                      jjstateSet[jjnewStateCnt++] = 4;
                   break;
-               case 43:
-               case 27:
-                  if ((0xfbff7cf8ffffd9ffL & l) == 0L)
-                     break;
-                  if (kind > 23)
-                     kind = 23;
-                  jjCheckNAddTwoStates(27, 28);
-                  break;
                case 4:
                   if (curChar == 38 && kind > 8)
                      kind = 8;
@@ -187,7 +187,7 @@ private int jjMoveNfa_2(int startState, 
                      break;
                   if (kind > 21)
                      kind = 21;
-                  jjAddStates(11, 12);
+                  jjCheckNAddStates(11, 14);
                   break;
                case 23:
                   if (curChar == 46)
@@ -198,62 +198,86 @@ private int jjMoveNfa_2(int startState, 
                      break;
                   if (kind > 21)
                      kind = 21;
-                  jjCheckNAdd(24);
+                  jjCheckNAddStates(15, 17);
                   break;
                case 25:
+                  if ((0x7bff78f8ffffd9ffL & l) == 0L)
+                     break;
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAddTwoStates(25, 26);
+                  break;
+               case 27:
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAddTwoStates(25, 26);
+                  break;
+               case 28:
+                  if ((0x7bff78f8ffffd9ffL & l) == 0L)
+                     break;
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAddTwoStates(28, 29);
+                  break;
+               case 30:
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAddTwoStates(28, 29);
+                  break;
+               case 31:
                   if (curChar == 42 && kind > 22)
                      kind = 22;
                   break;
-               case 26:
+               case 32:
                   if ((0xfbff54f8ffffd9ffL & l) == 0L)
                      break;
                   if (kind > 23)
                      kind = 23;
-                  jjCheckNAddTwoStates(27, 28);
+                  jjCheckNAddTwoStates(33, 34);
                   break;
-               case 29:
+               case 35:
                   if (kind > 23)
                      kind = 23;
-                  jjCheckNAddTwoStates(27, 28);
+                  jjCheckNAddTwoStates(33, 34);
                   break;
-               case 30:
-               case 32:
+               case 36:
+               case 38:
                   if (curChar == 47)
                      jjCheckNAddStates(0, 2);
                   break;
-               case 31:
+               case 37:
                   if ((0xffff7fffffffffffL & l) != 0L)
                      jjCheckNAddStates(0, 2);
                   break;
-               case 34:
+               case 40:
                   if (curChar == 47 && kind > 24)
                      kind = 24;
                   break;
-               case 35:
+               case 41:
                   if ((0x7bff50f8ffffd9ffL & l) == 0L)
                      break;
                   if (kind > 20)
                      kind = 20;
                   jjCheckNAddStates(6, 10);
                   break;
-               case 36:
+               case 42:
                   if ((0x7bff78f8ffffd9ffL & l) == 0L)
                      break;
                   if (kind > 20)
                      kind = 20;
-                  jjCheckNAddTwoStates(36, 37);
+                  jjCheckNAddTwoStates(42, 43);
                   break;
-               case 38:
+               case 44:
                   if (kind > 20)
                      kind = 20;
-                  jjCheckNAddTwoStates(36, 37);
+                  jjCheckNAddTwoStates(42, 43);
                   break;
-               case 39:
+               case 45:
                   if ((0x7bff78f8ffffd9ffL & l) != 0L)
-                     jjCheckNAddStates(13, 15);
+                     jjCheckNAddStates(18, 20);
                   break;
-               case 41:
-                  jjCheckNAddStates(13, 15);
+               case 47:
+                  jjCheckNAddStates(18, 20);
                   break;
                default : break;
             }
@@ -266,6 +290,16 @@ private int jjMoveNfa_2(int startState, 
          {
             switch(jjstateSet[--i])
             {
+               case 49:
+                  if ((0x97ffffff87ffffffL & l) != 0L)
+                  {
+                     if (kind > 23)
+                        kind = 23;
+                     jjCheckNAddTwoStates(33, 34);
+                  }
+                  else if (curChar == 92)
+                     jjCheckNAddTwoStates(35, 35);
+                  break;
                case 0:
                   if ((0x97ffffff87ffffffL & l) != 0L)
                   {
@@ -274,18 +308,18 @@ private int jjMoveNfa_2(int startState, 
                      jjCheckNAddStates(6, 10);
                   }
                   else if (curChar == 92)
-                     jjCheckNAddStates(16, 18);
+                     jjCheckNAddStates(21, 23);
                   else if (curChar == 126)
                   {
                      if (kind > 21)
                         kind = 21;
-                     jjstateSet[jjnewStateCnt++] = 22;
+                     jjCheckNAddStates(24, 26);
                   }
                   if ((0x97ffffff87ffffffL & l) != 0L)
                   {
                      if (kind > 23)
                         kind = 23;
-                     jjCheckNAddTwoStates(27, 28);
+                     jjCheckNAddTwoStates(33, 34);
                   }
                   if (curChar == 78)
                      jjstateSet[jjnewStateCnt++] = 11;
@@ -296,16 +330,6 @@ private int jjMoveNfa_2(int startState, 
                   else if (curChar == 65)
                      jjstateSet[jjnewStateCnt++] = 2;
                   break;
-               case 43:
-                  if ((0x97ffffff87ffffffL & l) != 0L)
-                  {
-                     if (kind > 23)
-                        kind = 23;
-                     jjCheckNAddTwoStates(27, 28);
-                  }
-                  else if (curChar == 92)
-                     jjCheckNAddTwoStates(29, 29);
-                  break;
                case 1:
                   if (curChar == 68 && kind > 8)
                      kind = 8;
@@ -362,75 +386,107 @@ private int jjMoveNfa_2(int startState, 
                      break;
                   if (kind > 21)
                      kind = 21;
-                  jjstateSet[jjnewStateCnt++] = 22;
+                  jjCheckNAddStates(24, 26);
+                  break;
+               case 25:
+                  if ((0x97ffffff87ffffffL & l) == 0L)
+                     break;
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAddTwoStates(25, 26);
                   break;
                case 26:
+                  if (curChar == 92)
+                     jjAddStates(27, 28);
+                  break;
+               case 27:
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAddTwoStates(25, 26);
+                  break;
+               case 28:
+                  if ((0x97ffffff87ffffffL & l) == 0L)
+                     break;
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAddTwoStates(28, 29);
+                  break;
+               case 29:
+                  if (curChar == 92)
+                     jjAddStates(29, 30);
+                  break;
+               case 30:
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAddTwoStates(28, 29);
+                  break;
+               case 32:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
                   if (kind > 23)
                      kind = 23;
-                  jjCheckNAddTwoStates(27, 28);
+                  jjCheckNAddTwoStates(33, 34);
                   break;
-               case 27:
+               case 33:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
                   if (kind > 23)
                      kind = 23;
-                  jjCheckNAddTwoStates(27, 28);
+                  jjCheckNAddTwoStates(33, 34);
                   break;
-               case 28:
+               case 34:
                   if (curChar == 92)
-                     jjCheckNAddTwoStates(29, 29);
+                     jjCheckNAddTwoStates(35, 35);
                   break;
-               case 29:
+               case 35:
                   if (kind > 23)
                      kind = 23;
-                  jjCheckNAddTwoStates(27, 28);
+                  jjCheckNAddTwoStates(33, 34);
                   break;
-               case 31:
+               case 37:
                   jjAddStates(0, 2);
                   break;
-               case 33:
+               case 39:
                   if (curChar == 92)
-                     jjstateSet[jjnewStateCnt++] = 32;
+                     jjstateSet[jjnewStateCnt++] = 38;
                   break;
-               case 35:
+               case 41:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
                   if (kind > 20)
                      kind = 20;
                   jjCheckNAddStates(6, 10);
                   break;
-               case 36:
+               case 42:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
                   if (kind > 20)
                      kind = 20;
-                  jjCheckNAddTwoStates(36, 37);
+                  jjCheckNAddTwoStates(42, 43);
                   break;
-               case 37:
+               case 43:
                   if (curChar == 92)
-                     jjCheckNAddTwoStates(38, 38);
+                     jjCheckNAddTwoStates(44, 44);
                   break;
-               case 38:
+               case 44:
                   if (kind > 20)
                      kind = 20;
-                  jjCheckNAddTwoStates(36, 37);
+                  jjCheckNAddTwoStates(42, 43);
                   break;
-               case 39:
+               case 45:
                   if ((0x97ffffff87ffffffL & l) != 0L)
-                     jjCheckNAddStates(13, 15);
+                     jjCheckNAddStates(18, 20);
                   break;
-               case 40:
+               case 46:
                   if (curChar == 92)
-                     jjCheckNAddTwoStates(41, 41);
+                     jjCheckNAddTwoStates(47, 47);
                   break;
-               case 41:
-                  jjCheckNAddStates(13, 15);
+               case 47:
+                  jjCheckNAddStates(18, 20);
                   break;
-               case 42:
+               case 48:
                   if (curChar == 92)
-                     jjCheckNAddStates(16, 18);
+                     jjCheckNAddStates(21, 23);
                   break;
                default : break;
             }
@@ -447,6 +503,14 @@ private int jjMoveNfa_2(int startState, 
          {
             switch(jjstateSet[--i])
             {
+               case 49:
+               case 33:
+                  if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 23)
+                     kind = 23;
+                  jjCheckNAddTwoStates(33, 34);
+                  break;
                case 0:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
                   {
@@ -457,7 +521,7 @@ private int jjMoveNfa_2(int startState, 
                   {
                      if (kind > 23)
                         kind = 23;
-                     jjCheckNAddTwoStates(27, 28);
+                     jjCheckNAddTwoStates(33, 34);
                   }
                   if (jjCanMove_2(hiByte, i1, i2, l1, l2))
                   {
@@ -466,14 +530,6 @@ private int jjMoveNfa_2(int startState, 
                      jjCheckNAddStates(6, 10);
                   }
                   break;
-               case 43:
-               case 27:
-                  if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
-                     break;
-                  if (kind > 23)
-                     kind = 23;
-                  jjCheckNAddTwoStates(27, 28);
-                  break;
                case 15:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 13)
                      kind = 13;
@@ -483,52 +539,80 @@ private int jjMoveNfa_2(int startState, 
                   if (jjCanMove_1(hiByte, i1, i2, l1, l2))
                      jjCheckNAddStates(3, 5);
                   break;
-               case 26:
+               case 25:
+                  if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAddTwoStates(25, 26);
+                  break;
+               case 27:
+                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAddTwoStates(25, 26);
+                  break;
+               case 28:
+                  if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAddTwoStates(28, 29);
+                  break;
+               case 30:
+                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+                     break;
+                  if (kind > 21)
+                     kind = 21;
+                  jjCheckNAddTwoStates(28, 29);
+                  break;
+               case 32:
                   if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
                      break;
                   if (kind > 23)
                      kind = 23;
-                  jjCheckNAddTwoStates(27, 28);
+                  jjCheckNAddTwoStates(33, 34);
                   break;
-               case 29:
+               case 35:
                   if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
                      break;
                   if (kind > 23)
                      kind = 23;
-                  jjCheckNAddTwoStates(27, 28);
+                  jjCheckNAddTwoStates(33, 34);
                   break;
-               case 31:
+               case 37:
                   if (jjCanMove_1(hiByte, i1, i2, l1, l2))
                      jjAddStates(0, 2);
                   break;
-               case 35:
+               case 41:
                   if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
                      break;
                   if (kind > 20)
                      kind = 20;
                   jjCheckNAddStates(6, 10);
                   break;
-               case 36:
+               case 42:
                   if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
                      break;
                   if (kind > 20)
                      kind = 20;
-                  jjCheckNAddTwoStates(36, 37);
+                  jjCheckNAddTwoStates(42, 43);
                   break;
-               case 38:
+               case 44:
                   if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
                      break;
                   if (kind > 20)
                      kind = 20;
-                  jjCheckNAddTwoStates(36, 37);
+                  jjCheckNAddTwoStates(42, 43);
                   break;
-               case 39:
+               case 45:
                   if (jjCanMove_2(hiByte, i1, i2, l1, l2))
-                     jjCheckNAddStates(13, 15);
+                     jjCheckNAddStates(18, 20);
                   break;
-               case 41:
+               case 47:
                   if (jjCanMove_1(hiByte, i1, i2, l1, l2))
-                     jjCheckNAddStates(13, 15);
+                     jjCheckNAddStates(18, 20);
                   break;
                default : break;
             }
@@ -541,7 +625,7 @@ private int jjMoveNfa_2(int startState, 
          kind = 0x7fffffff;
       }
       ++curPos;
-      if ((i = jjnewStateCnt) == (startsAt = 43 - (jjnewStateCnt = startsAt)))
+      if ((i = jjnewStateCnt) == (startsAt = 49 - (jjnewStateCnt = startsAt)))
          return curPos;
       try { curChar = input_stream.readChar(); }
       catch(java.io.IOException e) { return curPos; }
@@ -574,7 +658,7 @@ private int jjMoveNfa_0(int startState, 
                      break;
                   if (kind > 27)
                      kind = 27;
-                  jjAddStates(19, 20);
+                  jjAddStates(31, 32);
                   break;
                case 1:
                   if (curChar == 46)
@@ -728,11 +812,11 @@ private int jjMoveNfa_1(int startState, 
                   break;
                case 2:
                   if ((0xfffffffbffffffffL & l) != 0L)
-                     jjCheckNAddStates(21, 23);
+                     jjCheckNAddStates(33, 35);
                   break;
                case 3:
                   if (curChar == 34)
-                     jjCheckNAddStates(21, 23);
+                     jjCheckNAddStates(33, 35);
                   break;
                case 5:
                   if (curChar == 34 && kind > 31)
@@ -765,7 +849,7 @@ private int jjMoveNfa_1(int startState, 
                   jjCheckNAdd(6);
                   break;
                case 2:
-                  jjAddStates(21, 23);
+                  jjAddStates(33, 35);
                   break;
                case 4:
                   if (curChar == 92)
@@ -801,7 +885,7 @@ private int jjMoveNfa_1(int startState, 
                   break;
                case 2:
                   if (jjCanMove_1(hiByte, i1, i2, l1, l2))
-                     jjAddStates(21, 23);
+                     jjAddStates(33, 35);
                   break;
                case 6:
                   if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
@@ -828,8 +912,9 @@ private int jjMoveNfa_1(int startState, 
    }
 }
 static final int[] jjnextStates = {
-   31, 33, 34, 17, 18, 20, 36, 39, 25, 40, 37, 22, 23, 39, 25, 40, 
-   38, 41, 29, 0, 1, 2, 4, 5, 
+   37, 39, 40, 17, 18, 20, 42, 45, 31, 46, 43, 22, 23, 25, 26, 24, 
+   25, 26, 45, 31, 46, 44, 47, 35, 22, 28, 29, 27, 27, 30, 30, 0, 
+   1, 2, 4, 5, 
 };
 private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
 {
@@ -893,8 +978,8 @@ static final long[] jjtoSkip = {
    0x80L, 
 };
 protected CharStream input_stream;
-private final int[] jjrounds = new int[43];
-private final int[] jjstateSet = new int[86];
+private final int[] jjrounds = new int[49];
+private final int[] jjstateSet = new int[98];
 protected char curChar;
 /** Constructor. */
 public QueryParserTokenManager(CharStream stream){
@@ -919,7 +1004,7 @@ private void ReInitRounds()
 {
    int i;
    jjround = 0x80000001;
-   for (i = 43; i-- > 0;)
+   for (i = 49; i-- > 0;)
       jjrounds[i] = 0x80000000;
 }
 

Modified: lucene/dev/branches/lucene4547/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/package.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/package.html?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/package.html (original)
+++ lucene/dev/branches/lucene4547/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/package.html Wed Feb  6 00:58:30 2013
@@ -167,11 +167,11 @@ enabling substantial customization to ho
         If you want to find the document entitled "The Right Way" which contains the text "don't go this way", you can enter: </p>
 <pre class="code">title:"The Right Way" AND text:go</pre>
 <p>or</p>
-<pre class="code">title:"Do it right" AND right</pre>
+<pre class="code">title:"The Right Way" AND go</pre>
 <p>Since text is the default field, the field indicator is not required.</p>
 <p>Note: The field is only valid for the term that it directly precedes, so the query</p>
-<pre class="code">title:Do it right</pre>
-<p>Will only find "Do" in the title field. It will find "it" and "right" in the default field (in this case the text field). </p>
+<pre class="code">title:The Right Way</pre>
+<p>Will only find "The" in the title field. It will find "Right" and "Way" in the default field (in this case the text field). </p>
 </div>
 
         

Modified: lucene/dev/branches/lucene4547/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java (original)
+++ lucene/dev/branches/lucene4547/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java Wed Feb  6 00:58:30 2013
@@ -160,6 +160,28 @@ public class TestQueryParser extends Que
     }
   }
   
+  public void testFuzzySlopeExtendability() throws ParseException {
+    QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, "a",  new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false)) {
+
+      @Override
+      Query handleBareFuzzy(String qfield, Token fuzzySlop, String termImage)
+          throws ParseException {
+        
+        if(fuzzySlop.image.endsWith("€")) {
+          float fms = fuzzyMinSim;
+          try {
+            fms = Float.valueOf(fuzzySlop.image.substring(1, fuzzySlop.image.length()-1)).floatValue();
+          } catch (Exception ignored) { }
+          float value = Float.parseFloat(termImage);
+          return getRangeQuery(qfield, Float.toString(value-fms/2.f), Float.toString(value+fms/2.f), true, true);
+        }
+        return super.handleBareFuzzy(qfield, fuzzySlop, termImage);
+      }
+      
+    };
+    assertEquals(qp.parse("a:[11.95 TO 12.95]"), qp.parse("12.45~1€"));
+  }
+  
   @Override
   public void testStarParsing() throws Exception {
     final int[] type = new int[1];

Modified: lucene/dev/branches/lucene4547/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java (original)
+++ lucene/dev/branches/lucene4547/lucene/test-framework/src/java/org/apache/lucene/index/BaseTermVectorsFormatTestCase.java Wed Feb  6 00:58:30 2013
@@ -721,9 +721,7 @@ public abstract class BaseTermVectorsFor
       reader.close();
       writer.close();
       dir.close();
-      if (exception.get() != null) {
-        throw new RuntimeException("One thread threw an exception", exception.get());
-      }
+      assertNull("One thread threw an exception", exception.get());
     }
   }
 

Modified: lucene/dev/branches/lucene4547/lucene/tools/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/tools/build.xml?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/tools/build.xml (original)
+++ lucene/dev/branches/lucene4547/lucene/tools/build.xml Wed Feb  6 00:58:30 2013
@@ -25,7 +25,6 @@
   <import file="../common-build.xml"/>
 
   <path id="classpath">
-    <fileset dir="lib"/>
   </path>
 
   <!--  

Modified: lucene/dev/branches/lucene4547/lucene/tools/custom-tasks.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/tools/custom-tasks.xml?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/tools/custom-tasks.xml (original)
+++ lucene/dev/branches/lucene4547/lucene/tools/custom-tasks.xml Wed Feb  6 00:58:30 2013
@@ -10,7 +10,6 @@
     <taskdef resource="lucene-solr.antlib.xml">
       <classpath>
         <pathelement location="${custom-tasks.dir}/../build/tools/classes/java" />
-        <fileset dir="${custom-tasks.dir}/lib" includes="asm-debug-all-4.1.jar" />
       </classpath>
     </taskdef>
     <property name="custom-tasks.loaded" value="true"/>

Modified: lucene/dev/branches/lucene4547/lucene/tools/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/tools/ivy.xml?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/tools/ivy.xml (original)
+++ lucene/dev/branches/lucene4547/lucene/tools/ivy.xml Wed Feb  6 00:58:30 2013
@@ -18,12 +18,4 @@
 -->
 <ivy-module version="2.0">
     <info organisation="org.apache.lucene" module="core-tools"/>
-    <dependencies>
-      <!-- 
-       We use the asm-debug-all library, as the as-all has no generics.
-       It's not really debug, just not "stripped":
-      -->
-      <dependency org="org.ow2.asm" name="asm-debug-all" rev="4.1" transitive="false"/>
-      <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/> 
-    </dependencies>
 </ivy-module>

Modified: lucene/dev/branches/lucene4547/lucene/tools/src/java/lucene-solr.antlib.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/tools/src/java/lucene-solr.antlib.xml?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/tools/src/java/lucene-solr.antlib.xml (original)
+++ lucene/dev/branches/lucene4547/lucene/tools/src/java/lucene-solr.antlib.xml Wed Feb  6 00:58:30 2013
@@ -18,7 +18,4 @@
     <taskdef 
         name="licenses" 
         classname="org.apache.lucene.validation.LicenseCheckTask" />
-    <taskdef 
-        name="forbidden-apis" 
-        classname="org.apache.lucene.validation.ForbiddenApisCheckTask" />
 </antlib> 

Modified: lucene/dev/branches/lucene4547/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/build.xml?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/build.xml (original)
+++ lucene/dev/branches/lucene4547/solr/build.xml Wed Feb  6 00:58:30 2013
@@ -236,19 +236,29 @@
     </license-check-macro>
   </target>
   
-  <target name="check-forbidden-apis" depends="compile-tools,compile-test,load-custom-tasks,-check-forbidden-java-apis,-check-forbidden-test-apis" 
+  <target name="check-forbidden-apis" depends="compile-tools,compile-test,install-forbidden-apis,-forbidden-apis-classpath,-check-forbidden-java-apis,-check-forbidden-test-apis" 
           description="Check forbidden API calls in compiled class files."/>
 
+  <!-- TODO: Make the forbidden API checks per module! Also remove failOnMissingClasses="false" below!!! -->
+  <target name="-forbidden-apis-classpath">
+    <path id="forbidden-apis.classpath">
+      <fileset dir="${basedir}" includes="**/lib/*.jar"/>
+      <dirset dir="${basedir}/build" includes="**/classes/*"/>
+      <path refid="solr.lucene.libs"/>
+      <path refid="classpath"/>
+      <path refid="test.classpath"/>
+    </path>
+  </target>
+
   <target name="-check-forbidden-java-apis">
-    <forbidden-apis>
-      <classpath refid="additional.dependencies"/>
-      <apiFileSet dir="${custom-tasks.dir}/forbiddenApis">
-        <include name="jdk.txt" />
-        <include name="jdk-deprecated.txt" />
-        <include name="commons-io.txt" />
+    <forbidden-apis internalRuntimeForbidden="true" classpathref="forbidden-apis.classpath" failOnMissingClasses="false">
+      <bundledSignatures name="jdk-unsafe-${javac.target}"/>
+      <bundledSignatures name="jdk-deprecated-${javac.target}"/>
+      <bundledSignatures name="commons-io-unsafe-${commons-io.version}"/>
+      <signaturesFileSet dir="${common.dir}/tools/forbiddenApis">
         <include name="executors.txt" />
         <include name="servlet-api.txt" />
-      </apiFileSet>
+      </signaturesFileSet>
       <fileset dir="${basedir}/build">
         <include name="**/*.class" />        
         <!-- violates the servlet-api restrictions, but it is safe to do so in this test: -->
@@ -258,8 +268,7 @@
   </target>
 
   <target name="-check-forbidden-test-apis">
-    <forbidden-apis apiFile="${custom-tasks.dir}/forbiddenApis/tests.txt"> 
-      <classpath refid="junit-path"/>
+    <forbidden-apis signaturesFile="${common.dir}/tools/forbiddenApis/tests.txt" classpathref="forbidden-apis.classpath" failOnMissingClasses="false">
       <fileset dir="${basedir}/build">
         <include name="**/classes/test/**/*.class"/>
         <include name="solr-test-framework/**/*.class"/>

Modified: lucene/dev/branches/lucene4547/solr/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/common-build.xml?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/common-build.xml (original)
+++ lucene/dev/branches/lucene4547/solr/common-build.xml Wed Feb  6 00:58:30 2013
@@ -68,6 +68,10 @@
        where X.Y.M is the last version released (on this branch).
     -->
   <property name="solr.spec.version" value="5.0.0.${dateversion}" />
+  
+  <!-- defined here to be able to make the forbidden-api checker correctly
+   reference it. 'ivy.xml' is also referencing this property. -->
+  <property name="commons-io.version" value="2.1" />
 
   <path id="solr.lucene.libs">
     <!-- List of jars that will be used as the foundation for both

Modified: lucene/dev/branches/lucene4547/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml (original)
+++ lucene/dev/branches/lucene4547/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml Wed Feb  6 00:58:30 2013
@@ -300,7 +300,8 @@
     <fieldType name="uima_sentences" class="solr.TextField" positionIncrementGap="100">
       <analyzer>
         <tokenizer class="solr.UIMAAnnotationsTokenizerFactory"
-                   descriptorPath="/uima/AggregateSentenceAE.xml" tokenType="org.apache.uima.SentenceAnnotation"/>
+                   descriptorPath="/uima/AggregateSentenceAE.xml" tokenType="org.apache.uima.SentenceAnnotation"
+                   ngramsize="2"/>
       </analyzer>
     </fieldType>
 

Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/cloud/ZkController.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/cloud/ZkController.java?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/cloud/ZkController.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/cloud/ZkController.java Wed Feb  6 00:58:30 2013
@@ -1220,35 +1220,43 @@ public final class ZkController {
     if (!isLeader && !SKIP_AUTO_RECOVERY) {
       HttpSolrServer server = null;
       server = new HttpSolrServer(leaderBaseUrl);
-      server.setConnectionTimeout(45000);
-      server.setSoTimeout(120000);
-      WaitForState prepCmd = new WaitForState();
-      prepCmd.setCoreName(leaderCoreName);
-      prepCmd.setNodeName(getNodeName());
-      prepCmd.setCoreNodeName(coreZkNodeName);
-      prepCmd.setState(ZkStateReader.DOWN);
-      
-      // let's retry a couple times - perhaps the leader just went down,
-      // or perhaps he is just not quite ready for us yet
-      retries = 6;
-      for (int i = 0; i < retries; i++) {
-        try {
-          server.request(prepCmd);
-          break;
-        } catch (Exception e) {
-          SolrException.log(log, "There was a problem making a request to the leader", e);
-          try {
-            Thread.sleep(2000);
-          } catch (InterruptedException e1) {
-            Thread.currentThread().interrupt();
+      try {
+        server.setConnectionTimeout(15000);
+        server.setSoTimeout(120000);
+        WaitForState prepCmd = new WaitForState();
+        prepCmd.setCoreName(leaderCoreName);
+        prepCmd.setNodeName(getNodeName());
+        prepCmd.setCoreNodeName(coreZkNodeName);
+        prepCmd.setState(ZkStateReader.DOWN);
+        
+        // let's retry a couple times - perhaps the leader just went down,
+        // or perhaps he is just not quite ready for us yet
+        retries = 6;
+        for (int i = 0; i < retries; i++) {
+          if (isClosed) {
+            throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE,
+                "We have been closed");
           }
-          if (i == retries - 1) {
-            throw new SolrException(ErrorCode.SERVER_ERROR, "There was a problem making a request to the leader");
+          try {
+            server.request(prepCmd);
+            break;
+          } catch (Exception e) {
+            SolrException.log(log,
+                "There was a problem making a request to the leader", e);
+            try {
+              Thread.sleep(2000);
+            } catch (InterruptedException e1) {
+              Thread.currentThread().interrupt();
+            }
+            if (i == retries - 1) {
+              throw new SolrException(ErrorCode.SERVER_ERROR,
+                  "There was a problem making a request to the leader");
+            }
           }
         }
+      } finally {
+        server.shutdown();
       }
-      
-      server.shutdown();
     }
     return leaderProps;
   }

Modified: lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/handler/SnapPuller.java?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/handler/SnapPuller.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/java/org/apache/solr/handler/SnapPuller.java Wed Feb  6 00:58:30 2013
@@ -73,7 +73,6 @@ import org.apache.lucene.index.IndexWrit
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.store.IndexOutput;
-import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.HttpClientUtil;
 import org.apache.solr.client.solrj.impl.HttpSolrServer;
@@ -86,8 +85,8 @@ import org.apache.solr.common.util.Execu
 import org.apache.solr.common.util.FastInputStream;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.core.CachingDirectoryFactory.CloseListener;
-import org.apache.solr.core.DirectoryFactory.DirContext;
 import org.apache.solr.core.DirectoryFactory;
+import org.apache.solr.core.DirectoryFactory.DirContext;
 import org.apache.solr.core.IndexDeletionPolicyWrapper;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.handler.ReplicationHandler.FileInfo;
@@ -244,7 +243,9 @@ public class SnapPuller {
     params.set(CommonParams.WT, "javabin");
     params.set(CommonParams.QT, "/replication");
     QueryRequest req = new QueryRequest(params);
-    SolrServer server = new HttpSolrServer(masterUrl, myHttpClient); //XXX modify to use shardhandler
+    HttpSolrServer server = new HttpSolrServer(masterUrl, myHttpClient); //XXX modify to use shardhandler
+    server.setSoTimeout(60000);
+    server.setConnectionTimeout(15000);
     try {
       return server.request(req);
     } catch (SolrServerException e) {
@@ -262,7 +263,9 @@ public class SnapPuller {
     params.set(CommonParams.WT, "javabin");
     params.set(CommonParams.QT, "/replication");
     QueryRequest req = new QueryRequest(params);
-    SolrServer server = new HttpSolrServer(masterUrl, myHttpClient);  //XXX modify to use shardhandler
+    HttpSolrServer server = new HttpSolrServer(masterUrl, myHttpClient);  //XXX modify to use shardhandler
+    server.setSoTimeout(60000);
+    server.setConnectionTimeout(15000);
 
     try {
       NamedList response = server.request(req);
@@ -1237,7 +1240,9 @@ public class SnapPuller {
      * Open a new stream using HttpClient
      */
     FastInputStream getStream() throws IOException {
-      SolrServer s = new HttpSolrServer(masterUrl, myHttpClient, null);  //XXX use shardhandler
+      HttpSolrServer s = new HttpSolrServer(masterUrl, myHttpClient, null);  //XXX use shardhandler
+      s.setSoTimeout(60000);
+      s.setConnectionTimeout(15000);
       ModifiableSolrParams params = new ModifiableSolrParams();
 
 //    //the method is command=filecontent
@@ -1496,7 +1501,9 @@ public class SnapPuller {
      * Open a new stream using HttpClient
      */
     FastInputStream getStream() throws IOException {
-      SolrServer s = new HttpSolrServer(masterUrl, myHttpClient, null);  //XXX use shardhandler
+      HttpSolrServer s = new HttpSolrServer(masterUrl, myHttpClient, null);  //XXX use shardhandler
+      s.setSoTimeout(60000);
+      s.setConnectionTimeout(15000);
       ModifiableSolrParams params = new ModifiableSolrParams();
 
 //    //the method is command=filecontent
@@ -1549,7 +1556,9 @@ public class SnapPuller {
     params.set(COMMAND, CMD_DETAILS);
     params.set("slave", false);
     params.set(CommonParams.QT, "/replication");
-    SolrServer server = new HttpSolrServer(masterUrl, myHttpClient); //XXX use shardhandler
+    HttpSolrServer server = new HttpSolrServer(masterUrl, myHttpClient); //XXX use shardhandler
+    server.setSoTimeout(60000);
+    server.setConnectionTimeout(15000);
     QueryRequest request = new QueryRequest(params);
     return server.request(request);
   }

Modified: lucene/dev/branches/lucene4547/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java Wed Feb  6 00:58:30 2013
@@ -495,6 +495,8 @@ public class BasicDistributedZkTest exte
     DirectUpdateHandler2.commitOnClose = false;
     
     HttpSolrServer addClient = new HttpSolrServer(url3 + "/unloadcollection3");
+    addClient.setConnectionTimeout(15000);
+    addClient.setSoTimeout(30000);
     // add a few docs
     for (int x = 20; x < 100; x++) {
       SolrInputDocument doc1 = getDoc(id, x, i1, -600, tlong, 600, t1,
@@ -507,6 +509,8 @@ public class BasicDistributedZkTest exte
     
     // unload the leader
     collectionClient = new HttpSolrServer(leaderProps.getBaseUrl());
+    collectionClient.setConnectionTimeout(15000);
+    collectionClient.setSoTimeout(30000);
     
     Unload unloadCmd = new Unload(false);
     unloadCmd.setCoreName(leaderProps.getCoreName());
@@ -529,6 +533,9 @@ public class BasicDistributedZkTest exte
     zkStateReader.getLeaderRetry("unloadcollection", "shard1", 15000);
     
     addClient = new HttpSolrServer(url2 + "/unloadcollection2");
+    addClient.setConnectionTimeout(15000);
+    addClient.setSoTimeout(30000);
+    
     // add a few docs while the leader is down
     for (int x = 101; x < 200; x++) {
       SolrInputDocument doc1 = getDoc(id, x, i1, -600, tlong, 600, t1,
@@ -541,6 +548,8 @@ public class BasicDistributedZkTest exte
     client = clients.get(3);
     String url4 = getBaseUrl(client);
     server = new HttpSolrServer(url4);
+    server.setConnectionTimeout(15000);
+    server.setSoTimeout(30000);
     
     createCmd = new Create();
     createCmd.setCoreName("unloadcollection4");
@@ -554,6 +563,8 @@ public class BasicDistributedZkTest exte
     // unload the leader again
     leaderProps = getLeaderUrlFromZk("unloadcollection", "shard1");
     collectionClient = new HttpSolrServer(leaderProps.getBaseUrl());
+    collectionClient.setConnectionTimeout(15000);
+    collectionClient.setSoTimeout(30000);
     
     unloadCmd = new Unload(false);
     unloadCmd.setCoreName(leaderProps.getCoreName());
@@ -576,6 +587,8 @@ public class BasicDistributedZkTest exte
     
     // bring the downed leader back as replica
     server = new HttpSolrServer(leaderProps.getBaseUrl());
+    server.setConnectionTimeout(15000);
+    server.setSoTimeout(30000);
     
     createCmd = new Create();
     createCmd.setCoreName(leaderProps.getCoreName());
@@ -585,20 +598,23 @@ public class BasicDistributedZkTest exte
 
     waitForRecoveriesToFinish("unloadcollection", zkStateReader, false);
     
-    
-    server = new HttpSolrServer(url1 + "/unloadcollection");
-   // System.out.println(server.query(new SolrQuery("*:*")).getResults().getNumFound());
     server = new HttpSolrServer(url2 + "/unloadcollection");
+    server.setConnectionTimeout(15000);
+    server.setSoTimeout(30000);
     server.commit();
     SolrQuery q = new SolrQuery("*:*");
     q.set("distrib", false);
     long found1 = server.query(q).getResults().getNumFound();
     server = new HttpSolrServer(url3 + "/unloadcollection");
+    server.setConnectionTimeout(15000);
+    server.setSoTimeout(30000);
     server.commit();
     q = new SolrQuery("*:*");
     q.set("distrib", false);
     long found3 = server.query(q).getResults().getNumFound();
     server = new HttpSolrServer(url4 + "/unloadcollection");
+    server.setConnectionTimeout(15000);
+    server.setSoTimeout(30000);
     server.commit();
     q = new SolrQuery("*:*");
     q.set("distrib", false);
@@ -656,7 +672,7 @@ public class BasicDistributedZkTest exte
     String url3 = getBaseUrl(client);
     final HttpSolrServer server = new HttpSolrServer(url3);
     server.setConnectionTimeout(15000);
-    server.setSoTimeout(30000);
+    server.setSoTimeout(60000);
     ThreadPoolExecutor executor = new ThreadPoolExecutor(0, Integer.MAX_VALUE,
         5, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(),
         new DefaultSolrThreadFactory("testExecutor"));
@@ -1045,6 +1061,8 @@ public class BasicDistributedZkTest exte
     
     // now test that unloading a core gets us a new leader
     HttpSolrServer server = new HttpSolrServer(baseUrl);
+    server.setConnectionTimeout(15000);
+    server.setSoTimeout(30000);
     Unload unloadCmd = new Unload(true);
     unloadCmd.setCoreName(props.getCoreName());
     

Modified: lucene/dev/branches/lucene4547/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java Wed Feb  6 00:58:30 2013
@@ -24,16 +24,17 @@ import org.apache.lucene.util.LuceneTest
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.core.Diagnostics;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.servlet.SolrDispatchFilter;
 import org.apache.solr.update.DirectUpdateHandler2;
+import org.apache.solr.update.SolrCmdDistributor;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 
 @Slow
-@BadApple
 public class ChaosMonkeySafeLeaderTest extends AbstractFullDistribZkTestBase {
   
   private static final int BASE_RUN_LENGTH = 120000;
@@ -41,12 +42,21 @@ public class ChaosMonkeySafeLeaderTest e
 
   @BeforeClass
   public static void beforeSuperClass() {
-
+    SolrCmdDistributor.testing_errorHook = new Diagnostics.Callable() {
+      @Override
+      public void call(Object... data) {
+        SolrCmdDistributor.Request sreq = (SolrCmdDistributor.Request)data[1];
+        if (sreq.exception == null) return;
+        if (sreq.exception.getMessage().contains("Timeout")) {
+          Diagnostics.logThreadDumps("REQUESTING THREAD DUMP DUE TO TIMEOUT: " + sreq.exception.getMessage());
+        }
+      }
+    };
   }
   
   @AfterClass
   public static void afterSuperClass() {
-    
+    SolrCmdDistributor.testing_errorHook = null;
   }
   
   @Before

Modified: lucene/dev/branches/lucene4547/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java (original)
+++ lucene/dev/branches/lucene4547/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java Wed Feb  6 00:58:30 2013
@@ -90,7 +90,7 @@ public class RecoveryZkTest extends Abst
     
     waitForThingsToLevelOut(30);
     
-    Thread.sleep(1000);
+    Thread.sleep(5000);
     
     waitForRecoveriesToFinish(DEFAULT_COLLECTION, zkStateReader, false, true);
 

Modified: lucene/dev/branches/lucene4547/solr/solrj/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/solr/solrj/ivy.xml?rev=1442821&r1=1442820&r2=1442821&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/solr/solrj/ivy.xml (original)
+++ lucene/dev/branches/lucene4547/solr/solrj/ivy.xml Wed Feb  6 00:58:30 2013
@@ -24,7 +24,7 @@
       <dependency org="org.apache.httpcomponents" name="httpcore" rev="4.1.4" transitive="false"/>
       <dependency org="org.apache.httpcomponents" name="httpclient" rev="4.1.3" transitive="false"/>
       <dependency org="org.apache.httpcomponents" name="httpmime" rev="4.1.3" transitive="false"/>
-      <dependency org="commons-io" name="commons-io" rev="2.1" transitive="false"/>
+      <dependency org="commons-io" name="commons-io" rev="${commons-io.version}" transitive="false"/>
       <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.4" transitive="false"/>
       <dependency org="org.codehaus.woodstox" name="wstx-asl" rev="3.2.7" transitive="false"/>
       <dependency org="org.slf4j" name="slf4j-api" rev="1.6.4" transitive="false"/>



Mime
View raw message