I think there is an error in ConCat, see added comment. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@278420 13f79535-47bb-0310-9956-ffa450edef68master
@@ -1137,7 +1137,6 @@ public final class IntrospectionHelper implements BuildListener { | |||||
"Not allowed to use the polymorphic form" | "Not allowed to use the polymorphic form" | ||||
+ " for this element"); | + " for this element"); | ||||
} | } | ||||
Class elementClass = nestedCreator.getElementClass(); | |||||
ComponentHelper helper = | ComponentHelper helper = | ||||
ComponentHelper.getComponentHelper(project); | ComponentHelper.getComponentHelper(project); | ||||
nestedObject = helper.createComponent(polyType); | nestedObject = helper.createComponent(polyType); | ||||
@@ -1221,9 +1220,6 @@ public final class IntrospectionHelper implements BuildListener { | |||||
boolean isPolyMorphic() { | boolean isPolyMorphic() { | ||||
return false; | return false; | ||||
} | } | ||||
Class getElementClass() { | |||||
return null; | |||||
} | |||||
Object getRealObject() { | Object getRealObject() { | ||||
return null; | return null; | ||||
} | } | ||||
@@ -1269,10 +1265,6 @@ public final class IntrospectionHelper implements BuildListener { | |||||
return true; | return true; | ||||
} | } | ||||
Class getElementClass() { | |||||
return constructor.getDeclaringClass(); | |||||
} | |||||
Object create(Project project, Object parent, Object child) | Object create(Project project, Object parent, Object child) | ||||
throws InvocationTargetException, | throws InvocationTargetException, | ||||
IllegalAccessException, InstantiationException { | IllegalAccessException, InstantiationException { | ||||
@@ -590,7 +590,6 @@ public class ProjectHelper2 extends ProjectHelper { | |||||
Attributes attrs, | Attributes attrs, | ||||
AntXMLContext context) | AntXMLContext context) | ||||
throws SAXParseException { | throws SAXParseException { | ||||
String id = null; | |||||
String baseDir = null; | String baseDir = null; | ||||
boolean nameAttributeSet = false; | boolean nameAttributeSet = false; | ||||
@@ -414,14 +414,13 @@ public class Available extends Task implements Condition { | |||||
*/ | */ | ||||
private boolean checkClass(String classname) { | private boolean checkClass(String classname) { | ||||
try { | try { | ||||
Class requiredClass = null; | |||||
if (ignoreSystemclasses) { | if (ignoreSystemclasses) { | ||||
loader = getProject().createClassLoader(classpath); | loader = getProject().createClassLoader(classpath); | ||||
loader.setParentFirst(false); | loader.setParentFirst(false); | ||||
loader.addJavaLibraries(); | loader.addJavaLibraries(); | ||||
if (loader != null) { | if (loader != null) { | ||||
try { | try { | ||||
requiredClass = loader.findClass(classname); | |||||
loader.findClass(classname); | |||||
} catch (SecurityException se) { | } catch (SecurityException se) { | ||||
// class found but restricted name; this is | // class found but restricted name; this is | ||||
// actually the case we're looking for in JDK 1.3+, | // actually the case we're looking for in JDK 1.3+, | ||||
@@ -432,15 +431,15 @@ public class Available extends Task implements Condition { | |||||
return false; | return false; | ||||
} | } | ||||
} else if (loader != null) { | } else if (loader != null) { | ||||
requiredClass = loader.loadClass(classname); | |||||
loader.loadClass(classname); | |||||
} else { | } else { | ||||
ClassLoader l = this.getClass().getClassLoader(); | ClassLoader l = this.getClass().getClassLoader(); | ||||
// Can return null to represent the bootstrap class loader. | // Can return null to represent the bootstrap class loader. | ||||
// see API docs of Class.getClassLoader. | // see API docs of Class.getClassLoader. | ||||
if (l != null) { | if (l != null) { | ||||
requiredClass = Class.forName(classname, true, l); | |||||
Class.forName(classname, true, l); | |||||
} else { | } else { | ||||
requiredClass = Class.forName(classname); | |||||
Class.forName(classname); | |||||
} | } | ||||
} | } | ||||
return true; | return true; | ||||
@@ -431,6 +431,10 @@ public class Concat extends Task { | |||||
if (!outofdate) { | if (!outofdate) { | ||||
for (Iterator i = existRc.iterator(); !outofdate && i.hasNext();) { | for (Iterator i = existRc.iterator(); !outofdate && i.hasNext();) { | ||||
Resource r = (Resource) i.next(); | Resource r = (Resource) i.next(); | ||||
//TODO jkf, Seems the following code, or code like the | |||||
//following code is missing, can someone confirm? | |||||
//outofdate = (r.getLastModified()==0L || | |||||
// r.getLastModified() > destinationFile.lastModified()) | |||||
} | } | ||||
} | } | ||||
if (!outofdate) { | if (!outofdate) { | ||||
@@ -473,7 +477,6 @@ public class Concat extends Task { | |||||
+ " resources to " + destinationFile); | + " resources to " + destinationFile); | ||||
FileOutputStream out = null; | FileOutputStream out = null; | ||||
InputStream in = null; | InputStream in = null; | ||||
byte[] buffer = new byte[BUFFER_SIZE]; | |||||
try { | try { | ||||
try { | try { | ||||
out = new FileOutputStream(destinationFile); | out = new FileOutputStream(destinationFile); | ||||
@@ -169,7 +169,7 @@ public class MacroInstance extends Task implements DynamicAttribute, TaskContain | |||||
} | } | ||||
StringBuffer ret = new StringBuffer(); | StringBuffer ret = new StringBuffer(); | ||||
StringBuffer macroName = null; | StringBuffer macroName = null; | ||||
boolean inMacro = false; | |||||
int state = STATE_NORMAL; | int state = STATE_NORMAL; | ||||
for (int i = 0; i < s.length(); ++i) { | for (int i = 0; i < s.length(); ++i) { | ||||
char ch = s.charAt(i); | char ch = s.charAt(i); | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
* Copyright 2003-2004 The Apache Software Foundation | |||||
* Copyright 2003-2005 The Apache Software Foundation | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -112,7 +112,6 @@ public class CCMklbtype extends ClearCase { | |||||
*/ | */ | ||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
Commandline commandLine = new Commandline(); | Commandline commandLine = new Commandline(); | ||||
Project aProj = getProject(); | |||||
int result = 0; | int result = 0; | ||||
// Check for required attributes | // Check for required attributes | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
* Copyright 2003-2004 The Apache Software Foundation | |||||
* Copyright 2003-2005 The Apache Software Foundation | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -102,7 +102,6 @@ public class CCRmtype extends ClearCase { | |||||
*/ | */ | ||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
Commandline commandLine = new Commandline(); | Commandline commandLine = new Commandline(); | ||||
Project aProj = getProject(); | |||||
int result = 0; | int result = 0; | ||||
// Check for required attributes | // Check for required attributes | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
* Copyright 2001-2002,2004 The Apache Software Foundation | |||||
* Copyright 2001-2002,2004-2005 The Apache Software Foundation | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -432,19 +432,10 @@ class VAJBuildInfo implements Runnable { | |||||
* @param listener BuildListener for the output of the build | * @param listener BuildListener for the output of the build | ||||
*/ | */ | ||||
public void executeProject(BuildListener logger) { | public void executeProject(BuildListener logger) { | ||||
Throwable error; | |||||
projectLogger = logger; | projectLogger = logger; | ||||
try { | |||||
buildThread = new Thread(this); | |||||
buildThread.setPriority(Thread.MIN_PRIORITY); | |||||
buildThread.start(); | |||||
} catch (RuntimeException exc) { | |||||
error = exc; | |||||
throw exc; | |||||
} catch (Error err) { | |||||
error = err; | |||||
throw err; | |||||
} | |||||
buildThread = new Thread(this); | |||||
buildThread.setPriority(Thread.MIN_PRIORITY); | |||||
buildThread.start(); | |||||
} | } | ||||
/** | /** | ||||
@@ -893,7 +893,7 @@ public class FTP | |||||
public boolean isTraverseSymlinks() throws IOException, BuildException { | public boolean isTraverseSymlinks() throws IOException, BuildException { | ||||
if (!relativePathCalculated) { | if (!relativePathCalculated) { | ||||
// getRelativePath also finds about symlinks | // getRelativePath also finds about symlinks | ||||
String relpath = getRelativePath(); | |||||
getRelativePath(); | |||||
} | } | ||||
return traversesSymlinks; | return traversesSymlinks; | ||||
} | } | ||||
@@ -2451,7 +2451,7 @@ public class FTP | |||||
*/ | */ | ||||
public long getMilliseconds(int action) { | public long getMilliseconds(int action) { | ||||
String granularityU = getValue().toUpperCase(Locale.US); | String granularityU = getValue().toUpperCase(Locale.US); | ||||
long granularity = 0L; | |||||
if ("".equals(granularityU)) { | if ("".equals(granularityU)) { | ||||
if (action == SEND_FILES) { | if (action == SEND_FILES) { | ||||
return GRANULARITY_MINUTE; | return GRANULARITY_MINUTE; | ||||
@@ -140,7 +140,6 @@ public class ScpFromMessage extends AbstractSshMessage { | |||||
InputStream in) throws IOException { | InputStream in) throws IOException { | ||||
int start = 0; | int start = 0; | ||||
int end = serverResponse.indexOf(" ", start + 1); | int end = serverResponse.indexOf(" ", start + 1); | ||||
String command = serverResponse.substring(start, end); | |||||
start = end + 1; | start = end + 1; | ||||
end = serverResponse.indexOf(" ", start + 1); | end = serverResponse.indexOf(" ", start + 1); | ||||
int filesize = Integer.parseInt(serverResponse.substring(start, end)); | int filesize = Integer.parseInt(serverResponse.substring(start, end)); | ||||
@@ -169,8 +169,7 @@ public abstract class HttpRepository extends Repository { | |||||
try { | try { | ||||
//validate the URL | //validate the URL | ||||
URL repository; | |||||
repository = new URL(url); | |||||
new URL(url); | |||||
} catch (MalformedURLException e) { | } catch (MalformedURLException e) { | ||||
throw new BuildException(e); | throw new BuildException(e); | ||||
} | } | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
* Copyright 2003-2004 The Apache Software Foundation | |||||
* Copyright 2003-2005 The Apache Software Foundation | |||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -20,7 +20,6 @@ package org.apache.tools.ant.types.selectors.modifiedselector; | |||||
import java.io.File; | import java.io.File; | ||||
import java.io.FileInputStream; | import java.io.FileInputStream; | ||||
import java.io.FileOutputStream; | |||||
import java.security.DigestInputStream; | import java.security.DigestInputStream; | ||||
import java.security.MessageDigest; | import java.security.MessageDigest; | ||||
import java.security.NoSuchAlgorithmException; | import java.security.NoSuchAlgorithmException; | ||||
@@ -154,7 +153,7 @@ public class DigestAlgorithm implements Algorithm { | |||||
return null; | return null; | ||||
} | } | ||||
FileInputStream fis = null; | FileInputStream fis = null; | ||||
FileOutputStream fos = null; | |||||
byte[] buf = new byte[readBufferSize]; | byte[] buf = new byte[readBufferSize]; | ||||
try { | try { | ||||
messageDigest.reset(); | messageDigest.reset(); | ||||
@@ -393,12 +393,6 @@ public class ModifiedSelector extends BaseExtendSelector implements BuildListene | |||||
} | } | ||||
configParameter = new Vector(); | configParameter = new Vector(); | ||||
// | |||||
// ----- Instantiate the interfaces ----- | |||||
// | |||||
String className = null; | |||||
String pkg = "org.apache.tools.ant.types.selectors.modifiedselector"; | |||||
// specify the algorithm classname | // specify the algorithm classname | ||||
if (algoName != null) { | if (algoName != null) { | ||||
// use Algorithm defined via name | // use Algorithm defined via name | ||||