Browse Source

stylecheck

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276239 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
72621f7207
5 changed files with 17 additions and 20 deletions
  1. +4
    -8
      src/main/org/apache/tools/ant/AntTypeDefinition.java
  2. +8
    -8
      src/main/org/apache/tools/ant/DirectoryScanner.java
  3. +3
    -3
      src/main/org/apache/tools/ant/IntrospectionHelper.java
  4. +1
    -1
      src/main/org/apache/tools/ant/ProjectHelper.java
  5. +1
    -0
      src/main/org/apache/tools/ant/Target.java

+ 4
- 8
src/main/org/apache/tools/ant/AntTypeDefinition.java View File

@@ -352,17 +352,13 @@ public class AntTypeDefinition {
// is the same
ClassLoader oldLoader = other.getClassLoader();
ClassLoader newLoader = this.getClassLoader();
if (oldLoader != null
&& newLoader != null
return
newLoader != null
&& oldLoader != null
&& oldLoader instanceof AntClassLoader
&& newLoader instanceof AntClassLoader
&& ((AntClassLoader) oldLoader).getClasspath()
.equals(((AntClassLoader) newLoader).getClasspath())
) {
return true;
} else {
return false;
}
.equals(((AntClassLoader) newLoader).getClasspath());
}

private String extractClassname(Class c) {


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

@@ -241,7 +241,7 @@ public class DirectoryScanner
private boolean followSymlinks = true;

/** Helper. */
private static final FileUtils fileUtils = FileUtils.newFileUtils();
private static final FileUtils FILE_UTILS = FileUtils.newFileUtils();

/** Whether or not everything tested so far has been included. */
protected boolean everythingIncluded = true;
@@ -684,14 +684,14 @@ public class DirectoryScanner
// we need to double check.
try {
File canonFile = myfile.getCanonicalFile();
String path = fileUtils.removeLeadingPath(canonBase,
String path = FILE_UTILS.removeLeadingPath(canonBase,
canonFile);
if (!path.equals(currentelement) || ON_VMS) {
myfile = findFile(basedir, currentelement);
if (myfile != null) {
currentelement =
fileUtils.removeLeadingPath(basedir,
myfile);
FILE_UTILS.removeLeadingPath(basedir,
myfile);
}
}
} catch (IOException ex) {
@@ -704,7 +704,7 @@ public class DirectoryScanner
if (f.exists()) {
// adapt currentelement to the case we've
// actually found
currentelement = fileUtils.removeLeadingPath(basedir,
currentelement = FILE_UTILS.removeLeadingPath(basedir,
f);
myfile = f;
}
@@ -833,7 +833,7 @@ public class DirectoryScanner
Vector noLinks = new Vector();
for (int i = 0; i < newfiles.length; i++) {
try {
if (fileUtils.isSymbolicLink(dir, newfiles[i])) {
if (FILE_UTILS.isSymbolicLink(dir, newfiles[i])) {
String name = vpath + newfiles[i];
File file = new File(dir, newfiles[i]);
if (file.isDirectory()) {
@@ -1201,7 +1201,7 @@ public class DirectoryScanner
* @since Ant 1.5.2
*/
public Resource getResource(String name) {
File f = fileUtils.resolveFile(basedir, name);
File f = FILE_UTILS.resolveFile(basedir, name);
return new Resource(name, f.exists(), f.lastModified(),
f.isDirectory());
}
@@ -1346,7 +1346,7 @@ public class DirectoryScanner
if (pathElements.size() > 0) {
String current = (String) pathElements.remove(0);
try {
if (fileUtils.isSymbolicLink(base, current)) {
if (FILE_UTILS.isSymbolicLink(base, current)) {
return true;
} else {
base = new File(base, current);


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

@@ -27,7 +27,6 @@ import java.util.Hashtable;
import java.util.List;
import java.util.Locale;
import org.apache.tools.ant.types.EnumeratedAttribute;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.taskdefs.PreSetDef;

/**
@@ -310,6 +309,7 @@ public final class IntrospectionHelper implements BuildListener {
throws InvocationTargetException,
IllegalAccessException, InstantiationException {
if (child != null) {
// Empty
} else if (c.getParameterTypes().length == 0) {
child = c.newInstance(new Object[] {});
} else {
@@ -925,8 +925,8 @@ public final class IntrospectionHelper implements BuildListener {
public void set(Project p, Object parent, String value)
throws InvocationTargetException, IllegalAccessException {
m.invoke(parent,
new Boolean[] {
new Boolean(Project.toBoolean(value))});
new Boolean[] {Project.toBoolean(value)
? Boolean.TRUE : Boolean.FALSE});
}

};


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

@@ -508,7 +508,7 @@ public class ProjectHelper {
if (index == -1) {
return componentName;
}
return componentName.substring(index+1);
return componentName.substring(index + 1);
}

/**


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

@@ -194,6 +194,7 @@ public class Target implements TaskContainer {

/**
* Does this target depend on the named target?
* @param other the other named target.
* @return true if the target does depend on the named target
* @since Ant 1.6
*/


Loading…
Cancel
Save