From e66d7c8754e4f909585b710270491df927868512 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Thu, 7 Oct 2004 10:59:45 +0000 Subject: [PATCH] Dont ask me why jikes decided to go all fussy on me. It has, and these are the corrections. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276923 13f79535-47bb-0310-9956-ffa450edef68 --- .../tools/ant/types/CommandlineJava.java | 22 ++++++++++--------- .../tools/ant/types/CommandlineJavaTest.java | 10 +++------ 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/main/org/apache/tools/ant/types/CommandlineJava.java b/src/main/org/apache/tools/ant/types/CommandlineJava.java index 37b683f8e..939926644 100644 --- a/src/main/org/apache/tools/ant/types/CommandlineJava.java +++ b/src/main/org/apache/tools/ant/types/CommandlineJava.java @@ -17,17 +17,17 @@ package org.apache.tools.ant.types; -import java.util.Enumeration; -import java.util.Properties; -import java.util.Vector; -import java.util.List; -import java.util.LinkedList; -import java.util.ListIterator; - import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.util.JavaEnvUtils; +import java.util.Enumeration; +import java.util.LinkedList; +import java.util.List; +import java.util.ListIterator; +import java.util.Properties; +import java.util.Vector; + /** * A representation of a Java command line that is * a composite of 2 Commandline. One is used for the @@ -74,7 +74,7 @@ public class CommandlineJava implements Cloneable { * Specialized Environment class for System properties */ public static class SysProperties extends Environment implements Cloneable { - Properties sys = null; + private Properties sys = null; private Vector propertySets = new Vector(); /** @@ -170,7 +170,7 @@ public class CommandlineJava implements Cloneable { * deep clone * @return a cloned instance of SysProperties */ - public Object clone() { + public Object clone() throws CloneNotSupportedException { try { SysProperties c = (SysProperties) super.clone(); c.variables = (Vector) variables.clone(); @@ -566,8 +566,10 @@ public class CommandlineJava implements Cloneable { /** * clone the object; clone of all fields in the class * @return a CommandlineJava object + * @throws BuildException if anything went wrong. + * @throws CloneNotSupportedException never */ - public Object clone() { + public Object clone() throws CloneNotSupportedException { try { CommandlineJava c = (CommandlineJava) super.clone(); c.vmCommand = (Commandline) vmCommand.clone(); diff --git a/src/testcases/org/apache/tools/ant/types/CommandlineJavaTest.java b/src/testcases/org/apache/tools/ant/types/CommandlineJavaTest.java index 848c2bac6..cc2681f89 100644 --- a/src/testcases/org/apache/tools/ant/types/CommandlineJavaTest.java +++ b/src/testcases/org/apache/tools/ant/types/CommandlineJavaTest.java @@ -17,14 +17,10 @@ package org.apache.tools.ant.types; +import junit.framework.TestCase; import org.apache.tools.ant.Project; import org.apache.tools.ant.util.JavaEnvUtils; -import junit.framework.TestCase; -import junit.framework.AssertionFailedError; - -import java.io.File; - /** * JUnit 3 testcases for org.apache.tools.ant.CommandlineJava * @@ -55,7 +51,7 @@ public class CommandlineJavaTest extends TestCase { } } - public void testGetCommandline() { + public void testGetCommandline() throws Exception { CommandlineJava c = new CommandlineJava(); c.createArgument().setValue("org.apache.tools.ant.CommandlineJavaTest"); c.setClassname("junit.textui.TestRunner"); @@ -143,7 +139,7 @@ public class CommandlineJavaTest extends TestCase { assertNull(System.getProperty("key2")); } - public void testAssertions() { + public void testAssertions() throws Exception { if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2) || JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) { return;