Browse Source

Removed unused local variables.

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-ffa450edef68
master
Jacobus Martinus Kruithof 20 years ago
parent
commit
c5a01d909c
13 changed files with 20 additions and 47 deletions
  1. +0
    -8
      src/main/org/apache/tools/ant/IntrospectionHelper.java
  2. +0
    -1
      src/main/org/apache/tools/ant/helper/ProjectHelper2.java
  3. +4
    -5
      src/main/org/apache/tools/ant/taskdefs/Available.java
  4. +4
    -1
      src/main/org/apache/tools/ant/taskdefs/Concat.java
  5. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
  6. +1
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCMklbtype.java
  7. +1
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCRmtype.java
  8. +4
    -13
      src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJBuildInfo.java
  9. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
  10. +0
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java
  11. +1
    -2
      src/main/org/apache/tools/ant/taskdefs/repository/HttpRepository.java
  12. +2
    -3
      src/main/org/apache/tools/ant/types/selectors/modifiedselector/DigestAlgorithm.java
  13. +0
    -6
      src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java

+ 0
- 8
src/main/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -1137,7 +1137,6 @@ public final class IntrospectionHelper implements BuildListener {
"Not allowed to use the polymorphic form"
+ " for this element");
}
Class elementClass = nestedCreator.getElementClass();
ComponentHelper helper =
ComponentHelper.getComponentHelper(project);
nestedObject = helper.createComponent(polyType);
@@ -1221,9 +1220,6 @@ public final class IntrospectionHelper implements BuildListener {
boolean isPolyMorphic() {
return false;
}
Class getElementClass() {
return null;
}
Object getRealObject() {
return null;
}
@@ -1269,10 +1265,6 @@ public final class IntrospectionHelper implements BuildListener {
return true;
}

Class getElementClass() {
return constructor.getDeclaringClass();
}

Object create(Project project, Object parent, Object child)
throws InvocationTargetException,
IllegalAccessException, InstantiationException {


+ 0
- 1
src/main/org/apache/tools/ant/helper/ProjectHelper2.java View File

@@ -590,7 +590,6 @@ public class ProjectHelper2 extends ProjectHelper {
Attributes attrs,
AntXMLContext context)
throws SAXParseException {
String id = null;
String baseDir = null;
boolean nameAttributeSet = false;



+ 4
- 5
src/main/org/apache/tools/ant/taskdefs/Available.java View File

@@ -414,14 +414,13 @@ public class Available extends Task implements Condition {
*/
private boolean checkClass(String classname) {
try {
Class requiredClass = null;
if (ignoreSystemclasses) {
loader = getProject().createClassLoader(classpath);
loader.setParentFirst(false);
loader.addJavaLibraries();
if (loader != null) {
try {
requiredClass = loader.findClass(classname);
loader.findClass(classname);
} catch (SecurityException se) {
// class found but restricted name; this is
// actually the case we're looking for in JDK 1.3+,
@@ -432,15 +431,15 @@ public class Available extends Task implements Condition {
return false;
}
} else if (loader != null) {
requiredClass = loader.loadClass(classname);
loader.loadClass(classname);
} else {
ClassLoader l = this.getClass().getClassLoader();
// Can return null to represent the bootstrap class loader.
// see API docs of Class.getClassLoader.
if (l != null) {
requiredClass = Class.forName(classname, true, l);
Class.forName(classname, true, l);
} else {
requiredClass = Class.forName(classname);
Class.forName(classname);
}
}
return true;


+ 4
- 1
src/main/org/apache/tools/ant/taskdefs/Concat.java View File

@@ -431,6 +431,10 @@ public class Concat extends Task {
if (!outofdate) {
for (Iterator i = existRc.iterator(); !outofdate && i.hasNext();) {
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) {
@@ -473,7 +477,6 @@ public class Concat extends Task {
+ " resources to " + destinationFile);
FileOutputStream out = null;
InputStream in = null;
byte[] buffer = new byte[BUFFER_SIZE];
try {
try {
out = new FileOutputStream(destinationFile);


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/MacroInstance.java View File

@@ -169,7 +169,7 @@ public class MacroInstance extends Task implements DynamicAttribute, TaskContain
}
StringBuffer ret = new StringBuffer();
StringBuffer macroName = null;
boolean inMacro = false;
int state = STATE_NORMAL;
for (int i = 0; i < s.length(); ++i) {
char ch = s.charAt(i);


+ 1
- 2
src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCMklbtype.java View File

@@ -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");
* 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 {
Commandline commandLine = new Commandline();
Project aProj = getProject();
int result = 0;

// Check for required attributes


+ 1
- 2
src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCRmtype.java View File

@@ -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");
* 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 {
Commandline commandLine = new Commandline();
Project aProj = getProject();
int result = 0;

// Check for required attributes


+ 4
- 13
src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJBuildInfo.java View File

@@ -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");
* 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
*/
public void executeProject(BuildListener logger) {
Throwable error;
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();
}

/**


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java View File

@@ -893,7 +893,7 @@ public class FTP
public boolean isTraverseSymlinks() throws IOException, BuildException {
if (!relativePathCalculated) {
// getRelativePath also finds about symlinks
String relpath = getRelativePath();
getRelativePath();
}
return traversesSymlinks;
}
@@ -2451,7 +2451,7 @@ public class FTP
*/
public long getMilliseconds(int action) {
String granularityU = getValue().toUpperCase(Locale.US);
long granularity = 0L;
if ("".equals(granularityU)) {
if (action == SEND_FILES) {
return GRANULARITY_MINUTE;


+ 0
- 1
src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java View File

@@ -140,7 +140,6 @@ public class ScpFromMessage extends AbstractSshMessage {
InputStream in) throws IOException {
int start = 0;
int end = serverResponse.indexOf(" ", start + 1);
String command = serverResponse.substring(start, end);
start = end + 1;
end = serverResponse.indexOf(" ", start + 1);
int filesize = Integer.parseInt(serverResponse.substring(start, end));


+ 1
- 2
src/main/org/apache/tools/ant/taskdefs/repository/HttpRepository.java View File

@@ -169,8 +169,7 @@ public abstract class HttpRepository extends Repository {

try {
//validate the URL
URL repository;
repository = new URL(url);
new URL(url);
} catch (MalformedURLException e) {
throw new BuildException(e);
}


+ 2
- 3
src/main/org/apache/tools/ant/types/selectors/modifiedselector/DigestAlgorithm.java View File

@@ -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");
* 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.FileInputStream;
import java.io.FileOutputStream;
import java.security.DigestInputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@@ -154,7 +153,7 @@ public class DigestAlgorithm implements Algorithm {
return null;
}
FileInputStream fis = null;
FileOutputStream fos = null;
byte[] buf = new byte[readBufferSize];
try {
messageDigest.reset();


+ 0
- 6
src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java View File

@@ -393,12 +393,6 @@ public class ModifiedSelector extends BaseExtendSelector implements BuildListene
}
configParameter = new Vector();

//
// ----- Instantiate the interfaces -----
//
String className = null;
String pkg = "org.apache.tools.ant.types.selectors.modifiedselector";

// specify the algorithm classname
if (algoName != null) {
// use Algorithm defined via name


Loading…
Cancel
Save