private static boolean declaresInterruptedEx(Method method) { for (Class<?> exType : method.getExceptionTypes()) { // debate: == or isAssignableFrom? if (exType == InterruptedException.class) { return true; } } return false; }
private static boolean declaresInterruptedEx(Method method) { for (Class<?> exType : method.getExceptionTypes()) { // debate: == or isAssignableFrom? if (exType == InterruptedException.class) { return true; } } return false; }
public Class<?>[] getExceptionTypes() { return method.getExceptionTypes(); }
/** * {@inheritDoc} */ public int size() { return method.getExceptionTypes().length; }
private static boolean declaresInterruptedEx(Method method) { for (Class<?> exType : method.getExceptionTypes()) { // debate: == or isAssignableFrom? if (exType == InterruptedException.class) { return true; } } return false; }
public boolean isValidException(Throwable throwable) { Class<?>[] exceptions = method.getExceptionTypes(); Class<?> throwableClass = throwable.getClass(); for (Class<?> exception : exceptions) { if (exception.isAssignableFrom(throwableClass)) { return true; } } return false; }
/** * 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. * @param method the declaring method * @param exceptionType the exception to throw * @return {@code true} if the exception can be thrown as-is; * {@code false} if it needs to be wrapped */ public static boolean declaresException(Method method, Class<?> exceptionType) { Assert.notNull(method, "Method must not be null"); Class<?>[] declaredExceptions = method.getExceptionTypes(); for (Class<?> declaredException : declaredExceptions) { if (declaredException.isAssignableFrom(exceptionType)) { return true; } } return false; }
public boolean isValidException(Throwable throwable) { Class<?>[] exceptions = method.getExceptionTypes(); Class<?> throwableClass = throwable.getClass(); for (Class<?> exception : exceptions) { if (exception.isAssignableFrom(throwableClass)) { return true; } } return false; }
@Override public Class<?>[] getExceptionTypes() { return methodInvocation.getMethod().getExceptionTypes(); }
public SerializableMethod(Method method) { this.method = method; declaringClass = method.getDeclaringClass(); methodName = method.getName(); parameterTypes = SuspendMethod.trimSuspendParameterTypes(method.getParameterTypes()); returnType = method.getReturnType(); exceptionTypes = method.getExceptionTypes(); isVarArgs = method.isVarArgs(); isAbstract = (method.getModifiers() & Modifier.ABSTRACT) != 0; }
public SerializableMethod(Method method) { declaringClass = method.getDeclaringClass(); methodName = method.getName(); parameterTypes = method.getParameterTypes(); returnType = method.getReturnType(); exceptionTypes = method.getExceptionTypes(); isVarArgs = method.isVarArgs(); }
/** * {@inheritDoc} */ public TypeDescription.Generic get(int index) { return new OfMethodExceptionTypes.TypeProjection(method, index, method.getExceptionTypes()); }
/** * {@inheritDoc} */ public TypeList asErasures() { return new TypeList.ForLoadedTypes(method.getExceptionTypes()); }
private static void setThrows(MethodInfo minfo, ConstPool cp, Method orig) { Class[] exceptions = orig.getExceptionTypes(); setThrows(minfo, cp, exceptions); }
/** Determines whether the given method can throw InterruptedException. */ private static boolean isInterruptible(Method method) { return Arrays.asList(method.getExceptionTypes()).contains(InterruptedException.class); }
public static Type[] getExceptionTypes(Member member) { if (member instanceof Method) { return TypeUtils.getTypes(((Method) member).getExceptionTypes()); } else if (member instanceof Constructor) { return TypeUtils.getTypes(((Constructor) member).getExceptionTypes()); } else { throw new IllegalArgumentException("Cannot get exception types of a field"); } }
/** * {@inheritDoc} */ public TypeList.Generic getExceptionTypes() { if (TypeDescription.AbstractBase.RAW_TYPES) { return new TypeList.Generic.ForLoadedTypes(method.getExceptionTypes()); } return new TypeList.Generic.OfMethodExceptionTypes(method); }
public static Type[] getExceptionTypes(Member member) { if (member instanceof Method) { return TypeUtils.getTypes(((Method)member).getExceptionTypes()); } else if (member instanceof Constructor) { return TypeUtils.getTypes(((Constructor)member).getExceptionTypes()); } else { throw new IllegalArgumentException("Cannot get exception types of a field"); } }
public static Type[] getExceptionTypes(Member member) { if (member instanceof Method) { return TypeUtils.getTypes(((Method) member).getExceptionTypes()); } else if (member instanceof Constructor) { return TypeUtils.getTypes(((Constructor) member).getExceptionTypes()); } else { throw new IllegalArgumentException("Cannot get exception types of a field"); } }
private BaseAdapter( org.objectweb.asm.commons.Method asmMethod, Method method) { this( method, asmMethod, ReflectorClassWriter.this.visitMethod( Opcodes.ACC_PUBLIC, asmMethod.getName(), asmMethod.getDescriptor(), null, ReflectorClassWriter.getInternalNames(method.getExceptionTypes()))); }