Author: peterreilly
Date: Sat Jan 26 06:22:48 2008
New Revision: 615452
URL: http://svn.apache.org/viewvc?rev=615452&view=rev
Log:
checkstyle
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/AbstractClasspathResource.java
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaResource.java
ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java?rev=615452&r1=615451&r2=615452&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java Sat Jan
26 06:22:48 2008
@@ -86,7 +86,7 @@
private static final String FIXCRLF_ERROR = "<fixcrlf> error: ";
/** error string for using srcdir and file */
public static final String ERROR_FILE_AND_SRCDIR
- =FIXCRLF_ERROR+"srcdir and file are mutually exclusive";
+ = FIXCRLF_ERROR + "srcdir and file are mutually exclusive";
private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
@@ -314,20 +314,27 @@
srcDir = file.getParentFile();
}
if (srcDir == null) {
- throw new BuildException(FIXCRLF_ERROR +"srcdir attribute must be
set!");
+ throw new BuildException(
+ FIXCRLF_ERROR + "srcdir attribute must be set!");
}
if (!srcDir.exists()) {
- throw new BuildException(FIXCRLF_ERROR +"srcdir does not exist:
'"+srcDir+"'");
+ throw new BuildException(
+ FIXCRLF_ERROR + "srcdir does not exist: '" + srcDir + "'");
}
if (!srcDir.isDirectory()) {
- throw new BuildException(FIXCRLF_ERROR +"srcdir is not a
directory: '"+srcDir+"'");
+ throw new BuildException(
+ FIXCRLF_ERROR + "srcdir is not a directory: '" + srcDir + "'");
}
if (destDir != null) {
if (!destDir.exists()) {
- throw new BuildException(FIXCRLF_ERROR +"destdir does not
exist: '" + destDir + "'");
+ throw new BuildException(
+ FIXCRLF_ERROR + "destdir does not exist: '"
+ + destDir + "'");
}
if (!destDir.isDirectory()) {
- throw new BuildException(FIXCRLF_ERROR +"destdir is not a
directory: '" + destDir + "'");
+ throw new BuildException(
+ FIXCRLF_ERROR + "destdir is not a directory: '"
+ + destDir + "'");
}
}
}
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java?rev=615452&r1=615451&r2=615452&view=diff
==============================================================================
---
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java
(original)
+++
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java
Sat Jan 26 06:22:48 2008
@@ -165,7 +165,9 @@
/** [EMAIL PROTECTED] */
public static final String SKIPPING_TESTS
= "Condition failed -skipping tests";
+ /** Application exception */
public static final String APPLICATION_EXCEPTION = "Application Exception";
+ /** Teardown exception */
public static final String TEARDOWN_EXCEPTION = "Teardown Exception";
/**
@@ -533,7 +535,7 @@
* @param thrown what was thrown
*/
protected void ignoringThrowable(String type, Throwable thrown) {
- log(type + ": "+ thrown.toString(),
+ log(type + ": " + thrown.toString(),
thrown,
Project.MSG_WARN);
}
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java?rev=615452&r1=615451&r2=615452&view=diff
==============================================================================
---
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
(original)
+++
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
Sat Jan 26 06:22:48 2008
@@ -502,7 +502,7 @@
try {
Execute.runCommand(this, cmd);
} catch (BuildException failedToExecute) {
- if(failonerror) {
+ if (failonerror) {
throw failedToExecute;
} else {
//log at the info level, and keep going.
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/AbstractClasspathResource.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/AbstractClasspathResource.java?rev=615452&r1=615451&r2=615452&view=diff
==============================================================================
---
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/AbstractClasspathResource.java
(original)
+++
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/AbstractClasspathResource.java
Sat Jan 26 06:22:48 2008
@@ -1,9 +1,10 @@
/*
- * Copyright 2007 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.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -33,8 +34,8 @@
*/
public abstract class AbstractClasspathResource extends Resource {
- protected Path classpath;
- protected Reference loader;
+ private Path classpath;
+ private Reference loader;
/**
* Set the classpath to use when looking up a resource.
@@ -78,6 +79,14 @@
public Path getClasspath() {
return isReference()
? ((JavaResource) getCheckedRef()).getClasspath() : classpath;
+ }
+
+ /**
+ * Get the loader.
+ * @return the loader.
+ */
+ public Reference getLoader() {
+ return loader;
}
/**
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java?rev=615452&r1=615451&r2=615452&view=diff
==============================================================================
---
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java
(original)
+++
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java
Sat Jan 26 06:22:48 2008
@@ -1,9 +1,10 @@
/*
- * Copyright 2008 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.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -47,14 +48,18 @@
String classname = constant.substring(0, index);
String fieldname = constant.substring(index + 1, constant.length());
try {
- clazz =
cl!=null?Class.forName(classname,true,cl):Class.forName(classname);
+ clazz =
+ cl != null
+ ? Class.forName(classname, true, cl)
+ : Class.forName(classname);
Field field = clazz.getField(fieldname);
- String value=field.get(null).toString();
+ String value = field.get(null).toString();
return new ByteArrayInputStream(value.getBytes("UTF-8"));
} catch (ClassNotFoundException e) {
- throw new IOException("Class not found:"+ classname);
+ throw new IOException("Class not found:" + classname);
} catch (NoSuchFieldException e) {
- throw new IOException("Field not found:" + fieldname+ " in
"+classname);
+ throw new IOException(
+ "Field not found:" + fieldname + " in " + classname);
} catch (IllegalAccessException e) {
throw new IOException("Illegal access to :" + fieldname + " in " +
classname);
} catch (NullPointerException npe) {
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaResource.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaResource.java?rev=615452&r1=615451&r2=615452&view=diff
==============================================================================
---
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaResource.java
(original)
+++
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaResource.java
Sat Jan 26 06:22:48 2008
@@ -20,10 +20,7 @@
import java.io.IOException;
import java.io.InputStream;
-import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.Resource;
-import org.apache.tools.ant.types.Reference;
/**
* A Resource representation of something loadable via a Java classloader.
@@ -46,7 +43,7 @@
*/
public JavaResource(String name, Path path) {
setName(name);
- classpath = path;
+ setClasspath(path);
}
/**
@@ -76,14 +73,15 @@
if (!getName().equals(otherjr.getName())) {
return getName().compareTo(otherjr.getName());
}
- if (loader != otherjr.loader) {
- if (loader == null) {
+ if (getLoader() != otherjr.getLoader()) {
+ if (getLoader() == null) {
return -1;
}
- if (otherjr.loader == null) {
+ if (otherjr.getLoader() == null) {
return 1;
}
- return loader.getRefId().compareTo(otherjr.loader.getRefId());
+ return getLoader().getRefId()
+ .compareTo(otherjr.getLoader().getRefId());
}
Path p = getClasspath();
Path op = otherjr.getClasspath();
Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java?rev=615452&r1=615451&r2=615452&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java Sat Jan 26
06:22:48 2008
@@ -786,7 +786,7 @@
/**
* Create a File object for a temporary file in a given directory. Without
* actually creating the file.
- *
+ *
* <p>
* The file denoted by the returned abstract pathname did not exist before
* this method was invoked, any subsequent invocation of this method will
@@ -795,7 +795,7 @@
* <p>
* The filename is prefixNNNNNsuffix where NNNN is a random number.
* </p>
- *
+ *
* @param prefix
* prefix before the random number.
* @param suffix
@@ -803,8 +803,8 @@
* @param parentDir
* Directory to create the temporary file in; java.io.tmpdir
used
* if not specified.
- *
- * @deprecated since ant 1.7.1 use createTempFile(String, String, File,
+ *
+ * @deprecated since ant 1.7.1 use createTempFile(String, String, File,
* boolean, boolean) instead.
* @return a File reference to the new, nonexistent temporary file.
*/
@@ -836,7 +836,7 @@
public File createTempFile(String prefix, String suffix, File parentDir,
boolean deleteOnExit, boolean createFile) {
File result = null;
- String parent = (parentDir == null)
+ String parent = (parentDir == null)
? System.getProperty("java.io.tmpdir")
: parentDir.getPath();
@@ -866,7 +866,7 @@
/**
* Create a File object for a temporary file in a given directory. Without
* actually creating the file.
- *
+ *
* <p>
* The file denoted by the returned abstract pathname did not exist before
* this method was invoked, any subsequent invocation of this method will
@@ -875,7 +875,7 @@
* <p>
* The filename is prefixNNNNNsuffix where NNNN is a random number.
* </p>
- *
+ *
* @param prefix
* prefix before the random number.
* @param suffix
@@ -885,8 +885,8 @@
* if not specified.
* @param deleteOnExit
* whether to set the tempfile for deletion on normal VM exit.
- *
- * @deprecated since ant 1.7.1 use createTempFile(String, String, File,
+ *
+ * @deprecated since ant 1.7.1 use createTempFile(String, String, File,
* boolean, boolean) instead.
* @return a File reference to the new, nonexistent temporary file.
*/