You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2002/05/07 14:06:49 UTC
cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs AvailableTest.java
bodewig 02/05/07 05:06:49
Modified: . Tag: ANT_15_BRANCH WHATSNEW
src/main/org/apache/tools/ant/taskdefs Tag: ANT_15_BRANCH
Available.java
src/testcases/org/apache/tools/ant/taskdefs Tag:
ANT_15_BRANCH AvailableTest.java
Log:
JDK 1.2- won't throw a SecurityException if you load a system class
via a different classloader.
Fixes <available>'s test21 for JDK 1.1 and 1.2
Revision Changes Path
No revision
No revision
1.263.2.4 +4 -0 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.263.2.3
retrieving revision 1.263.2.4
diff -u -r1.263.2.3 -r1.263.2.4
--- WHATSNEW 3 May 2002 21:30:27 -0000 1.263.2.3
+++ WHATSNEW 7 May 2002 12:06:49 -0000 1.263.2.4
@@ -14,6 +14,10 @@
temporary file; <setproxy> lets you set the JVM's http, ftp and socks proxy
settings.
+* <available classname="foo" ignoresystemclasses="true"> failed for
+JDK 1.1 and 1.2, even if the class could be found on the
+user-specified classpath.
+
Changes from Ant 1.4.1 to 1.5beta1
==================================
No revision
No revision
1.44.2.1 +8 -7 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Available.java
Index: Available.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Available.java,v
retrieving revision 1.44
retrieving revision 1.44.2.1
diff -u -r1.44 -r1.44.2.1
--- Available.java 16 Apr 2002 10:36:25 -0000 1.44
+++ Available.java 7 May 2002 12:06:49 -0000 1.44.2.1
@@ -464,19 +464,20 @@
try {
Class requiredClass = null;
if (ignoreSystemclasses) {
- loader = new AntClassLoader(null, getProject(),
- classpath, false);
+ loader = new AntClassLoader(null, getProject(), classpath,
+ false);
if (loader != null) {
try {
- loader.findClass(classname);
+ requiredClass = loader.findClass(classname);
} catch (SecurityException se) {
- // class found but restricted name; this is actually
- // the case we're looking for, so catch the exception
- // and return
+ // class found but restricted name; this is
+ // actually the case we're looking for in JDK 1.3+,
+ // so catch the exception and return
return true;
}
+ } else {
+ return false;
}
- return false;
} else if (loader != null) {
requiredClass = loader.loadClass(classname);
} else {
No revision
No revision
1.10.2.1 +0 -4 jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/AvailableTest.java
Index: AvailableTest.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/AvailableTest.java,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -r1.10 -r1.10.2.1
--- AvailableTest.java 23 Apr 2002 10:30:12 -0000 1.10
+++ AvailableTest.java 7 May 2002 12:06:49 -0000 1.10.2.1
@@ -201,10 +201,6 @@
// Core class that exists in system classpath is ignored, but found in specified classpath
public void test21() {
- if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) {
- // java.* classes are not found in JDK 1.1 even if specified in classpath attribute; test24 shows correct operation
- return;
- }
executeTarget("test21");
assertEquals("true",project.getProperty("test"));
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>