stevel 2004/04/22 07:48:31 Modified: src/testcases/org/apache/tools/ant DirectoryScannerTest.java src/main/org/apache/tools/ant/util WeakishReference.java src/main/org/apache/tools/ant/taskdefs/rmic DefaultRmicAdapter.java src/main/org/apache/tools/ant/taskdefs/optional/net SetProxy.java src/main/org/apache/tools/ant/taskdefs/optional Javah.java src/main/org/apache/tools/ant/taskdefs Get.java GenerateKey.java src/main/org/apache/tools/ant Project.java Log: Purge of many (but not all) the if-java-1.1 tests in the ant code. I left those in the tests in, and I left the javac and javadoc tests in, as they are more complex. This is the simple set. Revision Changes Path 1.29 +1 -2 ant/src/testcases/org/apache/tools/ant/DirectoryScannerTest.java Index: DirectoryScannerTest.java =================================================================== RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/DirectoryScannerTest.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- DirectoryScannerTest.java 9 Mar 2004 16:48:56 -0000 1.28 +++ DirectoryScannerTest.java 22 Apr 2004 14:48:31 -0000 1.29 @@ -37,8 +37,7 @@ public DirectoryScannerTest(String name) {super(name);} // keep track of what operating systems are supported here. - private boolean supportsSymlinks = Os.isFamily("unix") - && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1); + private boolean supportsSymlinks = Os.isFamily("unix"); public void setUp() { configureProject("src/etc/testcases/core/directoryscanner.xml"); 1.15 +6 -42 ant/src/main/org/apache/tools/ant/util/WeakishReference.java Index: WeakishReference.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/WeakishReference.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- WeakishReference.java 9 Feb 2004 21:05:38 -0000 1.14 +++ WeakishReference.java 22 Apr 2004 14:48:31 -0000 1.15 @@ -18,65 +18,28 @@ package org.apache.tools.ant.util; import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.util.optional.WeakishReference12; import java.lang.reflect.Constructor; /** - * this is a weak reference on java1.2 and up, a hard - * reference on java1.1 + * this is a weak reference on java1.2 and up, i.e. all + * platforms Ant1.7 supports * @since ant1.6 */ public abstract class WeakishReference { - private static Constructor referenceConstructor; - - private final static String WEAK_REFERENCE_NAME - = "org.apache.tools.ant.util.optional.WeakishReference12"; - /** * create the appropriate type of reference for the java version * @param object * @return reference to the Object. */ public static WeakishReference createReference(Object object) { - if (referenceConstructor == null) { - createReferenceConstructor(); - } - try { - return (WeakishReference) referenceConstructor - .newInstance(new Object[]{object}); - } catch (Exception e) { - throw new BuildException("while creating a weakish reference", e); - } + return new WeakishReference12(object); } /** - * create the appropriate constructor method for the - */ - private static void createReferenceConstructor() { - Class[] ctor = new Class[]{Object.class}; - try { - referenceConstructor = HardReference.class.getConstructor(ctor); - } catch (NoSuchMethodException e) { - //deep trouble here - throw new BuildException("when creating a Hard Reference constructor", e); - } - if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { - //create a weak ref constructor. If this fails we have that hard one anyway - try { - Class clazz = Class.forName(WEAK_REFERENCE_NAME); - referenceConstructor = clazz.getConstructor(ctor); - } catch (ClassNotFoundException e) { - // ignore - } catch (NoSuchMethodException e) { - // ignore - } - } - } - - - /** * Returns this reference object's referent. If this reference object has * been cleared, then this method returns <code>null</code>. * @@ -86,7 +49,8 @@ public abstract Object get(); /** - * A hard reference for Java 1.1 + * A hard reference for Java 1.1. + * Hopefully nobody is using this. */ public static class HardReference extends WeakishReference { private Object object; 1.32 +2 -9 ant/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java Index: DefaultRmicAdapter.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- DefaultRmicAdapter.java 9 Mar 2004 16:48:41 -0000 1.31 +++ DefaultRmicAdapter.java 22 Apr 2004 14:48:31 -0000 1.32 @@ -147,15 +147,8 @@ cmd.createArgument().setFile(attributes.getBase()); if (attributes.getExtdirs() != null) { - if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { - /* - * XXX - This doesn't mix very well with build.systemclasspath, - */ - classpath.addExtdirs(attributes.getExtdirs()); - } else { - cmd.createArgument().setValue("-extdirs"); - cmd.createArgument().setPath(attributes.getExtdirs()); - } + cmd.createArgument().setValue("-extdirs"); + cmd.createArgument().setPath(attributes.getExtdirs()); } cmd.createArgument().setValue("-classpath"); 1.23 +0 -34 ant/src/main/org/apache/tools/ant/taskdefs/optional/net/SetProxy.java Index: SetProxy.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/SetProxy.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- SetProxy.java 9 Mar 2004 16:48:32 -0000 1.22 +++ SetProxy.java 22 Apr 2004 14:48:31 -0000 1.23 @@ -229,13 +229,6 @@ sysprops.remove("java.net.socks.password"); } } - - - //for Java1.1 we need to tell the system that the settings are new - if (settingsChanged - && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { - legacyResetProxySettingsCall(enablingProxy); - } } /** @@ -247,33 +240,6 @@ + ":" + proxyPort, Project.MSG_VERBOSE); } - - - /** - * make a call to sun.net.www.http.HttpClient.resetProperties(); - * this is only needed for java 1.1; reflection is used to stop the compiler - * whining, and in case cleanroom JVMs dont have the class. - * @return true if we did something - */ - - protected boolean legacyResetProxySettingsCall(boolean setProxy) { - System.getProperties().put("http.proxySet", new Boolean(setProxy).toString()); - try { - Class c = Class.forName("sun.net.www.http.HttpClient"); - Method reset = c.getMethod("resetProperties", null); - reset.invoke(null, null); - return true; - } catch (ClassNotFoundException cnfe) { - return false; - } catch (NoSuchMethodException e) { - return false; - } catch (IllegalAccessException e) { - return false; - } catch (InvocationTargetException e) { - return false; - } - } - /** * Does the work. 1.32 +4 -1 ant/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java Index: Javah.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- Javah.java 9 Mar 2004 16:48:14 -0000 1.31 +++ Javah.java 22 Apr 2004 14:48:31 -0000 1.32 @@ -271,6 +271,9 @@ classpath = classpath.concatSystemClasspath("ignore"); } + /* unused. + TODO: If anyone cannot come up with a reason for this, lets delete it + String compiler = getProject().getProperty("build.compiler"); if (compiler == null) { if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1) @@ -280,7 +283,7 @@ compiler = "classic"; } } - + */ doClassicCompile(); } 1.43 +1 -3 ant/src/main/org/apache/tools/ant/taskdefs/Get.java Index: Get.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Get.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- Get.java 9 Mar 2004 16:48:05 -0000 1.42 +++ Get.java 22 Apr 2004 14:48:31 -0000 1.43 @@ -288,9 +288,7 @@ * @param v "true" to enable file time fetching */ public void setUseTimestamp(boolean v) { - if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { - useTimestamp = v; - } + useTimestamp = v; } 1.27 +0 -4 ant/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java Index: GenerateKey.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- GenerateKey.java 9 Mar 2004 16:48:04 -0000 1.26 +++ GenerateKey.java 22 Apr 2004 14:48:31 -0000 1.27 @@ -265,10 +265,6 @@ } public void execute() throws BuildException { - if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { - throw new BuildException("The genkey task is only available on JDK" - + " versions 1.2 or greater"); - } if (null == alias) { throw new BuildException("alias attribute must be set"); 1.167 +8 -10 ant/src/main/org/apache/tools/ant/Project.java Index: Project.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Project.java,v retrieving revision 1.166 retrieving revision 1.167 diff -u -r1.166 -r1.167 --- Project.java 22 Apr 2004 14:03:47 -0000 1.166 +++ Project.java 22 Apr 2004 14:48:31 -0000 1.167 @@ -274,16 +274,14 @@ */ private AntClassLoader createClassLoader() { AntClassLoader loader = null; - if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { - try { - // 1.2+ - create advanced helper dynamically - Class loaderClass + try { + // 1.2+ - create advanced helper dynamically + Class loaderClass = Class.forName(ANTCLASSLOADER_JDK12); - loader = (AntClassLoader) loaderClass.newInstance(); - } catch (Exception e) { - log("Unable to create Class Loader: " - + e.getMessage(), Project.MSG_DEBUG); - } + loader = (AntClassLoader) loaderClass.newInstance(); + } catch (Exception e) { + log("Unable to create Class Loader: " + + e.getMessage(), Project.MSG_DEBUG); } if (loader == null) {
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]