Use generics
This commit is contained in:
@@ -95,13 +95,13 @@ public class ChildFirstTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Utility method to convert an enumeration-of-URLs into an array of URLs.
|
* Utility method to convert an enumeration-of-URLs into an array of URLs.
|
||||||
*/
|
*/
|
||||||
private static URL[] toURLArray(final Enumeration e) {
|
private static URL[] toURLArray(final Enumeration<URL> e) {
|
||||||
final ArrayList l = new ArrayList();
|
final ArrayList<URL> l = new ArrayList<>();
|
||||||
while (e.hasMoreElements()) {
|
while (e.hasMoreElements()) {
|
||||||
l.add((URL) e.nextElement());
|
l.add(e.nextElement());
|
||||||
}
|
}
|
||||||
final URL[] tmp = new URL[l.size()];
|
final URL[] tmp = new URL[l.size()];
|
||||||
return (URL[]) l.toArray(tmp);
|
return l.toArray(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -266,7 +266,7 @@ public class ChildFirstTestCase extends TestCase {
|
|||||||
* Test that the various flavors of ClassLoader.getResources work as expected.
|
* Test that the various flavors of ClassLoader.getResources work as expected.
|
||||||
*/
|
*/
|
||||||
public void testResources() throws Exception {
|
public void testResources() throws Exception {
|
||||||
Enumeration resources;
|
Enumeration<URL> resources;
|
||||||
URL[] urls;
|
URL[] urls;
|
||||||
|
|
||||||
// verify the class loader hierarchy
|
// verify the class loader hierarchy
|
||||||
|
|||||||
Reference in New Issue
Block a user