@Test void testParseArrayClassSuffix() { assertThat( MethodAntn.parseThrowableArray("{ java.lang.Throwable.class, " + " java.lang.Exception.class, " + " java.lang.RuntimeException.class }"), is(new Class[]{Throwable.class, Exception.class, RuntimeException.class})); }
@SuppressWarnings("unchecked") static Class<? extends Throwable>[] parseThrowableArray(String array) { List<Class<? extends Throwable>> result = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(array, "{}, \t\n\r", false); while (tokenizer.hasMoreTokens()) { try { String className = tokenizer.nextToken(); if (className.endsWith(".class")) { className = className.substring(0, className.length() - ".class".length()); } result.add((Class<? extends Throwable>) Class.forName(className)); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } return (Class<? extends Throwable>[]) result.toArray(new Class[0]); }
MethodAntn { @SuppressWarnings("unchecked") static Class<? extends Throwable>[] parseThrowableArray(String array) { List<Class<? extends Throwable>> result = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(array, "{}, \t\n\r", false); while (tokenizer.hasMoreTokens()) { try { String className = tokenizer.nextToken(); if (className.endsWith(".class")) { className = className.substring(0, className.length() - ".class".length()); } result.add((Class<? extends Throwable>) Class.forName(className)); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } return (Class<? extends Throwable>[]) result.toArray(new Class[0]); } }
MethodAntn { @SuppressWarnings("unchecked") static Class<? extends Throwable>[] parseThrowableArray(String array) { List<Class<? extends Throwable>> result = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(array, "{}, \t\n\r", false); while (tokenizer.hasMoreTokens()) { try { String className = tokenizer.nextToken(); if (className.endsWith(".class")) { className = className.substring(0, className.length() - ".class".length()); } result.add((Class<? extends Throwable>) Class.forName(className)); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } return (Class<? extends Throwable>[]) result.toArray(new Class[0]); } MethodAntn(Class<?> beanClass, Method method); }
MethodAntn { @SuppressWarnings("unchecked") static Class<? extends Throwable>[] parseThrowableArray(String array) { List<Class<? extends Throwable>> result = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(array, "{}, \t\n\r", false); while (tokenizer.hasMoreTokens()) { try { String className = tokenizer.nextToken(); if (className.endsWith(".class")) { className = className.substring(0, className.length() - ".class".length()); } result.add((Class<? extends Throwable>) Class.forName(className)); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } return (Class<? extends Throwable>[]) result.toArray(new Class[0]); } MethodAntn(Class<?> beanClass, Method method); final LookupResult<A> lookupAnnotation(Class<A> annotClass); abstract void validate(); @SuppressWarnings("unchecked") Class<? extends Annotation> annotationType(); }
MethodAntn { @SuppressWarnings("unchecked") static Class<? extends Throwable>[] parseThrowableArray(String array) { List<Class<? extends Throwable>> result = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(array, "{}, \t\n\r", false); while (tokenizer.hasMoreTokens()) { try { String className = tokenizer.nextToken(); if (className.endsWith(".class")) { className = className.substring(0, className.length() - ".class".length()); } result.add((Class<? extends Throwable>) Class.forName(className)); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } return (Class<? extends Throwable>[]) result.toArray(new Class[0]); } MethodAntn(Class<?> beanClass, Method method); final LookupResult<A> lookupAnnotation(Class<A> annotClass); abstract void validate(); @SuppressWarnings("unchecked") Class<? extends Annotation> annotationType();  }