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 // is the same
ClassLoader oldLoader = other.getClassLoader(); ClassLoader oldLoader = other.getClassLoader();
ClassLoader newLoader = this.getClassLoader(); ClassLoader newLoader = this.getClassLoader();
if (oldLoader != null
&& newLoader != null
return
newLoader != null
&& oldLoader != null
&& oldLoader instanceof AntClassLoader && oldLoader instanceof AntClassLoader
&& newLoader instanceof AntClassLoader && newLoader instanceof AntClassLoader
&& ((AntClassLoader) oldLoader).getClasspath() && ((AntClassLoader) oldLoader).getClasspath()
.equals(((AntClassLoader) newLoader).getClasspath())
) {
return true;
} else {
return false;
}
.equals(((AntClassLoader) newLoader).getClasspath());
} }


private String extractClassname(Class c) { 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; private boolean followSymlinks = true;


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


/** /**
@@ -310,6 +309,7 @@ public final class IntrospectionHelper implements BuildListener {
throws InvocationTargetException, throws InvocationTargetException,
IllegalAccessException, InstantiationException { IllegalAccessException, InstantiationException {
if (child != null) { if (child != null) {
// Empty
} else if (c.getParameterTypes().length == 0) { } else if (c.getParameterTypes().length == 0) {
child = c.newInstance(new Object[] {}); child = c.newInstance(new Object[] {});
} else { } else {
@@ -925,8 +925,8 @@ public final class IntrospectionHelper implements BuildListener {
public void set(Project p, Object parent, String value) public void set(Project p, Object parent, String value)
throws InvocationTargetException, IllegalAccessException { throws InvocationTargetException, IllegalAccessException {
m.invoke(parent, 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) { if (index == -1) {
return componentName; 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? * 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 * @return true if the target does depend on the named target
* @since Ant 1.6 * @since Ant 1.6
*/ */


Loading…
Cancel
Save