/** * Raise NoClassDefFoundError for javassist not found * * @param name the name * @param e the not found error * @return never * @throws NoClassDefFoundError always */ public static NoClassDefFoundError raiseMethodNotFound(String name, NotFoundException e) throws NoClassDefFoundError { NoSuchMethodError ex = new NoSuchMethodError("Unable to find method " + name); if (e.getCause() != null) ex.initCause(e.getCause()); // Hide the javassist error throw ex; }
/** * Raise NoClassDefFoundError for javassist not found * * @param name the name * @param e the not found error * @return never * @throws NoClassDefFoundError always */ public static NoClassDefFoundError raiseClassNotFound(String name, NotFoundException e) throws NoClassDefFoundError { NoClassDefFoundError ex = new NoClassDefFoundError("Unable to find class"); if (e.getCause() != null) ex.initCause(e.getCause()); // Hide the javassist error throw ex; }
/** * Raise NoClassDefFoundError for javassist not found * * @param name the name * @param e the not found error * @return never * @throws NoClassDefFoundError always */ public static NoClassDefFoundError raiseClassNotFound(String name, NotFoundException e) throws NoClassDefFoundError { NoClassDefFoundError ex = new NoClassDefFoundError("Unable to find class " + name); if (e.getCause() != null) ex.initCause(e.getCause()); // Hide the javassist error throw ex; }
/** * Raise NoClassDefFoundError for javassist not found * * @param name the name * @param e the not found error * @return never * @throws NoClassDefFoundError always */ public static NoClassDefFoundError raiseMethodNotFound(String name, NotFoundException e) throws NoClassDefFoundError { NoSuchMethodError ex = new NoSuchMethodError("Unable to find method " + name); if (e.getCause() != null) ex.initCause(e.getCause()); // Hide the javassist error throw ex; }
/** * Raise NCDFE exception. * * @param type the error type * @param info the info * @param e javassist exception * @return NCDFE instance * @throws NoClassDefFoundError transform e param into NCDFE */ protected static NoClassDefFoundError raiseClassNotFound(String type, String info, NotFoundException e) throws NoClassDefFoundError { NoClassDefFoundError ex = new NoClassDefFoundError("Unable to find " + type + ": " + info); if (e.getCause() != null) ex.initCause(e.getCause()); // Hide the javassist error throw ex; } }
/** * Raise NoClassDefFoundError for javassist not found * * @param name the name * @param e the not found error * @return never * @throws NoClassDefFoundError always */ public static NoClassDefFoundError raiseFieldNotFound(String name, NotFoundException e) throws NoClassDefFoundError { NoSuchFieldError ex = new NoSuchFieldError("Unable to find field"); if (e.getCause() != null) ex.initCause(e.getCause()); // Hide the javassist error throw ex; }
public static CtClass getClass(Class<?> clazz) { try { return pool.get(clazz.getName()); } catch (NotFoundException e) { Throwable error = e.getCause(); if (error instanceof RuntimeException) { throw (RuntimeException) error; } if (error instanceof Exception) { throw new RuntimeException(error.getMessage(), error); } throw new RuntimeException(e.getMessage(), e); } }
/** * Raise NoClassDefFoundError for javassist not found * * @param name the name * @param e the not found error * @return never * @throws NoClassDefFoundError always */ public static NoClassDefFoundError raiseFieldNotFound(String name, NotFoundException e) throws NoClassDefFoundError { NoSuchFieldError ex = new NoSuchFieldError("Unable to find field " + name); if (e.getCause() != null) ex.initCause(e.getCause()); // Hide the javassist error throw ex; }
public static CtClass getClass(Class<?> clazz) { try { return pool.get(clazz.getName()); } catch (NotFoundException e) { Throwable error = e.getCause(); if (error instanceof RuntimeException) { throw (RuntimeException) error; } if (error instanceof Exception) { throw new RuntimeException(error.getMessage(), error); } throw new RuntimeException(e.getMessage(), e); } }
public static String[] getParameterNames(Class<?> clazz, Method method) { CtMethod ctMethod; try { ctMethod = CtClassUtil.getMethod(clazz, method); } catch (NotFoundException e) { Throwable error = e.getCause(); if (error instanceof RuntimeException) { throw (RuntimeException) error; } if (error instanceof Exception) { throw new RuntimeException(error.getMessage(), error); } throw new RuntimeException(e.getMessage(), e); } String[] names; try { names = getParameterNames(ctMethod); } catch (NotFoundException e) { throw new RuntimeException(e.getMessage(), e); } // System.err.println("getParameterNames methodName:" + method.toGenericString() + " names:" + StringUtils.join(names, ", ")); return names; }
public static String[] getParameterNames(Class<?> clazz, Method method) { CtMethod ctMethod; try { ctMethod = CtClassUtil.getMethod(clazz, method); } catch (NotFoundException e) { Throwable error = e.getCause(); if (error instanceof RuntimeException) { throw (RuntimeException) error; } if (error instanceof Exception) { throw new RuntimeException(error.getMessage(), error); } throw new RuntimeException(e.getMessage(), e); } String[] names; try { names = getParameterNames(ctMethod); } catch (NotFoundException e) { throw new RuntimeException(e.getMessage(), e); } // System.err.println("getParameterNames methodName:" + method.toGenericString() + " names:" + StringUtils.join(names, ", ")); return names; }