Same mistake twice today :( Keep code Java6 compatible
git-svn-id: https://svn.apache.org/repos/asf/maven/shared/trunk@1685337 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactTransitivityFilter.java b/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactTransitivityFilter.java
index e92a501..bc0056c 100644
--- a/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactTransitivityFilter.java
+++ b/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactTransitivityFilter.java
@@ -19,6 +19,7 @@
* under the License.
*/
+import java.lang.reflect.InvocationTargetException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -97,7 +98,17 @@
transitiveArtifacts.add( mavenArtifact.getDependencyConflictId() );
}
}
- catch ( ReflectiveOperationException e )
+ catch ( IllegalAccessException e )
+ {
+ // don't want to pollute method signature with ReflectionExceptions
+ throw new RuntimeException( e.getMessage(), e );
+ }
+ catch ( InvocationTargetException e )
+ {
+ // don't want to pollute method signature with ReflectionExceptions
+ throw new RuntimeException( e.getMessage(), e );
+ }
+ catch ( NoSuchMethodException e )
{
// don't want to pollute method signature with ReflectionExceptions
throw new RuntimeException( e.getMessage(), e );
@@ -122,7 +133,17 @@
transitiveArtifacts.add( mavenArtifact.getDependencyConflictId() );
}
}
- catch ( ReflectiveOperationException e )
+ catch ( IllegalAccessException e )
+ {
+ // don't want to pollute method signature with ReflectionExceptions
+ throw new RuntimeException( e.getMessage(), e );
+ }
+ catch ( InvocationTargetException e )
+ {
+ // don't want to pollute method signature with ReflectionExceptions
+ throw new RuntimeException( e.getMessage(), e );
+ }
+ catch ( NoSuchMethodException e )
{
// don't want to pollute method signature with ReflectionExceptions
throw new RuntimeException( e.getMessage(), e );
diff --git a/src/main/java/org/apache/maven/shared/artifact/filter/collection/Invoker.java b/src/main/java/org/apache/maven/shared/artifact/filter/collection/Invoker.java
index 44e058a..2e869e6 100644
--- a/src/main/java/org/apache/maven/shared/artifact/filter/collection/Invoker.java
+++ b/src/main/java/org/apache/maven/shared/artifact/filter/collection/Invoker.java
@@ -1,5 +1,7 @@
package org.apache.maven.shared.artifact.filter.collection;
+import java.lang.reflect.InvocationTargetException;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -31,21 +33,21 @@
}
public static Object invoke( Object object, String method )
- throws ReflectiveOperationException
+ throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
{
return invoke( object.getClass(), object, method );
}
public static Object invoke( Class<?> objectClazz, Object object, String method )
- throws ReflectiveOperationException
+ throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
{
- return objectClazz.getMethod( method ).invoke( object );
+ return objectClazz.getMethod( method ).invoke( object );
}
public static Object invoke( Object object, String method, Class<?> clazz, Object arg )
- throws ReflectiveOperationException
+ throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
{
- final Class<?> objectClazz = object.getClass();
- return objectClazz.getMethod( method, clazz ).invoke( object, arg );
+ final Class<?> objectClazz = object.getClass();
+ return objectClazz.getMethod( method, clazz ).invoke( object, arg );
}
}