Browse Source

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
master
Steve Loughran 20 years ago
parent
commit
e66d7c8754
2 changed files with 15 additions and 17 deletions
  1. +12
    -10
      src/main/org/apache/tools/ant/types/CommandlineJava.java
  2. +3
    -7
      src/testcases/org/apache/tools/ant/types/CommandlineJavaTest.java

+ 12
- 10
src/main/org/apache/tools/ant/types/CommandlineJava.java View File

@@ -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 <tt>Commandline</tt>. 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();


+ 3
- 7
src/testcases/org/apache/tools/ant/types/CommandlineJavaTest.java View File

@@ -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;


Loading…
Cancel
Save