You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by va...@apache.org on 2015/04/01 06:32:51 UTC

svn commit: r1670564 - in /lucene/dev/branches/branch_5x: ./ lucene/ lucene/core/ lucene/core/src/test/org/apache/lucene/index/ lucene/facet/ lucene/facet/src/java/org/apache/lucene/facet/ lucene/misc/ lucene/misc/src/java/org/apache/lucene/uninverting...

Author: varun
Date: Wed Apr  1 04:32:50 2015
New Revision: 1670564

URL: http://svn.apache.org/r1670564
Log:
LUCENE-6378: Fix all RuntimeExceptions to throw the underlying root cause (merged from trunk r1670453)

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/test/org/apache/lucene/index/TestFieldsReader.java
    lucene/dev/branches/branch_5x/lucene/facet/   (props changed)
    lucene/dev/branches/branch_5x/lucene/facet/src/java/org/apache/lucene/facet/RandomSamplingFacetsCollector.java
    lucene/dev/branches/branch_5x/lucene/misc/   (props changed)
    lucene/dev/branches/branch_5x/lucene/misc/src/java/org/apache/lucene/uninverting/DocTermOrds.java
    lucene/dev/branches/branch_5x/lucene/suggest/   (props changed)
    lucene/dev/branches/branch_5x/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java
    lucene/dev/branches/branch_5x/lucene/suggest/src/java/org/apache/lucene/search/suggest/FileDictionary.java
    lucene/dev/branches/branch_5x/lucene/test-framework/   (props changed)
    lucene/dev/branches/branch_5x/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/contrib/   (props changed)
    lucene/dev/branches/branch_5x/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/RegexRulesPasswordProvider.java
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentExpressionDictionaryFactory.java
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/FileDictionaryFactory.java
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/AnalyzingInfixLookupFactory.java
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/util/SimplePostTool.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=1670564&r1=1670563&r2=1670564&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/lucene/CHANGES.txt Wed Apr  1 04:32:50 2015
@@ -19,6 +19,10 @@ Optimizations
   faster IndexWriter.deleteAll in that case (Robert Muir, Adrien
   Grand, Mike McCandless)
 
+Bug Fixes
+
+* LUCENE-6378: Fix all RuntimeExceptions to throw the underlying root cause.
+  (Varun Thacker, Adrien Grand, Mike McCandless)
 ======================= Lucene 5.1.0 =======================
 
 New Features

Modified: lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java?rev=1670564&r1=1670563&r2=1670564&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java (original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/test/org/apache/lucene/index/TestFieldsReader.java Wed Apr  1 04:32:50 2015
@@ -172,7 +172,7 @@ public class TestFieldsReader extends Lu
       try {
         i.seek(getFilePointer());
       } catch (IOException e) {
-        throw new RuntimeException();
+        throw new RuntimeException(e);
       }
       return i;
     }

Modified: lucene/dev/branches/branch_5x/lucene/facet/src/java/org/apache/lucene/facet/RandomSamplingFacetsCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/facet/src/java/org/apache/lucene/facet/RandomSamplingFacetsCollector.java?rev=1670564&r1=1670563&r2=1670564&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/facet/src/java/org/apache/lucene/facet/RandomSamplingFacetsCollector.java (original)
+++ lucene/dev/branches/branch_5x/lucene/facet/src/java/org/apache/lucene/facet/RandomSamplingFacetsCollector.java Wed Apr  1 04:32:50 2015
@@ -215,7 +215,7 @@ public class RandomSamplingFacetsCollect
       
       return new MatchingDocs(docs.context, new BitDocIdSet(sampleDocs), docs.totalHits, null);
     } catch (IOException e) {
-      throw new RuntimeException();
+      throw new RuntimeException(e);
     }
   }
   

Modified: lucene/dev/branches/branch_5x/lucene/misc/src/java/org/apache/lucene/uninverting/DocTermOrds.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/misc/src/java/org/apache/lucene/uninverting/DocTermOrds.java?rev=1670564&r1=1670563&r2=1670564&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/misc/src/java/org/apache/lucene/uninverting/DocTermOrds.java (original)
+++ lucene/dev/branches/branch_5x/lucene/misc/src/java/org/apache/lucene/uninverting/DocTermOrds.java Wed Apr  1 04:32:50 2015
@@ -902,7 +902,7 @@ public class DocTermOrds implements Acco
       try {
         return getOrdTermsEnum(reader);
       } catch (IOException e) {
-        throw new RuntimeException();
+        throw new RuntimeException(e);
       }
     }
   }

Modified: lucene/dev/branches/branch_5x/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java?rev=1670564&r1=1670563&r2=1670564&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java (original)
+++ lucene/dev/branches/branch_5x/lucene/suggest/src/java/org/apache/lucene/search/suggest/DocumentValueSourceDictionary.java Wed Apr  1 04:32:50 2015
@@ -145,7 +145,7 @@ public class DocumentValueSourceDictiona
         try {
           currentWeightValues = weightsValueSource.getValues(new HashMap<String, Object>(), leaves.get(currentLeafIndex));
         } catch (IOException e) {
-          throw new RuntimeException();
+          throw new RuntimeException(e);
         }
       }
       return currentWeightValues.longVal(docId - starts[subIndex]);

