git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1037691 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -1096,11 +1096,6 @@ public class ComponentHelper { | |||||
| return getTypeClass((String) key); | return getTypeClass((String) key); | ||||
| } | } | ||||
| Object create(String name) { | |||||
| AntTypeDefinition def = getDefinition(name); | |||||
| return (def == null) ? null : def.create(project); | |||||
| } | |||||
| Class getTypeClass(String name) { | Class getTypeClass(String name) { | ||||
| AntTypeDefinition def = getDefinition(name); | AntTypeDefinition def = getDefinition(name); | ||||
| return (def == null) ? null : def.getTypeClass(project); | return (def == null) ? null : def.getTypeClass(project); | ||||
| @@ -17,7 +17,6 @@ | |||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import org.apache.tools.ant.util.LoaderUtils; | |||||
| import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
| import org.apache.tools.ant.util.JAXPUtils; | import org.apache.tools.ant.util.JAXPUtils; | ||||
| import org.apache.tools.ant.util.ProxySetup; | import org.apache.tools.ant.util.ProxySetup; | ||||
| @@ -20,7 +20,6 @@ package org.apache.tools.ant; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.lang.ref.SoftReference; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Arrays; | import java.util.Arrays; | ||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| @@ -408,7 +408,7 @@ public abstract class Task extends ProjectComponent { | |||||
| replacement.setProject(getProject()); | replacement.setProject(getProject()); | ||||
| replacement.setTaskType(taskType); | replacement.setTaskType(taskType); | ||||
| replacement.setTaskName(taskName); | replacement.setTaskName(taskName); | ||||
| replacement.setLocation(location); | |||||
| replacement.setLocation(getLocation()); | |||||
| replacement.setOwningTarget(target); | replacement.setOwningTarget(target); | ||||
| replacement.setRuntimeConfigurableWrapper(wrapper); | replacement.setRuntimeConfigurableWrapper(wrapper); | ||||
| wrapper.setProxy(replacement); | wrapper.setProxy(replacement); | ||||
| @@ -403,7 +403,7 @@ public class ProjectHelperImpl extends ProjectHelper { | |||||
| } | } | ||||
| if (def != null && !def.equals("")) { | if (def != null && !def.equals("")) { | ||||
| helperImpl.project.setDefaultTarget(def); | |||||
| helperImpl.project.setDefault(def); | |||||
| } else { | } else { | ||||
| throw new BuildException("The default attribute is required"); | throw new BuildException("The default attribute is required"); | ||||
| } | } | ||||
| @@ -31,8 +31,6 @@ import org.apache.tools.ant.util.FileUtils; | |||||
| */ | */ | ||||
| public class GreedyInputHandler extends DefaultInputHandler { | public class GreedyInputHandler extends DefaultInputHandler { | ||||
| private static final int BUFFER_SIZE = 1024; | |||||
| /** | /** | ||||
| * Empty no-arg constructor | * Empty no-arg constructor | ||||
| */ | */ | ||||
| @@ -532,11 +532,11 @@ public class Checksum extends MatchingTask implements Condition { | |||||
| fos.write(format.format(new Object[] { | fos.write(format.format(new Object[] { | ||||
| checksum, | checksum, | ||||
| src.getName(), | src.getName(), | ||||
| FILE_UTILS | |||||
| FileUtils | |||||
| .getRelativePath(dest | .getRelativePath(dest | ||||
| .getParentFile(), | .getParentFile(), | ||||
| src), | src), | ||||
| FILE_UTILS | |||||
| FileUtils | |||||
| .getRelativePath(getProject() | .getRelativePath(getProject() | ||||
| .getBaseDir(), | .getBaseDir(), | ||||
| src), | src), | ||||
| @@ -27,7 +27,6 @@ import java.util.Comparator; | |||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
| import org.apache.tools.ant.taskdefs.condition.Os; | |||||
| import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
| import org.apache.tools.ant.types.PatternSet; | import org.apache.tools.ant.types.PatternSet; | ||||
| import org.apache.tools.ant.types.Resource; | import org.apache.tools.ant.types.Resource; | ||||
| @@ -29,9 +29,7 @@ import java.net.HttpURLConnection; | |||||
| import java.net.URL; | import java.net.URL; | ||||
| import java.net.URLConnection; | import java.net.URLConnection; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.HashSet; | |||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import java.util.Set; | |||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| @@ -78,7 +78,6 @@ public class ManifestClassPath extends Task { | |||||
| String[] elements = path.list(); | String[] elements = path.list(); | ||||
| StringBuffer buffer = new StringBuffer(); | StringBuffer buffer = new StringBuffer(); | ||||
| StringBuffer element = new StringBuffer(); | |||||
| for (int i = 0; i < elements.length; ++i) { | for (int i = 0; i < elements.length; ++i) { | ||||
| // Normalize the current file | // Normalize the current file | ||||
| File pathEntry = new File(elements[i]); | File pathEntry = new File(elements[i]); | ||||
| @@ -17,7 +17,6 @@ | |||||
| */ | */ | ||||
| package org.apache.tools.ant.taskdefs; | package org.apache.tools.ant.taskdefs; | ||||
| import java.lang.reflect.Method; | |||||
| import java.util.Enumeration; | import java.util.Enumeration; | ||||
| import java.util.Vector; | import java.util.Vector; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -482,7 +482,7 @@ public class Property extends Task { | |||||
| try { | try { | ||||
| File from = untypedValue instanceof File ? (File)untypedValue : new File(untypedValue.toString()); | File from = untypedValue instanceof File ? (File)untypedValue : new File(untypedValue.toString()); | ||||
| File to = basedir != null ? basedir : getProject().getBaseDir(); | File to = basedir != null ? basedir : getProject().getBaseDir(); | ||||
| String relPath = FileUtils.getFileUtils().getRelativePath(to, from); | |||||
| String relPath = FileUtils.getRelativePath(to, from); | |||||
| relPath = relPath.replace('/', File.separatorChar); | relPath = relPath.replace('/', File.separatorChar); | ||||
| addProperty(name, relPath); | addProperty(name, relPath); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -22,7 +22,6 @@ import java.io.BufferedReader; | |||||
| import java.io.BufferedWriter; | import java.io.BufferedWriter; | ||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.FileInputStream; | import java.io.FileInputStream; | ||||
| import java.io.FileNotFoundException; | |||||
| import java.io.FileOutputStream; | import java.io.FileOutputStream; | ||||
| import java.io.FileReader; | import java.io.FileReader; | ||||
| import java.io.FileWriter; | import java.io.FileWriter; | ||||
| @@ -26,7 +26,6 @@ import org.apache.tools.ant.types.FilterChain; | |||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.Resource; | import org.apache.tools.ant.types.Resource; | ||||
| import org.apache.tools.ant.types.resources.FileProvider; | import org.apache.tools.ant.types.resources.FileProvider; | ||||
| import org.apache.tools.ant.types.resources.FileResource; | |||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import java.io.File; | import java.io.File; | ||||
| @@ -26,7 +26,6 @@ import java.io.OutputStreamWriter; | |||||
| import java.io.PrintStream; | import java.io.PrintStream; | ||||
| import org.apache.tools.ant.ProjectComponent; | import org.apache.tools.ant.ProjectComponent; | ||||
| import org.apache.tools.ant.util.FileUtils; | |||||
| /** | /** | ||||
| * Class representing an email message. | * Class representing an email message. | ||||
| @@ -31,7 +31,6 @@ import java.io.Reader; | |||||
| import java.io.Writer; | import java.io.Writer; | ||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.DirectoryScanner; | |||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
| @@ -19,8 +19,6 @@ package org.apache.tools.ant.taskdefs.optional.net; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.lang.reflect.Constructor; | import java.lang.reflect.Constructor; | ||||
| import java.util.Collection; | |||||
| import java.util.Iterator; | |||||
| import java.util.Locale; | import java.util.Locale; | ||||
| import java.util.Vector; | import java.util.Vector; | ||||
| @@ -282,7 +282,6 @@ public class ScpFromMessage extends AbstractSshMessage { | |||||
| private void setLastModified(File localFile) throws JSchException { | private void setLastModified(File localFile) throws JSchException { | ||||
| SftpATTRS fileAttributes = null; | SftpATTRS fileAttributes = null; | ||||
| String remotePath = null; | |||||
| ChannelSftp channel = openSftpChannel(); | ChannelSftp channel = openSftpChannel(); | ||||
| channel.connect(); | channel.connect(); | ||||
| try { | try { | ||||
| @@ -25,7 +25,6 @@ import java.util.Map; | |||||
| import java.util.zip.ZipException; | import java.util.zip.ZipException; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.types.resources.FileResource; | |||||
| import org.apache.tools.ant.types.resources.ZipResource; | import org.apache.tools.ant.types.resources.ZipResource; | ||||
| import org.apache.tools.ant.types.resources.FileProvider; | import org.apache.tools.ant.types.resources.FileProvider; | ||||
| import org.apache.tools.zip.ZipEntry; | import org.apache.tools.zip.ZipEntry; | ||||
| @@ -24,7 +24,6 @@ import java.io.InputStream; | |||||
| import java.io.InputStreamReader; | import java.io.InputStreamReader; | ||||
| import java.io.OutputStream; | import java.io.OutputStream; | ||||
| import java.io.Reader; | import java.io.Reader; | ||||
| import java.io.UnsupportedEncodingException; | |||||
| import java.io.Writer; | import java.io.Writer; | ||||
| import java.net.MalformedURLException; | import java.net.MalformedURLException; | ||||
| import java.net.HttpURLConnection; | import java.net.HttpURLConnection; | ||||
| @@ -17,10 +17,7 @@ | |||||
| */ | */ | ||||
| package org.apache.tools.ant.util; | package org.apache.tools.ant.util; | ||||
| import java.util.Arrays; | |||||
| import java.util.HashSet; | |||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import java.util.LinkedList; | |||||
| /** | /** | ||||
| * A <code>ContainerMapper</code> that returns the results of its | * A <code>ContainerMapper</code> that returns the results of its | ||||
| @@ -29,7 +29,6 @@ import java.io.OutputStreamWriter; | |||||
| import java.io.PrintStream; | import java.io.PrintStream; | ||||
| import java.io.PushbackReader; | import java.io.PushbackReader; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Date; | |||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import java.util.Properties; | import java.util.Properties; | ||||
| @@ -21,7 +21,6 @@ import java.io.File; | |||||
| import java.io.FileNotFoundException; | import java.io.FileNotFoundException; | ||||
| import java.io.FilenameFilter; | import java.io.FilenameFilter; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import org.apache.tools.ant.BuildException; | |||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| import org.apache.tools.ant.taskdefs.Execute; | import org.apache.tools.ant.taskdefs.Execute; | ||||
| @@ -22,7 +22,6 @@ import org.apache.tools.ant.BuildException; | |||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import org.apache.tools.ant.util.ScriptRunnerBase; | import org.apache.tools.ant.util.ScriptRunnerBase; | ||||
| import org.apache.tools.ant.util.ReflectUtil; | |||||
| import org.apache.tools.ant.util.ReflectWrapper; | import org.apache.tools.ant.util.ReflectWrapper; | ||||
| /** | /** | ||||
| @@ -23,7 +23,6 @@ | |||||
| */ | */ | ||||
| package org.apache.tools.bzip2; | package org.apache.tools.bzip2; | ||||
| import java.io.ByteArrayInputStream; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.io.InputStream; | import java.io.InputStream; | ||||
| @@ -22,7 +22,6 @@ import java.nio.ByteBuffer; | |||||
| import java.nio.charset.Charset; | import java.nio.charset.Charset; | ||||
| import java.nio.charset.UnsupportedCharsetException; | import java.nio.charset.UnsupportedCharsetException; | ||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| import java.util.Locale; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| /** | /** | ||||
| @@ -19,7 +19,6 @@ | |||||
| package org.apache.tools.zip; | package org.apache.tools.zip; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Arrays; | |||||
| import java.util.LinkedHashMap; | import java.util.LinkedHashMap; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.zip.ZipException; | import java.util.zip.ZipException; | ||||
| @@ -26,7 +26,6 @@ package org.apache.tools.zip; | |||||
| public final class ZipLong implements Cloneable { | public final class ZipLong implements Cloneable { | ||||
| private static final int WORD = 4; | private static final int WORD = 4; | ||||
| private static final int BYTE_BIT_SIZE = 8; | |||||
| private static final int BYTE_MASK = 0xFF; | private static final int BYTE_MASK = 0xFF; | ||||
| private static final int BYTE_1 = 1; | private static final int BYTE_1 = 1; | ||||
| @@ -21,7 +21,6 @@ package org.apache.tools.ant; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.net.URL; | import java.net.URL; | ||||
| import java.util.ArrayList; | |||||
| import java.util.Arrays; | import java.util.Arrays; | ||||
| import java.util.Collections; | import java.util.Collections; | ||||
| import java.util.Enumeration; | import java.util.Enumeration; | ||||
| @@ -20,7 +20,6 @@ package org.apache.tools.ant; | |||||
| import org.apache.tools.ant.taskdefs.condition.Os; | import org.apache.tools.ant.taskdefs.condition.Os; | ||||
| import org.apache.tools.ant.types.selectors.TokenizedPath; | import org.apache.tools.ant.types.selectors.TokenizedPath; | ||||
| import org.apache.tools.ant.util.FileUtils; | |||||
| import org.apache.tools.ant.util.SymbolicLinkUtils; | import org.apache.tools.ant.util.SymbolicLinkUtils; | ||||
| import java.io.File; | import java.io.File; | ||||
| @@ -101,7 +101,6 @@ public class AntTest extends BuildFileTest { | |||||
| public void testDoNotInheritBasedir() { | public void testDoNotInheritBasedir() { | ||||
| File dir1 = getProjectDir(); | File dir1 = getProjectDir(); | ||||
| File dir2 = project.resolveFile("ant"); | File dir2 = project.resolveFile("ant"); | ||||
| String basedir = getProjectDir().getAbsolutePath(); | |||||
| testBaseDirs("doNotInheritBasedir", | testBaseDirs("doNotInheritBasedir", | ||||
| new String[] {dir1.getAbsolutePath(), | new String[] {dir1.getAbsolutePath(), | ||||
| dir2.getAbsolutePath() | dir2.getAbsolutePath() | ||||
| @@ -19,7 +19,6 @@ | |||||
| package org.apache.tools.ant.taskdefs; | package org.apache.tools.ant.taskdefs; | ||||
| import org.apache.tools.ant.BuildFileTest; | import org.apache.tools.ant.BuildFileTest; | ||||
| import org.apache.tools.ant.util.FileUtils; | |||||
| import org.apache.tools.bzip2.CBZip2InputStream; | import org.apache.tools.bzip2.CBZip2InputStream; | ||||
| import java.io.BufferedInputStream; | import java.io.BufferedInputStream; | ||||
| @@ -32,9 +31,6 @@ import java.io.IOException; | |||||
| */ | */ | ||||
| public class BZip2Test extends BuildFileTest { | public class BZip2Test extends BuildFileTest { | ||||
| /** Utilities used for file operations */ | |||||
| private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | |||||
| public BZip2Test(String name) { | public BZip2Test(String name) { | ||||
| super(name); | super(name); | ||||
| } | } | ||||
| @@ -62,7 +62,6 @@ public class JavaTest extends BuildFileTest { | |||||
| //final String propname="tests-classpath.value"; | //final String propname="tests-classpath.value"; | ||||
| //String testClasspath=System.getProperty(propname); | //String testClasspath=System.getProperty(propname); | ||||
| //System.out.println("Test cp="+testClasspath); | //System.out.println("Test cp="+testClasspath); | ||||
| String propname="tests-classpath.value"; | |||||
| String runFatal=System.getProperty("junit.run.fatal.tests"); | String runFatal=System.getProperty("junit.run.fatal.tests"); | ||||
| if(runFatal!=null) | if(runFatal!=null) | ||||
| runFatalTests=true; | runFatalTests=true; | ||||
| @@ -85,7 +85,6 @@ public class MakeUrlTest extends BuildFileTest { | |||||
| public void testFileset() { | public void testFileset() { | ||||
| executeTarget("testFileset"); | executeTarget("testFileset"); | ||||
| assertPropertyContains("testFileset", ".xml "); | assertPropertyContains("testFileset", ".xml "); | ||||
| String result = getProperty("testFileset"); | |||||
| assertPropertyEndsWith("testFileset", ".xml"); | assertPropertyEndsWith("testFileset", ".xml"); | ||||
| } | } | ||||
| @@ -23,7 +23,6 @@ import java.io.IOException; | |||||
| import java.io.Reader; | import java.io.Reader; | ||||
| import org.apache.tools.ant.BuildFileTest; | import org.apache.tools.ant.BuildFileTest; | ||||
| import org.apache.tools.ant.taskdefs.optional.XsltTest; | |||||
| import org.apache.tools.ant.util.FileUtils; | import org.apache.tools.ant.util.FileUtils; | ||||
| @@ -17,8 +17,6 @@ | |||||
| */ | */ | ||||
| package org.apache.tools.ant.taskdefs.condition; | package org.apache.tools.ant.taskdefs.condition; | ||||
| import org.apache.tools.ant.Project; | |||||
| import org.apache.tools.ant.BuildException; | |||||
| import org.apache.tools.ant.BuildFileTest; | import org.apache.tools.ant.BuildFileTest; | ||||
| /** | /** | ||||
| @@ -43,7 +43,6 @@ public class EchoPropertiesTest extends BuildFileTest { | |||||
| private static final String GOOD_OUTFILE_XML = "test.xml"; | private static final String GOOD_OUTFILE_XML = "test.xml"; | ||||
| private static final String PREFIX_OUTFILE = "test-prefix.properties"; | private static final String PREFIX_OUTFILE = "test-prefix.properties"; | ||||
| private static final String TEST_VALUE = "isSet"; | private static final String TEST_VALUE = "isSet"; | ||||
| private static final String BAD_OUTFILE = "."; | |||||
| public EchoPropertiesTest(String name) { | public EchoPropertiesTest(String name) { | ||||
| super(name); | super(name); | ||||
| @@ -38,7 +38,7 @@ public class SplashScreenTest { | |||||
| // give it some time to display | // give it some time to display | ||||
| try { | try { | ||||
| Thread.currentThread().sleep(2000); | |||||
| Thread.sleep(2000); | |||||
| } catch (InterruptedException e) { | } catch (InterruptedException e) { | ||||
| } // end of try-catch | } // end of try-catch | ||||
| @@ -46,7 +46,7 @@ public class SplashScreenTest { | |||||
| System.err.println("finished"); | System.err.println("finished"); | ||||
| try { | try { | ||||
| Thread.currentThread().sleep(2000); | |||||
| Thread.sleep(2000); | |||||
| } catch (InterruptedException e) { | } catch (InterruptedException e) { | ||||
| } // end of try-catch | } // end of try-catch | ||||
| System.err.println("exiting"); | System.err.println("exiting"); | ||||
| @@ -38,13 +38,11 @@ public class MSVSSTest extends BuildFileTest implements MSVSSConstants { | |||||
| private Commandline commandline; | private Commandline commandline; | ||||
| private static final String VSS_SERVER_PATH = "\\\\server\\vss\\srcsafe.ini"; | |||||
| private static final String VSS_PROJECT_PATH = "/SourceRoot/Project"; | private static final String VSS_PROJECT_PATH = "/SourceRoot/Project"; | ||||
| private static final String DS_VSS_PROJECT_PATH = "$/SourceRoot/Project"; | private static final String DS_VSS_PROJECT_PATH = "$/SourceRoot/Project"; | ||||
| private static final String VSS_USERNAME = "ant"; | private static final String VSS_USERNAME = "ant"; | ||||
| private static final String VSS_PASSWORD = "rocks"; | private static final String VSS_PASSWORD = "rocks"; | ||||
| private static final String LOCAL_PATH = "testdir"; | private static final String LOCAL_PATH = "testdir"; | ||||
| private static final String SRC_FILE = "Class1.java"; | |||||
| private static final String SRC_LABEL = "label1"; | private static final String SRC_LABEL = "label1"; | ||||
| private static final String LONG_LABEL = "123456789012345678901234567890"; | private static final String LONG_LABEL = "123456789012345678901234567890"; | ||||
| private static final String SRC_COMMENT = "I fixed a bug"; | private static final String SRC_COMMENT = "I fixed a bug"; | ||||
| @@ -19,13 +19,8 @@ | |||||
| package org.apache.tools.ant.types.selectors; | package org.apache.tools.ant.types.selectors; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | |||||
| import org.apache.tools.ant.types.Parameter; | import org.apache.tools.ant.types.Parameter; | ||||
| import java.text.SimpleDateFormat; | |||||
| import java.text.ParsePosition; | |||||
| import java.util.Date; | |||||
| /** | /** | ||||
| * Tests Date Selectors. | * Tests Date Selectors. | ||||
| @@ -33,8 +28,6 @@ import java.util.Date; | |||||
| */ | */ | ||||
| public class DateSelectorTest extends BaseSelectorTest { | public class DateSelectorTest extends BaseSelectorTest { | ||||
| private Project project; | |||||
| public DateSelectorTest(String name) { | public DateSelectorTest(String name) { | ||||
| super(name); | super(name); | ||||
| } | } | ||||
| @@ -175,8 +168,6 @@ public class DateSelectorTest extends BaseSelectorTest { | |||||
| s = (DateSelector)getInstance(); | s = (DateSelector)getInstance(); | ||||
| s.setDatetime("11/21/2001 4:55 AM"); | s.setDatetime("11/21/2001 4:55 AM"); | ||||
| SimpleDateFormat formatter = new SimpleDateFormat(); | |||||
| Date d = formatter.parse("11/21/2001 4:55 AM",new ParsePosition(0)); | |||||
| long milliseconds = s.getMillis(); | long milliseconds = s.getMillis(); | ||||
| s.setWhen(equal); | s.setWhen(equal); | ||||
| @@ -19,7 +19,6 @@ | |||||
| package org.apache.tools.ant.types.selectors; | package org.apache.tools.ant.types.selectors; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | |||||
| import org.apache.tools.ant.types.Mapper; | import org.apache.tools.ant.types.Mapper; | ||||
| import java.io.File; | import java.io.File; | ||||
| @@ -31,8 +30,6 @@ import java.io.File; | |||||
| */ | */ | ||||
| public class DependSelectorTest extends BaseSelectorTest { | public class DependSelectorTest extends BaseSelectorTest { | ||||
| private Project project; | |||||
| public DependSelectorTest(String name) { | public DependSelectorTest(String name) { | ||||
| super(name); | super(name); | ||||
| } | } | ||||
| @@ -19,7 +19,6 @@ | |||||
| package org.apache.tools.ant.types.selectors; | package org.apache.tools.ant.types.selectors; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | |||||
| import org.apache.tools.ant.types.Parameter; | import org.apache.tools.ant.types.Parameter; | ||||
| /** | /** | ||||
| @@ -28,8 +27,6 @@ import org.apache.tools.ant.types.Parameter; | |||||
| */ | */ | ||||
| public class DepthSelectorTest extends BaseSelectorTest { | public class DepthSelectorTest extends BaseSelectorTest { | ||||
| private Project project; | |||||
| public DepthSelectorTest(String name) { | public DepthSelectorTest(String name) { | ||||
| super(name); | super(name); | ||||
| } | } | ||||
| @@ -19,7 +19,6 @@ | |||||
| package org.apache.tools.ant.types.selectors; | package org.apache.tools.ant.types.selectors; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | |||||
| import org.apache.tools.ant.types.Parameter; | import org.apache.tools.ant.types.Parameter; | ||||
| /** | /** | ||||
| @@ -28,8 +27,6 @@ import org.apache.tools.ant.types.Parameter; | |||||
| */ | */ | ||||
| public class FilenameSelectorTest extends BaseSelectorTest { | public class FilenameSelectorTest extends BaseSelectorTest { | ||||
| private Project project; | |||||
| public FilenameSelectorTest(String name) { | public FilenameSelectorTest(String name) { | ||||
| super(name); | super(name); | ||||
| } | } | ||||
| @@ -55,9 +55,6 @@ public class ModifiedSelectorTest extends BaseSelectorTest { | |||||
| // ===================== attributes ===================== | // ===================== attributes ===================== | ||||
| /** Package of the CacheSelector classes. */ | |||||
| private static String pkg = "org.apache.tools.ant.types.selectors.modifiedselector"; | |||||
| /** Path where the testclasses are. */ | /** Path where the testclasses are. */ | ||||
| private Path testclasses = null; | private Path testclasses = null; | ||||
| @@ -459,7 +456,7 @@ public class ModifiedSelectorTest extends BaseSelectorTest { | |||||
| // clear the cache | // clear the cache | ||||
| cache.delete(); | cache.delete(); | ||||
| Iterator it3 = cache.iterator(); | Iterator it3 = cache.iterator(); | ||||
| assertFalse("Cache is not empty", it1.hasNext()); | |||||
| assertFalse("Cache is not empty", it3.hasNext()); | |||||
| } | } | ||||
| @@ -19,7 +19,6 @@ | |||||
| package org.apache.tools.ant.types.selectors; | package org.apache.tools.ant.types.selectors; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | |||||
| import org.apache.tools.ant.types.Mapper; | import org.apache.tools.ant.types.Mapper; | ||||
| import java.io.File; | import java.io.File; | ||||
| @@ -31,8 +30,6 @@ import java.io.File; | |||||
| */ | */ | ||||
| public class PresentSelectorTest extends BaseSelectorTest { | public class PresentSelectorTest extends BaseSelectorTest { | ||||
| private Project project; | |||||
| public PresentSelectorTest(String name) { | public PresentSelectorTest(String name) { | ||||
| super(name); | super(name); | ||||
| } | } | ||||
| @@ -20,7 +20,6 @@ package org.apache.tools.ant.types.selectors; | |||||
| import java.util.Locale; | import java.util.Locale; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Project; | |||||
| import org.apache.tools.ant.types.Parameter; | import org.apache.tools.ant.types.Parameter; | ||||
| /** | /** | ||||
| @@ -29,8 +28,6 @@ import org.apache.tools.ant.types.Parameter; | |||||
| */ | */ | ||||
| public class SizeSelectorTest extends BaseSelectorTest { | public class SizeSelectorTest extends BaseSelectorTest { | ||||
| private Project project; | |||||
| public SizeSelectorTest(String name) { | public SizeSelectorTest(String name) { | ||||
| super(name); | super(name); | ||||
| } | } | ||||
| @@ -125,15 +125,13 @@ public class LineOrientedOutputStreamTest extends TestCase { | |||||
| private class DummyStream extends LineOrientedOutputStream { | private class DummyStream extends LineOrientedOutputStream { | ||||
| private boolean invoked; | private boolean invoked; | ||||
| protected void processLine(String line) { | protected void processLine(String line) { | ||||
| LineOrientedOutputStreamTest.this.assertFalse("Only one line", | |||||
| invoked); | |||||
| LineOrientedOutputStreamTest.this.assertEquals(LINE, line); | |||||
| assertFalse("Only one line", invoked); | |||||
| assertEquals(LINE, line); | |||||
| invoked = true; | invoked = true; | ||||
| } | } | ||||
| private void assertInvoked() { | private void assertInvoked() { | ||||
| LineOrientedOutputStreamTest.this.assertTrue("At least one line", | |||||
| invoked); | |||||
| assertTrue("At least one line", invoked); | |||||
| } | } | ||||
| } | } | ||||
| }// LineOrientedOutputStreamTest | }// LineOrientedOutputStreamTest | ||||
| @@ -18,7 +18,6 @@ | |||||
| package org.apache.tools.zip; | package org.apache.tools.zip; | ||||
| import java.util.Arrays; | |||||
| import junit.framework.TestCase; | import junit.framework.TestCase; | ||||
| /** | /** | ||||
| @@ -108,7 +107,6 @@ public class ExtraFieldUtilsTest extends TestCase implements UnixStat { | |||||
| assertTrue("type field 2", ze[1] instanceof UnparseableExtraFieldData); | assertTrue("type field 2", ze[1] instanceof UnparseableExtraFieldData); | ||||
| assertEquals("data length field 2", 4, | assertEquals("data length field 2", 4, | ||||
| ze[1].getLocalFileDataLength().getValue()); | ze[1].getLocalFileDataLength().getValue()); | ||||
| byte[] expectedData = new byte[4]; | |||||
| for (int i = 0; i < 4; i++) { | for (int i = 0; i < 4; i++) { | ||||
| assertEquals("byte number " + i, | assertEquals("byte number " + i, | ||||
| data2[data.length - 5 + i], | data2[data.length - 5 + i], | ||||
| @@ -21,9 +21,6 @@ package org.apache.tools.zip; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.io.UnsupportedEncodingException; | import java.io.UnsupportedEncodingException; | ||||
| import java.net.URI; | |||||
| import java.net.URISyntaxException; | |||||
| import java.net.URL; | |||||
| import java.nio.ByteBuffer; | import java.nio.ByteBuffer; | ||||
| import java.util.Enumeration; | import java.util.Enumeration; | ||||
| import java.util.zip.CRC32; | import java.util.zip.CRC32; | ||||