Polishing
This commit is contained in:
@@ -55,6 +55,7 @@ public abstract class ReflectionUtils {
|
||||
|
||||
private static final Field[] NO_FIELDS = {};
|
||||
|
||||
|
||||
/**
|
||||
* Cache for {@link Class#getDeclaredMethods()} plus equivalent default methods
|
||||
* from Java 8 based interfaces, allowing for fast iteration.
|
||||
@@ -114,7 +115,7 @@ public abstract class ReflectionUtils {
|
||||
* <p>Thrown exceptions are handled via a call to {@link #handleReflectionException(Exception)}.
|
||||
* @param field the field to set
|
||||
* @param target the target object on which to set the field
|
||||
* @param value the value to set; may be {@code null}
|
||||
* @param value the value to set (may be {@code null})
|
||||
*/
|
||||
public static void setField(Field field, Object target, Object value) {
|
||||
try {
|
||||
@@ -296,12 +297,11 @@ public abstract class ReflectionUtils {
|
||||
|
||||
/**
|
||||
* Rethrow the given {@link Throwable exception}, which is presumably the
|
||||
* <em>target exception</em> of an {@link InvocationTargetException}. Should
|
||||
* only be called if no checked exception is expected to be thrown by the
|
||||
* target method.
|
||||
* <em>target exception</em> of an {@link InvocationTargetException}.
|
||||
* Should only be called if no checked exception is expected to be thrown
|
||||
* by the target method.
|
||||
* <p>Rethrows the underlying exception cast to an {@link RuntimeException} or
|
||||
* {@link Error} if appropriate; otherwise, throws an
|
||||
* {@link IllegalStateException}.
|
||||
* {@link Error} if appropriate; otherwise, throws an {@link IllegalStateException}.
|
||||
* @param ex the exception to rethrow
|
||||
* @throws RuntimeException the rethrown exception
|
||||
*/
|
||||
@@ -317,12 +317,11 @@ public abstract class ReflectionUtils {
|
||||
|
||||
/**
|
||||
* Rethrow the given {@link Throwable exception}, which is presumably the
|
||||
* <em>target exception</em> of an {@link InvocationTargetException}. Should
|
||||
* only be called if no checked exception is expected to be thrown by the
|
||||
* target method.
|
||||
* <em>target exception</em> of an {@link InvocationTargetException}.
|
||||
* Should only be called if no checked exception is expected to be thrown
|
||||
* by the target method.
|
||||
* <p>Rethrows the underlying exception cast to an {@link Exception} or
|
||||
* {@link Error} if appropriate; otherwise, throws an
|
||||
* {@link IllegalStateException}.
|
||||
* {@link Error} if appropriate; otherwise, throws an {@link IllegalStateException}.
|
||||
* @param ex the exception to rethrow
|
||||
* @throws Exception the rethrown exception (in case of a checked exception)
|
||||
*/
|
||||
@@ -338,8 +337,8 @@ public abstract class ReflectionUtils {
|
||||
|
||||
/**
|
||||
* Determine whether the given method explicitly declares the given
|
||||
* exception or one of its superclasses, which means that an exception of
|
||||
* that type can be propagated as-is within a reflective invocation.
|
||||
* exception or one of its superclasses, which means that an exception
|
||||
* of that type can be propagated as-is within a reflective invocation.
|
||||
* @param method the declaring method
|
||||
* @param exceptionType the exception to throw
|
||||
* @return {@code true} if the exception can be thrown as-is;
|
||||
|
||||
Reference in New Issue
Block a user