Modified: lucene/dev/branches/branch_5x/lucene/suggest/src/java/org/apache/lucene/search/suggest/FileDictionary.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/suggest/src/java/org/apache/lucene/search/suggest/FileDictionary.java?rev=1670564&r1=1670563&r2=1670564&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/suggest/src/java/org/apache/lucene/search/suggest/FileDictionary.java (original)
+++ lucene/dev/branches/branch_5x/lucene/suggest/src/java/org/apache/lucene/search/suggest/FileDictionary.java Wed Apr  1 04:32:50 2015
@@ -113,7 +113,7 @@ public class FileDictionary implements D
     try {
       return new FileIterator();
     } catch (IOException e) {
-      throw new RuntimeException();
+      throw new RuntimeException(e);
     }
   }
 

Modified: lucene/dev/branches/branch_5x/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java?rev=1670564&r1=1670563&r2=1670564&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java (original)
+++ lucene/dev/branches/branch_5x/lucene/test-framework/src/java/org/apache/lucene/index/BaseDocValuesFormatTestCase.java Wed Apr  1 04:32:50 2015
@@ -2681,7 +2681,7 @@ public abstract class BaseDocValuesForma
                 }
               }
             } catch (Throwable e) {
-              throw new RuntimeException();
+              throw new RuntimeException(e);
             }
           }
         };

Modified: lucene/dev/branches/branch_5x/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/RegexRulesPasswordProvider.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/RegexRulesPasswordProvider.java?rev=1670564&r1=1670563&r2=1670564&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/RegexRulesPasswordProvider.java (original)
+++ lucene/dev/branches/branch_5x/solr/contrib/extraction/src/java/org/apache/solr/handler/extraction/RegexRulesPasswordProvider.java Wed Apr  1 04:32:50 2015
@@ -103,7 +103,7 @@ public class RegexRulesPasswordProvider
       }
       is.close();
     } catch (IOException e) {
-      throw new RuntimeException();
+      throw new RuntimeException(e);
     }
     return rules;
   }

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java?rev=1670564&r1=1670563&r2=1670564&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java Wed Apr  1 04:32:50 2015
@@ -1494,7 +1494,7 @@ public class ExtendedDismaxQParser exten
       try {
         queryFields = DisMaxQParser.parseQueryFields(req.getSchema(), solrParams);  // req.getSearcher() here causes searcher refcount imbalance
       } catch (SyntaxError e) {
-        throw new RuntimeException();
+        throw new RuntimeException(e);
       }
       // Phrase slop array
       int pslop[] = new int[4];

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentExpressionDictionaryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentExpressionDictionaryFactory.java?rev=1670564&r1=1670563&r2=1670564&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentExpressionDictionaryFactory.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentExpressionDictionaryFactory.java Wed Apr  1 04:32:50 2015
@@ -99,7 +99,7 @@ public class DocumentExpressionDictionar
     try {
       expression = JavascriptCompiler.compile(weightExpression);
     } catch (ParseException e) {
-      throw new RuntimeException();
+      throw new RuntimeException(e);
     }
     SimpleBindings bindings = new SimpleBindings();
     for (SortField sortField : sortFields) {

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/FileDictionaryFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/FileDictionaryFactory.java?rev=1670564&r1=1670563&r2=1670564&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/FileDictionaryFactory.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/FileDictionaryFactory.java Wed Apr  1 04:32:50 2015
@@ -55,7 +55,7 @@ public class FileDictionaryFactory exten
       return new FileDictionary(new InputStreamReader(
           core.getResourceLoader().openResource(sourceLocation), StandardCharsets.UTF_8), fieldDelimiter);
     } catch (IOException e) {
-      throw new RuntimeException();
+      throw new RuntimeException(e);
     }
   }
   

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/AnalyzingInfixLookupFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/AnalyzingInfixLookupFactory.java?rev=1670564&r1=1670563&r2=1670564&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/AnalyzingInfixLookupFactory.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/spelling/suggest/fst/AnalyzingInfixLookupFactory.java Wed Apr  1 04:32:50 2015
@@ -135,7 +135,7 @@ public class AnalyzingInfixLookupFactory
         }
         };
     } catch (IOException e) {
-      throw new RuntimeException();
+      throw new RuntimeException(e);
     }
   }
 

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/util/SimplePostTool.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/util/SimplePostTool.java?rev=1670564&r1=1670563&r2=1670564&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/util/SimplePostTool.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/util/SimplePostTool.java Wed Apr  1 04:32:50 2015
@@ -518,7 +518,7 @@ public class SimplePostTool {
         Thread.sleep(delay * 1000);
         filesPosted++;
       } catch (InterruptedException e) {
-        throw new RuntimeException();
+        throw new RuntimeException(e);
       }
     }
     return filesPosted;
@@ -610,7 +610,7 @@ public class SimplePostTool {
       } catch (IOException e) {
         warn("Caught exception when trying to open connection to "+u+": "+e.getMessage());
       } catch (InterruptedException e) {
-        throw new RuntimeException();
+        throw new RuntimeException(e);
       }
     }
     if(!subStack.isEmpty()) {
@@ -1209,7 +1209,7 @@ public class SimplePostTool {
       } catch (IOException e) {
         warn("IOException opening URL "+url+": "+e.getMessage());
       } catch (Exception e) {
-        throw new RuntimeException();
+        throw new RuntimeException(e);
       }
       return l;
     }