You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2015/01/22 16:21:27 UTC

svn commit: r1653909 - in /lucene/dev/trunk/lucene: core/src/java/org/apache/lucene/store/LockStressTest.java expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java

Author: shalin
Date: Thu Jan 22 15:21:27 2015
New Revision: 1653909

URL: http://svn.apache.org/r1653909
Log:
LUCENE-6193: Use ReflectiveOperationException to simplify catch clauses around reflection errors

Modified:
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/LockStressTest.java
    lucene/dev/trunk/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/LockStressTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/LockStressTest.java?rev=1653909&r1=1653908&r2=1653909&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/LockStressTest.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/store/LockStressTest.java Thu Jan 22 15:21:27 2015
@@ -139,7 +139,7 @@ public class LockStressTest {
     // try to create a new instance
     try {
       return Class.forName(lockFactoryClassName).asSubclass(FSLockFactory.class).newInstance();
-    } catch (IllegalAccessException | InstantiationException | ClassCastException | ClassNotFoundException e) {
+    } catch (ReflectiveOperationException | ClassCastException e) {
       // fall-through
     }
 

Modified: lucene/dev/trunk/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java?rev=1653909&r1=1653908&r2=1653909&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java (original)
+++ lucene/dev/trunk/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java Thu Jan 22 15:21:27 2015
@@ -565,7 +565,7 @@ public class JavascriptCompiler {
         checkFunction(method, JavascriptCompiler.class.getClassLoader());
         map.put(call, method);
       }
-    } catch (NoSuchMethodException | ClassNotFoundException | IOException e) {
+    } catch (ReflectiveOperationException | IOException e) {
       throw new Error("Cannot resolve function", e);
     }
     DEFAULT_FUNCTIONS = Collections.unmodifiableMap(map);