This is an automated email from the ASF dual-hosted git repository. paulk pushed a commit to branch GROOVY_4_0_X in repository https://gitbox.apache.org/repos/asf/groovy.git
commit a9b55e58e772913077e512f00c89b860edadb772 Author: Paul King <[email protected]> AuthorDate: Wed Apr 13 16:12:54 2022 +1000 remove Xlint warning --- .../groovy-test/src/main/java/groovy/test/GroovyTestSuite.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subprojects/groovy-test/src/main/java/groovy/test/GroovyTestSuite.java b/subprojects/groovy-test/src/main/java/groovy/test/GroovyTestSuite.java index 1d3921b4bc..914b9f2f2f 100644 --- a/subprojects/groovy-test/src/main/java/groovy/test/GroovyTestSuite.java +++ b/subprojects/groovy-test/src/main/java/groovy/test/GroovyTestSuite.java @@ -21,6 +21,7 @@ package groovy.test; import groovy.lang.GroovyClassLoader; import groovy.lang.Script; import junit.framework.Test; +import junit.framework.TestCase; import junit.framework.TestSuite; import junit.textui.TestRunner; import org.apache.groovy.test.ScriptTestAdapter; @@ -77,7 +78,7 @@ public class GroovyTestSuite extends TestSuite { throw new RuntimeException("No filename given in the 'test' system property so cannot run a Groovy unit test"); } System.out.println("Compiling: " + fileName); - Class type = compile(fileName); + Class<? extends TestCase> type = compile(fileName); String[] args = {}; if (!Test.class.isAssignableFrom(type) && Script.class.isAssignableFrom(type)) { // let's treat the script as a Test @@ -87,7 +88,7 @@ public class GroovyTestSuite extends TestSuite { } } - public Class compile(String fileName) throws Exception { + public Class<? extends TestCase> compile(String fileName) throws Exception { return loader.parseClass(new File(fileName)); } }
