From: David S. <ds...@us...> - 2006-11-16 19:17:48
|
Update of /cvsroot/junit/junit/org/junit/runners In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25645/org/junit/runners Modified Files: Parameterized.java Suite.java Log Message: - Fixed raw types because Eclipse 3.3 told us to. - No longer dynamically check arrays that are statically typed as objects. - Update documentation to 4.2 Index: Parameterized.java =================================================================== RCS file: /cvsroot/junit/junit/org/junit/runners/Parameterized.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Parameterized.java 25 Aug 2006 14:43:02 -0000 1.5 +++ Parameterized.java 16 Nov 2006 19:17:41 -0000 1.6 @@ -71,7 +71,7 @@ private final int fParameterSetNumber; - private final Constructor fConstructor; + private final Constructor<?> fConstructor; private TestClassRunnerForParameters(Class<?> klass, Object[] parameters, int i) { super(klass); @@ -95,8 +95,8 @@ return String.format("%s[%s]", method.getName(), fParameterSetNumber); } - private Constructor getOnlyConstructor() { - Constructor[] constructors= getTestClass().getConstructors(); + private Constructor<?> getOnlyConstructor() { + Constructor<?>[] constructors= getTestClass().getConstructors(); assertEquals(1, constructors.length); return constructors[0]; } @@ -119,7 +119,7 @@ } } - private Collection getParametersList() throws IllegalAccessException, InvocationTargetException, Exception { + private Collection<?> getParametersList() throws IllegalAccessException, InvocationTargetException, Exception { return (Collection) getParametersMethod().invoke(null); } Index: Suite.java =================================================================== RCS file: /cvsroot/junit/junit/org/junit/runners/Suite.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Suite.java 2 Nov 2006 22:56:55 -0000 1.5 +++ Suite.java 16 Nov 2006 19:17:42 -0000 1.6 @@ -26,7 +26,7 @@ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface SuiteClasses { - public Class[] value(); + public Class<?>[] value(); } /** @@ -38,24 +38,23 @@ // This won't work correctly in the face of concurrency. For that we need to // add parameters to getRunner(), which would be much more complicated. - private static Set<Class> parents = new HashSet<Class>(); + private static Set<Class<?>> parents = new HashSet<Class<?>>(); - private static Class addParent(Class parent) throws InitializationError { + private static Class<?> addParent(Class<?> parent) throws InitializationError { if (!parents.add(parent)) throw new InitializationError(String.format("class '%s' (possibly indirectly) contains itself as a SuiteClass", parent.getName())); return parent; } - protected Suite(Class<?> klass, Class[] annotatedClasses) throws InitializationError { + protected Suite(Class<?> klass, Class<?>[] annotatedClasses) throws InitializationError { super(addParent(klass), Request.classes(klass.getName(), annotatedClasses).getRunner()); parents.remove(klass); } - private static Class[] getAnnotatedClasses(Class<?> klass) throws InitializationError { + private static Class<?>[] getAnnotatedClasses(Class<?> klass) throws InitializationError { SuiteClasses annotation= klass.getAnnotation(SuiteClasses.class); if (annotation == null) throw new InitializationError(String.format("class '%s' must have a SuiteClasses annotation", klass.getName())); - Class[] classes= annotation.value(); - return classes; + return annotation.value(); } } |