Javadoc method ClassUtilsTest#newSystemClassLoader() while looking for Sun Java 1.3.1 build issues on Windows XP. See http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=111738085310708&w=2
modified ClassUtilsTest.java git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@179179 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
630e5aec86
commit
46fe76f81a
|
@ -17,6 +17,7 @@ package org.apache.commons.lang;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
|
import java.net.URL;
|
||||||
import java.net.URLClassLoader;
|
import java.net.URLClassLoader;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -389,12 +390,20 @@ public class ClassUtilsTest extends TestCase {
|
||||||
assertNotSame("unmodified", noPrimitives, ClassUtils.primitivesToWrappers(noPrimitives));
|
assertNotSame("unmodified", noPrimitives, ClassUtils.primitivesToWrappers(noPrimitives));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ClassLoader newSystemClassLoader() throws SecurityException, IllegalArgumentException {
|
/**
|
||||||
|
* Creates a new instance of URLClassLoader with the system class loader's URLs and a <code>null</code> parent
|
||||||
|
* class loader.
|
||||||
|
*
|
||||||
|
* @see ClassLoader#getSystemClassLoader()
|
||||||
|
* @see URLClassLoader#newInstance(URL[], ClassLoader)
|
||||||
|
* @return the resulting class loader
|
||||||
|
*/
|
||||||
|
public static ClassLoader newSystemClassLoader() throws SecurityException, IllegalArgumentException {
|
||||||
ClassLoader scl = ClassLoader.getSystemClassLoader();
|
ClassLoader scl = ClassLoader.getSystemClassLoader();
|
||||||
if (!(scl instanceof URLClassLoader)) {
|
if (!(scl instanceof URLClassLoader)) {
|
||||||
fail("Need a better test set up.");
|
fail("Need a better test set up.");
|
||||||
}
|
}
|
||||||
URLClassLoader urlScl = (URLClassLoader)scl;
|
URLClassLoader urlScl = (URLClassLoader) scl;
|
||||||
return URLClassLoader.newInstance(urlScl.getURLs(), null);
|
return URLClassLoader.newInstance(urlScl.getURLs(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue