diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java index cf77d32ca..3d7af1f02 100644 --- a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java +++ b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java @@ -527,8 +527,8 @@ public class ProjectHelper2 extends ProjectHelper { String dup = project.getProperty(antFileProp); if (dup != null && nameAttributeSet) { File dupFile = new File(dup); - if (context.isIgnoringProjectTag() && - !dupFile.equals(context.getBuildFile())) { + if (context.isIgnoringProjectTag() + && !dupFile.equals(context.getBuildFile())) { project.log("Duplicated project name in import. Project " + context.getCurrentProjectName() + " defined first in " + dup + " and again in " + context.getBuildFile(), diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java b/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java index 61585ee8c..d3ccb5d79 100644 --- a/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java +++ b/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java @@ -366,7 +366,8 @@ public class ProjectHelperImpl extends ProjectHelper { if (tag.equals("project")) { new ProjectHandler(helperImpl, this).init(tag, attrs); } else { - throw new SAXParseException("Config file is not of expected XML type", helperImpl.locator); + throw new SAXParseException("Config file is not of expected " + + "XML type", helperImpl.locator); } } @@ -462,8 +463,9 @@ public class ProjectHelperImpl extends ProjectHelper { if ((new File(baseDir)).isAbsolute()) { helperImpl.project.setBasedir(baseDir); } else { - helperImpl.project.setBaseDir(helperImpl.project.resolveFile(baseDir, - helperImpl.buildFileParent)); + File resolvedBaseDir = helperImpl.project.resolveFile(baseDir, + helperImpl.buildFileParent); + helperImpl.project.setBaseDir(resolvedBaseDir); } } } @@ -577,7 +579,8 @@ public class ProjectHelperImpl extends ProjectHelper { } else if (key.equals("description")) { description = value; } else { - throw new SAXParseException("Unexpected attribute \"" + key + "\"", helperImpl.locator); + throw new SAXParseException("Unexpected attribute \"" + + key + "\"", helperImpl.locator); } } @@ -731,7 +734,8 @@ public class ProjectHelperImpl extends ProjectHelper { * Must not be null. */ public TaskHandler(ProjectHelperImpl helperImpl, DocumentHandler parentHandler, - TaskContainer container, RuntimeConfigurable parentWrapper, Target target) { + TaskContainer container, + RuntimeConfigurable parentWrapper, Target target) { super(helperImpl, parentHandler); this.container = container; this.parentWrapper = parentWrapper; @@ -975,7 +979,8 @@ public class ProjectHelperImpl extends ProjectHelper { * @param target The parent target of this element. * Must not be null. */ - public DataTypeHandler(ProjectHelperImpl helperImpl, DocumentHandler parentHandler, Target target) { + public DataTypeHandler(ProjectHelperImpl helperImpl, + DocumentHandler parentHandler, Target target) { super(helperImpl, parentHandler); this.target = target; } diff --git a/src/main/org/apache/tools/ant/listener/MailLogger.java b/src/main/org/apache/tools/ant/listener/MailLogger.java index 363711e94..6132ca9bd 100644 --- a/src/main/org/apache/tools/ant/listener/MailLogger.java +++ b/src/main/org/apache/tools/ant/listener/MailLogger.java @@ -135,6 +135,7 @@ public class MailLogger extends DefaultLogger { try { is.close(); } catch (IOException e) { + // ignore } } } @@ -272,9 +273,11 @@ public class MailLogger extends DefaultLogger { * @param subject mail subject * @param message mail body */ - private void sendMimeMail(Project project, String host, int port, String user, String password, boolean ssl, - String from, String replyToString, String toString, - String subject, String message) { + private void sendMimeMail(Project project, String host, int port, + String user, String password, boolean ssl, + String from, String replyToString, + String toString, String subject, + String message) { // convert the replyTo string into a vector of emailaddresses Mailer mailer = null; try { diff --git a/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java b/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java index 64d71a1c2..ec59eb15a 100644 --- a/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java @@ -706,8 +706,8 @@ public abstract class AbstractCvsTask extends Task { * level, AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL. */ public void setCompression(boolean usecomp) { - setCompressionLevel(usecomp ? - AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL : 0); + setCompressionLevel(usecomp + ? AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL : 0); } } diff --git a/src/main/org/apache/tools/ant/taskdefs/Ant.java b/src/main/org/apache/tools/ant/taskdefs/Ant.java index b83f54252..f9f2c7aab 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Ant.java +++ b/src/main/org/apache/tools/ant/taskdefs/Ant.java @@ -373,11 +373,11 @@ public class Ant extends Task { // Are we trying to call the target in which we are defined (or // the build file if this is a top level task)? - if (newProject.getBaseDir().equals(getProject().getBaseDir()) && - newProject.getProperty("ant.file").equals(getProject().getProperty("ant.file")) + if (newProject.getBaseDir().equals(getProject().getBaseDir()) + && newProject.getProperty("ant.file").equals(getProject().getProperty("ant.file")) && getOwningTarget() != null - && (getOwningTarget().getName().equals("") || - getOwningTarget().getName().equals(target))) { + && (getOwningTarget().getName().equals("") + || getOwningTarget().getName().equals(target))) { throw new BuildException("ant task calling its own parent " + "target"); } diff --git a/src/main/org/apache/tools/ant/taskdefs/AntStructure.java b/src/main/org/apache/tools/ant/taskdefs/AntStructure.java index ce38f9ce4..c68c082af 100644 --- a/src/main/org/apache/tools/ant/taskdefs/AntStructure.java +++ b/src/main/org/apache/tools/ant/taskdefs/AntStructure.java @@ -69,6 +69,7 @@ import org.apache.tools.ant.IntrospectionHelper; import org.apache.tools.ant.Task; import org.apache.tools.ant.TaskContainer; import org.apache.tools.ant.types.EnumeratedAttribute; +import org.apache.tools.ant.types.Reference; /** * Creates a partial DTD for Ant from the currently known tasks. @@ -307,12 +308,12 @@ public class AntStructure extends Task { sb.append(lSep).append(" ").append(attrName).append(" "); Class type = ih.getAttributeType(attrName); - if (type.equals(java.lang.Boolean.class) || - type.equals(java.lang.Boolean.TYPE)) { + if (type.equals(java.lang.Boolean.class) + || type.equals(java.lang.Boolean.TYPE)) { sb.append(BOOLEAN).append(" "); - } else if (org.apache.tools.ant.types.Reference.class.isAssignableFrom(type)) { + } else if (Reference.class.isAssignableFrom(type)) { sb.append("IDREF "); - } else if (org.apache.tools.ant.types.EnumeratedAttribute.class.isAssignableFrom(type)) { + } else if (EnumeratedAttribute.class.isAssignableFrom(type)) { try { EnumeratedAttribute ea = (EnumeratedAttribute) type.newInstance(); @@ -363,9 +364,8 @@ public class AntStructure extends Task { for (int i = 0; i < length; i++) { char c = s.charAt(i); // XXX - we are ommitting CombiningChar and Extender here - if (!Character.isLetterOrDigit(c) && - c != '.' && c != '-' && - c != '_' && c != ':') { + if (!Character.isLetterOrDigit(c) + && c != '.' && c != '-' && c != '_' && c != ':') { return false; } } diff --git a/src/main/org/apache/tools/ant/taskdefs/Checksum.java b/src/main/org/apache/tools/ant/taskdefs/Checksum.java index 0c357722f..17301f2d4 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Checksum.java +++ b/src/main/org/apache/tools/ant/taskdefs/Checksum.java @@ -403,8 +403,8 @@ public class Checksum extends MatchingTask implements Condition { if (file.exists()) { if (property == null) { File checksumFile = getChecksumFile(file); - if (forceOverwrite || isCondition || - (file.lastModified() > checksumFile.lastModified())) { + if (forceOverwrite || isCondition + || (file.lastModified() > checksumFile.lastModified())) { includeFileMap.put(file, checksumFile); } else { log(file + " omitted as " + checksumFile + " is up to date.", @@ -413,10 +413,12 @@ public class Checksum extends MatchingTask implements Condition { // Read the checksum from disk. String checksum = null; try { - BufferedReader diskChecksumReader = new BufferedReader(new FileReader(checksumFile)); + BufferedReader diskChecksumReader + = new BufferedReader(new FileReader(checksumFile)); checksum = diskChecksumReader.readLine(); } catch (IOException e) { - throw new BuildException("Couldn't read checksum file " + checksumFile, e); + throw new BuildException("Couldn't read checksum file " + + checksumFile, e); } byte[] digest = decodeHex(checksum.toCharArray()); allDigests.put(file, digest); @@ -486,8 +488,8 @@ public class Checksum extends MatchingTask implements Condition { if (destination instanceof java.lang.String) { String prop = (String) destination; if (isCondition) { - checksumMatches = checksumMatches && - checksum.equals(property); + checksumMatches + = checksumMatches && checksum.equals(property); } else { getProject().setNewProperty(prop, checksum); } @@ -503,8 +505,8 @@ public class Checksum extends MatchingTask implements Condition { fis = null; br.close(); isr.close(); - checksumMatches = checksumMatches && - checksum.equals(suppliedChecksum); + checksumMatches = checksumMatches + && checksum.equals(suppliedChecksum); } else { checksumMatches = false; } diff --git a/src/main/org/apache/tools/ant/taskdefs/Chmod.java b/src/main/org/apache/tools/ant/taskdefs/Chmod.java index 4c7a23af9..cea8e51be 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Chmod.java +++ b/src/main/org/apache/tools/ant/taskdefs/Chmod.java @@ -68,7 +68,8 @@ import org.apache.tools.ant.types.PatternSet; * * @author costin@eng.sun.com * @author Mariusz Nowostawski (Marni) - * mnowostawski@infoscience.otago.ac.nz + * + * mnowostawski@infoscience.otago.ac.nz * @author Stefan Bodewig * * @since Ant 1.1 diff --git a/src/main/org/apache/tools/ant/taskdefs/Copy.java b/src/main/org/apache/tools/ant/taskdefs/Copy.java index 5cd199cae..716e37f81 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Copy.java +++ b/src/main/org/apache/tools/ant/taskdefs/Copy.java @@ -351,9 +351,8 @@ public class Copy extends Task { destFile = new File(destDir, file.getName()); } - if (forceOverwrite || - !destFile.exists() || - (file.lastModified() > destFile.lastModified())) { + if (forceOverwrite || !destFile.exists() + || (file.lastModified() > destFile.lastModified())) { fileCopyMap.put(file.getAbsolutePath(), destFile.getAbsolutePath()); } else { diff --git a/src/main/org/apache/tools/ant/taskdefs/Copydir.java b/src/main/org/apache/tools/ant/taskdefs/Copydir.java index 016f96985..d7ecdb56b 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Copydir.java +++ b/src/main/org/apache/tools/ant/taskdefs/Copydir.java @@ -161,8 +161,8 @@ public class Copydir extends MatchingTask { } else { destFile = new File(to, filename); } - if (forceOverwrite || - (srcFile.lastModified() > destFile.lastModified())) { + if (forceOverwrite + || (srcFile.lastModified() > destFile.lastModified())) { filecopyList.put(srcFile.getAbsolutePath(), destFile.getAbsolutePath()); } diff --git a/src/main/org/apache/tools/ant/taskdefs/DefaultExcludes.java b/src/main/org/apache/tools/ant/taskdefs/DefaultExcludes.java index ed7172caa..4941662ec 100644 --- a/src/main/org/apache/tools/ant/taskdefs/DefaultExcludes.java +++ b/src/main/org/apache/tools/ant/taskdefs/DefaultExcludes.java @@ -117,7 +117,7 @@ public class DefaultExcludes extends Task { /** * Pattern to remove from the default excludes. * - * @param msg Sets the value for the pattern that + * @param remove Sets the value for the pattern that * should nolonger be excluded. */ public void setRemove(String remove) { diff --git a/src/main/org/apache/tools/ant/taskdefs/Delete.java b/src/main/org/apache/tools/ant/taskdefs/Delete.java index 0be01d716..18bd79b10 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Delete.java +++ b/src/main/org/apache/tools/ant/taskdefs/Delete.java @@ -478,8 +478,8 @@ public class Delete extends MatchingTask { } // delete the directory - if (dir != null && dir.exists() && dir.isDirectory() && - !usedMatchingTask) { + if (dir != null && dir.exists() && dir.isDirectory() + && !usedMatchingTask) { /* If verbosity is MSG_VERBOSE, that mean we are doing regular logging (backwards as that sounds). In that diff --git a/src/main/org/apache/tools/ant/taskdefs/DependSet.java b/src/main/org/apache/tools/ant/taskdefs/DependSet.java index 275a516e5..67c167d7f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/DependSet.java +++ b/src/main/org/apache/tools/ant/taskdefs/DependSet.java @@ -208,8 +208,8 @@ public class DependSet extends MatchingTask { Project.MSG_WARN); } - if (oldestTarget == null || - dest.lastModified() < oldestTargetTime) { + if (oldestTarget == null + || dest.lastModified() < oldestTargetTime) { oldestTargetTime = dest.lastModified(); oldestTarget = dest; } @@ -241,8 +241,8 @@ public class DependSet extends MatchingTask { Project.MSG_WARN); } - if (oldestTarget == null || - dest.lastModified() < oldestTargetTime) { + if (oldestTarget == null + || dest.lastModified() < oldestTargetTime) { oldestTargetTime = dest.lastModified(); oldestTarget = dest; } diff --git a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java index b93e428dd..0c55a9886 100644 --- a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java +++ b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java @@ -410,7 +410,7 @@ public class ExecuteOn extends ExecTask { * Construct the command line for parallel execution. * * @param srcFiles The filenames to add to the commandline - * @param baseDir filenames are relative to this dir + * @param baseDirs filenames are relative to this dir */ protected String[] getCommandline(String[] srcFiles, File[] baseDirs) { final char fileSeparator = File.separatorChar; diff --git a/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java b/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java index d9c19da48..5563ee5fa 100644 --- a/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java +++ b/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java @@ -242,7 +242,7 @@ public class FixCRLF extends MatchingTask { /** * Specify how carriage return (CR) characters are to be handled. * - * @param option valid values: + * @param attr valid values: * * - *

Sets classname attribute - so you can't use that attribute if you use this one. + *

Sets classname attribute - so you can't use that + * attribute if you use this one. */ public void setType(TypeAttribute type) { if ("xml".equals(type.getValue())) { @@ -202,8 +205,8 @@ public class FormatterElement { public boolean shouldUse(Task t) { if (ifProperty != null && t.getProject().getProperty(ifProperty) == null) { return false; - } else if (unlessProperty != null && - t.getProject().getProperty(unlessProperty) != null) { + } else if (unlessProperty != null + && t.getProject().getProperty(unlessProperty) != null) { return false; } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java index e13831b7b..80374a422 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java @@ -681,8 +681,7 @@ public class JUnitTask extends Task { // forked test File propsFile = FileUtils.newFileUtils().createTempFile("junit", ".properties", - tmpDir != null ? tmpDir : - getProject().getBaseDir()); + tmpDir != null ? tmpDir : getProject().getBaseDir()); cmd.createArgument().setValue("propsfile=" + propsFile.getAbsolutePath()); Hashtable p = getProject().getProperties(); diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java index 1b8b7de44..c31fa916c 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java @@ -178,8 +178,8 @@ public class JUnitTest extends BaseTest implements Cloneable { public boolean shouldRun(Project p) { if (ifProperty != null && p.getProperty(ifProperty) == null) { return false; - } else if (unlessProperty != null && - p.getProperty(unlessProperty) != null) { + } else if (unlessProperty != null + && p.getProperty(unlessProperty) != null) { return false; } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java index e4a454b84..04cd97ca1 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitVersionHelper.java @@ -108,8 +108,8 @@ public class JUnitVersionHelper { getNameMethod = t.getClass().getMethod("name", new Class [0]); } - if (getNameMethod != null && - getNameMethod.getReturnType() == String.class) { + if (getNameMethod != null + && getNameMethod.getReturnType() == String.class) { return (String) getNameMethod.invoke(t, new Object[0]); } } catch (Throwable e) { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java index 517c9cbf9..a6eb74cdf 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java @@ -278,15 +278,19 @@ public class XMLResultAggregator extends Task implements XMLConstants { addTestSuite(rootElement, elem); } else { // issue a warning. - log("the file " + files[i] + " is not a valid testsuite XML document", Project.MSG_WARN); + log("the file " + files[i] + + " is not a valid testsuite XML document", + Project.MSG_WARN); } } catch (SAXException e) { // a testcase might have failed and write a zero-length document, // It has already failed, but hey.... mm. just put a warning - log("The file " + files[i] + " is not a valid XML document. It is possibly corrupted.", Project.MSG_WARN); + log("The file " + files[i] + " is not a valid XML document. " + + "It is possibly corrupted.", Project.MSG_WARN); log(StringUtils.getStackTrace(e), Project.MSG_DEBUG); } catch (IOException e) { - log("Error while accessing file " + files[i] + ": " + e.getMessage(), Project.MSG_ERR); + log("Error while accessing file " + files[i] + ": " + + e.getMessage(), Project.MSG_ERR); } } return rootElement; diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor.java index c58b7f515..c038abffc 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/XalanExecutor.java @@ -123,7 +123,8 @@ abstract class XalanExecutor { xalan1missing.printStackTrace(new PrintWriter(swr)); caller.task.log("Didn't find Xalan1.", Project.MSG_DEBUG); caller.task.log(swr.toString(), Project.MSG_DEBUG); - throw new BuildException("Could not find xalan2 nor xalan1 in the classpath. Check http://xml.apache.org/xalan-j"); + throw new BuildException("Could not find xalan2 nor xalan1 " + + "in the classpath. Check http://xml.apache.org/xalan-j"); } } String version = getXalanVersion(procVersion); diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java index 520905d1a..88a238fe3 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java @@ -335,7 +335,8 @@ public abstract class AbstractMetamataTask extends Task { DirectoryScanner ds = fs.getDirectoryScanner(getProject()); ds.scan(); String[] f = ds.getIncludedFiles(); - log(i + ") Adding " + f.length + " files from directory " + ds.getBasedir(), Project.MSG_VERBOSE); + log(i + ") Adding " + f.length + " files from directory " + + ds.getBasedir(), Project.MSG_VERBOSE); for (int j = 0; j < f.length; j++) { String pathname = f[j]; if (pathname.endsWith(".java")) { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAudit.java b/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAudit.java index bf7bb2641..b664655b8 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAudit.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAudit.java @@ -68,10 +68,11 @@ import org.apache.tools.ant.types.Path; /** * Invokes the Metamata Audit/ Webgain Quality Analyzer on a set of Java files. *

- * maudit performs static analysis of the Java source code and byte code files to find and report - * errors of style and potential problems related to performance, maintenance and robustness. - * As a convenience, a stylesheet is given in etc directory, so that an HTML report - * can be generated from the XML file. + * maudit performs static analysis of the Java source code and byte + * code files to find and report errors of style and potential problems related + * to performance, maintenance and robustness. As a convenience, a stylesheet + * is given in etc directory, so that an HTML report can be generated + * from the XML file. * * @author Stephane Bailliez */ @@ -310,10 +311,12 @@ public class MAudit extends AbstractMetamataTask { protected void checkOptions() throws BuildException { super.checkOptions(); if (unused && searchPath == null) { - throw new BuildException("'searchpath' element must be set when looking for 'unused' declarations."); + throw new BuildException("'searchpath' element must be set when " + + "looking for 'unused' declarations."); } if (!unused && searchPath != null) { - log("'searchpath' element ignored. 'unused' attribute is disabled.", Project.MSG_WARN); + log("'searchpath' element ignored. 'unused' attribute is disabled.", + Project.MSG_WARN); } if (rulesPath != null) { cmdl.createClasspath(getProject()).addExisting(rulesPath); diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAuditStreamHandler.java b/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAuditStreamHandler.java index ccb95dd58..df197f867 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAuditStreamHandler.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MAuditStreamHandler.java @@ -167,18 +167,24 @@ class MAuditStreamHandler implements ExecuteStreamHandler { Enumeration keys = auditedFiles.keys(); Hashtable filemapping = task.getFileMapping(); final Date now = new Date(); - rootElement.setAttribute("snapshot_created", DateUtils.format(now, DateUtils.ISO8601_DATETIME_PATTERN)); - rootElement.setAttribute("elapsed_time", String.valueOf(now.getTime() - program_start.getTime())); - rootElement.setAttribute("program_start", DateUtils.format(now, DateUtils.ISO8601_DATETIME_PATTERN)); - rootElement.setAttribute("audited", String.valueOf(filemapping.size())); - rootElement.setAttribute("reported", String.valueOf(auditedFiles.size())); + rootElement.setAttribute("snapshot_created", + DateUtils.format(now, DateUtils.ISO8601_DATETIME_PATTERN)); + rootElement.setAttribute("elapsed_time", + String.valueOf(now.getTime() - program_start.getTime())); + rootElement.setAttribute("program_start", + DateUtils.format(now, DateUtils.ISO8601_DATETIME_PATTERN)); + rootElement.setAttribute("audited", + String.valueOf(filemapping.size())); + rootElement.setAttribute("reported", + String.valueOf(auditedFiles.size())); int errors = 0; while (keys.hasMoreElements()) { String filepath = (String) keys.nextElement(); Vector v = (Vector) auditedFiles.get(filepath); String fullclassname = (String) filemapping.get(filepath); if (fullclassname == null) { - task.getProject().log("Could not find class mapping for " + filepath, Project.MSG_WARN); + task.getProject().log("Could not find class mapping for " + + filepath, Project.MSG_WARN); continue; } int pos = fullclassname.lastIndexOf('.'); diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetrics.java b/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetrics.java index c356ebcc6..e3c02b6a7 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetrics.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetrics.java @@ -177,11 +177,14 @@ Format Options throw new BuildException("Output XML file must be set via 'tofile' attribute."); } if (path == null && fileSets.size() == 0) { - throw new BuildException("Must set either paths (path element) or files (fileset element)"); + throw new BuildException("Must set either paths (path element) " + + "or files (fileset element)"); } - // I don't accept dirs and files at the same time, I cannot recognize the semantic in the result + // I don't accept dirs and files at the same time, + // I cannot recognize the semantic in the result if (path != null && fileSets.size() > 0) { - throw new BuildException("Cannot set paths (path element) and files (fileset element) at the same time"); + throw new BuildException("Cannot set paths (path element) and " + + "files (fileset element) at the same time"); } tmpFile = createTmpFile(); } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetricsStreamHandler.java b/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetricsStreamHandler.java index 5dd77f5a7..2a8a933de 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetricsStreamHandler.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MMetricsStreamHandler.java @@ -172,7 +172,8 @@ public class MMetricsStreamHandler implements ExecuteStreamHandler { attr.addAttribute("", "company", "company", "CDATA", "metamata"); attr.addAttribute("", "snapshot_created", "snapshot_created", "CDATA", DateUtils.format(now, DateUtils.ISO8601_DATETIME_PATTERN)); -// attr.addAttribute("", "elapsed_time", "elapsed_time", "CDATA", String.valueOf(now.getTime() - program_start.getTime())); + // attr.addAttribute("", "elapsed_time", "elapsed_time", "CDATA", + // String.valueOf(now.getTime() - program_start.getTime())); attr.addAttribute("", "program_start", "program_start", "CDATA", DateUtils.format(new Date(), DateUtils.ISO8601_DATETIME_PATTERN)); metricsHandler.startElement("", "metrics", "metrics", attr); @@ -424,7 +425,8 @@ class MetricsElement { // there should be exactly 14 tokens (1 name + 13 metrics), if not, there is a problem ! if (metrics.size() != 14) { - throw new ParseException("Could not parse the following line as a metrics: -->" + line + "<--", -1); + throw new ParseException("Could not parse the following line as " + + "a metrics: -->" + line + "<--", -1); } // remove the first token it's made of the indentation string and the diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java index 8650b9a3e..e800607db 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java @@ -226,8 +226,8 @@ public class RExecTask extends Task { Calendar endTime = Calendar.getInstance(); endTime.add(Calendar.SECOND, timeout.intValue()); while (sb.toString().indexOf(s) == -1) { - while (Calendar.getInstance().before(endTime) && - is.available() == 0) { + while (Calendar.getInstance().before(endTime) + && is.available() == 0) { Thread.sleep(250); } if (is.available() == 0) { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/net/SetProxy.java b/src/main/org/apache/tools/ant/taskdefs/optional/net/SetProxy.java index f3736cfbb..08043f44f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/net/SetProxy.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/net/SetProxy.java @@ -270,8 +270,8 @@ public class SetProxy extends Task { //for Java1.1 we need to tell the system that the settings are new - if (settingsChanged && - JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { + if (settingsChanged + && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { legacyResetProxySettingsCall(enablingProxy); } } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java b/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java index 74dcca793..f49bfba3d 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java @@ -524,7 +524,7 @@ public class Pvcs extends org.apache.tools.ant.Task { * should be set to the bin directory of the PVCS installation containing * the executables mentioned before. If this attribute isn't specified the * tag expects the executables to be found using the PATH environment variable. - * @param ws String + * @param bin PVCS bin directory * @todo use a File setter and resolve paths. */ public void setPvcsbin(String bin) { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/scm/AntStarTeamCheckOut.java b/src/main/org/apache/tools/ant/taskdefs/optional/scm/AntStarTeamCheckOut.java index 8734ee536..20caceb64 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/scm/AntStarTeamCheckOut.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/scm/AntStarTeamCheckOut.java @@ -241,8 +241,8 @@ public class AntStarTeamCheckOut extends org.apache.tools.ant.Task { // Because of the way I create the full target path, there // must be NO slash at the end of targetFolder and folderName // However, if the slash or backslash is the only character, leave it alone - if ((getTargetFolder().endsWith("/") || - getTargetFolder().endsWith("\\")) + if ((getTargetFolder().endsWith("/") + || getTargetFolder().endsWith("\\")) && getTargetFolder().length() > 1) { setTargetFolder(getTargetFolder().substring(0, getTargetFolder().length() - 1)); } @@ -453,7 +453,8 @@ public class AntStarTeamCheckOut extends org.apache.tools.ant.Task { // Replace the projectName in the file's absolute path to the viewName. // This makes the root target of a checkout operation equal to: // targetFolder + dirName - StringTokenizer pathTokenizer = new StringTokenizer(rootSourceFolder.getFolderHierarchy(), delim); + StringTokenizer pathTokenizer + = new StringTokenizer(rootSourceFolder.getFolderHierarchy(), delim); String currentToken = null; boolean foundRoot = false; @@ -500,7 +501,8 @@ public class AntStarTeamCheckOut extends org.apache.tools.ant.Task { Folder[] subfolders = f.getSubFolders(); for (int i = 0; i < subfolders.length; i++) { - runFolder(s, p, v, t, subfolders[i], new java.io.File(tgt, subfolders[i].getName())); + runFolder(s, p, v, t, subfolders[i], + new java.io.File(tgt, subfolders[i].getName())); } } } @@ -881,7 +883,7 @@ public class AntStarTeamCheckOut extends org.apache.tools.ant.Task { /** * Sets the targetFolder attribute to the given value. * - * @param target The target path on the local machine to check out to. + * @param targetFolder The target path on the local machine to check out to. * @see #getTargetFolder() */ public void setTargetFolder(String targetFolder) { @@ -988,7 +990,8 @@ public class AntStarTeamCheckOut extends org.apache.tools.ant.Task { *
* Separate multiple inlcude filters by spaces , not commas as Ant * uses. For example, if you want to check out all .java and .class\ - * files, you would put the following line in your program: setIncludes("*.java *.class"); + * files, you would put the following line in your program: + * setIncludes("*.java *.class"); * Finally, note that filters have no effect on the directories * that are scanned; you could not check out files from directories with * names beginning only with "build," for instance. Of course, you could @@ -1042,7 +1045,8 @@ public class AntStarTeamCheckOut extends org.apache.tools.ant.Task { *
* Separate multiple exlcude filters by spaces , not commas as Ant * uses. For example, if you want to check out all files except .XML and - * .HTML files, you would put the following line in your program: setExcludes("*.XML *.HTML"); + * .HTML files, you would put the following line in your program: + * setExcludes("*.XML *.HTML"); * Finally, note that filters have no effect on the directories * that are scanned; you could not skip over all files in directories * whose names begin with "project," for instance.
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java b/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java index 3b35d12d0..c74b78316 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java @@ -331,11 +331,9 @@ public class ScriptDef extends Task { /** * Execute the script. * - * @param scriptConfig the RuntimeConfigurable which contains the attribute - * definitions for the script task instance. + * @param attributes collection of attributes * - * @param elements a list of UnknownElements which contain the configuration - * of the nested elements of the script instance. + * @param elements a list of nested element values. */ public void executeScript(Map attributes, Map elements) { try { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java index 128b28b24..ba057c714 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java @@ -130,7 +130,8 @@ public class CovMerge extends CovBase { cmdl.createArgument().setValue(tofile.getPath()); } - LogStreamHandler handler = new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN); + LogStreamHandler handler + = new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN); Execute exec = new Execute(handler); log(cmdl.describeCommand(), Project.MSG_VERBOSE); exec.setCommandline(cmdl.getCommandline()); diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java index 538c4acf0..54663c7fa 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java @@ -294,13 +294,15 @@ public class CovReport extends CovBase { } // use the custom handler for stdin issues - LogStreamHandler handler = new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN); + LogStreamHandler handler + = new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN); Execute exec = new Execute(handler); log(cmdl.describeCommand(), Project.MSG_VERBOSE); exec.setCommandline(cmdl.getCommandline()); int exitValue = exec.execute(); if (exitValue != 0) { - throw new BuildException("JProbe Coverage Report failed (" + exitValue + ")"); + throw new BuildException("JProbe Coverage Report failed (" + + exitValue + ")"); } log("coveragePath: " + coveragePath, Project.MSG_VERBOSE); log("format: " + format, Project.MSG_VERBOSE); @@ -396,7 +398,8 @@ public class CovReport extends CovBase { Result res = new StreamResult("file:///" + tofile.toString()); transformer.transform(src, res); } catch (Exception e) { - throw new BuildException("Error while performing enhanced XML report from file " + tofile, e); + throw new BuildException("Error while performing enhanced XML " + + "report from file " + tofile, e); } } } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/ReportFilters.java b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/ReportFilters.java index 4cc7ab199..1256e6eda 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/ReportFilters.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/ReportFilters.java @@ -109,7 +109,8 @@ public class ReportFilters { result = result && !matcher.matches(methodname); } else { //not possible - throw new IllegalArgumentException("Invalid filter element: " + filter.getClass().getName()); + throw new IllegalArgumentException("Invalid filter element: " + + filter.getClass().getName()); } } return result; diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java index df02925fb..95f3da78d 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java @@ -94,7 +94,10 @@ public class XMLReport { /** parsed document */ private Document report; - /** mapping of class names to ClassFiles from the reference classpath. It is used to filter the JProbe report. */ + /** + * mapping of class names to ClassFiles from the reference + * classpath. It is used to filter the JProbe report. + */ private Hashtable classFiles; /** mapping package name / package node for faster access */ @@ -160,7 +163,8 @@ public class XMLReport { for (int k = methodlen - 1; k > -1; k--) { Element meth = (Element) methods.item(k); StringBuffer methodname = new StringBuffer(meth.getAttribute("name")); - methodname.delete(methodname.toString().indexOf("("), methodname.toString().length()); + methodname.delete(methodname.toString().indexOf("("), + methodname.toString().length()); String signature = classname + "." + methodname + "()"; if (filters.accept(signature)) { log("kept method:" + signature); @@ -280,8 +284,8 @@ public class XMLReport { MethodInfo method = methods[i]; String methodSig = getMethodSignature(method); Element methodNode = (Element) methodNodeList.get(methodSig); - if (methodNode != null && - Utils.isAbstract(method.getAccessFlags())) { + if (methodNode != null + && Utils.isAbstract(method.getAccessFlags())) { log("\tRemoving abstract method " + methodSig); classNode.removeChild(methodNode); } @@ -441,7 +445,8 @@ public class XMLReport { int pkg_total_methods = 0; int pkg_hit_lines = 0; int pkg_total_lines = 0; - //System.out.println("Processing package '" + pkgname + "': " + classes.length + " classes"); + //System.out.println("Processing package '" + pkgname + "': " + // + classes.length + " classes"); for (int j = 0; j < classes.length; j++) { Element clazz = classes[j]; String classname = clazz.getAttribute("name"); @@ -457,7 +462,8 @@ public class XMLReport { pkg_hit_lines += Integer.parseInt(covdata.getAttribute("hit_lines")); pkg_total_lines += Integer.parseInt(covdata.getAttribute("total_lines")); } catch (NumberFormatException e) { - log("Error parsing '" + classname + "' (" + j + "/" + classes.length + ") in package '" + pkgname + "'"); + log("Error parsing '" + classname + "' (" + j + "/" + + classes.length + ") in package '" + pkgname + "'"); throw e; } } @@ -493,7 +499,8 @@ public class XMLReport { } } } - throw new NoSuchElementException("Could not find 'cov.data' element in parent '" + parent.getNodeName() + "'"); + throw new NoSuchElementException("Could not find 'cov.data' " + + "element in parent '" + parent.getNodeName() + "'"); } protected Hashtable getMethods(Element clazz) { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/ClassPathLoader.java b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/ClassPathLoader.java index b1043bb66..095ee70da 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/ClassPathLoader.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/ClassPathLoader.java @@ -340,7 +340,8 @@ final class DirectoryLoader implements ClassPathLoader.FileLoader { * @param recurse tells whether or not the listing is recursive. * @return the list instance that was passed as the list argument. */ - private static Vector listFilesTo(Vector list, File directory, FilenameFilter filter, boolean recurse) { + private static Vector listFilesTo(Vector list, File directory, + FilenameFilter filter, boolean recurse) { String[] files = directory.list(filter); for (int i = 0; i < files.length; i++) { list.addElement(new File(directory, files[i])); diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/Utils.java b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/Utils.java index 782cdb82a..d5540cdf9 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/Utils.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/Utils.java @@ -201,7 +201,8 @@ public class Utils { // think about it. //ooooops should never happen - //throw new IllegalArgumentException("Invalid descriptor symbol: '" + i + "' in '" + descriptor + "'"); + //throw new IllegalArgumentException("Invalid descriptor + // symbol: '" + i + "' in '" + descriptor + "'"); } sb.append(dim.toString()); return ++i; diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sos/SOS.java b/src/main/org/apache/tools/ant/taskdefs/optional/sos/SOS.java index df2c5504b..4c0bac32b 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/sos/SOS.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/sos/SOS.java @@ -233,7 +233,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the executable to run. Add the path if it was specifed in the build file * - * @return String the executable to run + * @return the executable to run */ protected String getSosCommand() { if (sosCmdDir == null) { @@ -245,7 +245,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the comment - * @return String if it was set, null if not + * @return if it was set, null if not */ protected String getComment() { return comment; @@ -253,7 +253,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the version - * @return String if it was set, null if not + * @return if it was set, null if not */ protected String getVersion() { return version; @@ -261,7 +261,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the label - * @return String if it was set, null if not + * @return if it was set, null if not */ protected String getLabel() { return label; @@ -269,7 +269,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the username - * @return String if it was set, null if not + * @return if it was set, null if not */ protected String getUsername() { return sosUsername; @@ -277,7 +277,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the password - * @return String empty string if it wans't set + * @return empty string if it wans't set */ protected String getPassword() { return sosPassword; @@ -285,7 +285,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the project path - * @return String if it was set, null if not + * @return if it was set, null if not */ protected String getProjectPath() { return projectPath; @@ -293,7 +293,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the VSS server path - * @return String if it was set, null if not + * @return if it was set, null if not */ protected String getVssServerPath() { return vssServerPath; @@ -301,7 +301,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the SOS home directory - * @return String if it was set, null if not + * @return if it was set, null if not */ protected String getSosHome() { return sosHome; @@ -309,7 +309,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the SOS serve path - * @return String if it was set, null if not + * @return if it was set, null if not */ protected String getSosServerPath() { return sosServerPath; @@ -317,7 +317,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the filename to be acted upon - * @return String if it was set, null if not + * @return if it was set, null if not */ protected String getFilename() { return filename; @@ -326,7 +326,8 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the NoCompress flag * - * @return String the 'nocompress' Flag if the attribute was 'true', otherwise an empty string + * @return the 'nocompress' Flag if the attribute was 'true', + * otherwise an empty string */ protected String getNoCompress() { return noCompress ? FLAG_NO_COMPRESSION : ""; @@ -335,7 +336,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the NoCache flag * - * @return String the 'nocache' Flag if the attribute was 'true', otherwise an empty string + * @return the 'nocache' Flag if the attribute was 'true', otherwise an empty string */ protected String getNoCache() { return noCache ? FLAG_NO_CACHE : ""; @@ -344,7 +345,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the 'verbose' Flag * - * @return String the 'verbose' Flag if the attribute was 'true', otherwise an empty string + * @return the 'verbose' Flag if the attribute was 'true', otherwise an empty string */ protected String getVerbose() { return verbose ? FLAG_VERBOSE : ""; @@ -353,7 +354,7 @@ public abstract class SOS extends Task implements SOSCmd { /** * Get the 'recursive' Flag * - * @return String the 'recursive' Flag if the attribute was 'true', otherwise an empty string + * @return the 'recursive' Flag if the attribute was 'true', otherwise an empty string */ protected String getRecursive() { return recursive ? FLAG_RECURSION : ""; @@ -364,7 +365,7 @@ public abstract class SOS extends Task implements SOSCmd { *

* The localpath is created if it didn't exist * - * @return String the absolute path of the working directory + * @return the absolute path of the working directory */ protected String getLocalPath() { if (localPath == null) { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java b/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java index 799ac9f2d..725dce673 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java @@ -100,9 +100,12 @@ public class AntSoundPlayer implements LineListener, BuildListener { } /** - * @param source the location of the audio file to be played when the build is successful - * @param loops the number of times the file should be played when the build is successful - * @param duration the number of milliseconds the file should be played when the build is successful + * @param file the location of the audio file to be played when the + * build is successful + * @param loops the number of times the file should be played when + * the build is successful + * @param duration the number of milliseconds the file should be + * played when the build is successful */ public void addBuildSuccessfulSound(File file, int loops, Long duration) { this.fileSuccess = file; @@ -112,9 +115,12 @@ public class AntSoundPlayer implements LineListener, BuildListener { /** - * @param fileName the location of the audio file to be played when the build fails - * @param loops the number of times the file should be played when the build is fails - * @param duration the number of milliseconds the file should be played when the build fails + * @param fileFail the location of the audio file to be played + * when the build fails + * @param loopsFail the number of times the file should be played + * when the build is fails + * @param durationFail the number of milliseconds the file should be + * played when the build fails */ public void addBuildFailedSound(File fileFail, int loopsFail, Long durationFail) { this.fileFail = fileFail; diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java index 966988ec8..c4c35c3ce 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/splash/SplashTask.java @@ -154,9 +154,8 @@ public class SplashTask extends Task { try { URLConnection conn = null; - if (useProxy && - (proxy != null && proxy.length() > 0) && - (port != null && port.length() > 0)) { + if (useProxy && (proxy != null && proxy.length() > 0) + && (port != null && port.length() > 0)) { log("Using proxied Connection", Project.MSG_DEBUG); System.getProperties().put("http.proxySet", "true"); @@ -186,7 +185,8 @@ public class SplashTask extends Task { in = conn.getInputStream(); - // Catch everything - some of the above return nulls, throw exceptions or generally misbehave + // Catch everything - some of the above return nulls, + // throw exceptions or generally misbehave // in the event of a problem etc } catch (Throwable ioe) { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamList.java b/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamList.java index e5faa85d9..295e26cab 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamList.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamList.java @@ -129,7 +129,8 @@ public class StarTeamList extends TreeBasedTask { * @param targetrootFolder * root local folder for the operation (whether specified by the user or not. */ - protected void logOperationDescription(Folder starteamrootFolder, java.io.File targetrootFolder) { + protected void logOperationDescription(Folder starteamrootFolder, + java.io.File targetrootFolder) { log((this.isRecursive() ? "Recursive" : "Non-recursive") + " Listing of: " + starteamrootFolder.getFolderHierarchy()); diff --git a/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java b/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java index be1a4addb..8f6d8cb1c 100644 --- a/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java +++ b/src/main/org/apache/tools/ant/taskdefs/rmic/DefaultRmicAdapter.java @@ -318,8 +318,8 @@ public abstract class DefaultRmicAdapter implements RmicAdapter { String base = name.substring(0, name.length() - 6); String classname = base.replace(File.separatorChar, '.'); - if (attributes.getVerify() && - !attributes.isValidRmiRemote(classname)) { + if (attributes.getVerify() + && !attributes.isValidRmiRemote(classname)) { return null; } diff --git a/src/main/org/apache/tools/ant/types/Environment.java b/src/main/org/apache/tools/ant/types/Environment.java index 89f520578..bd37acdf7 100644 --- a/src/main/org/apache/tools/ant/types/Environment.java +++ b/src/main/org/apache/tools/ant/types/Environment.java @@ -144,7 +144,8 @@ public class Environment { */ public String getContent() throws BuildException { if (key == null || value == null) { - throw new BuildException("key and value must be specified for environment variables."); + throw new BuildException("key and value must be specified " + + "for environment variables."); } StringBuffer sb = new StringBuffer(key.trim()); sb.append("=").append(value.trim()); diff --git a/src/main/org/apache/tools/ant/types/ResourceFactory.java b/src/main/org/apache/tools/ant/types/ResourceFactory.java index 26a79e1ae..672888ff6 100644 --- a/src/main/org/apache/tools/ant/types/ResourceFactory.java +++ b/src/main/org/apache/tools/ant/types/ResourceFactory.java @@ -65,7 +65,7 @@ public interface ResourceFactory { /** * Query a resource (file, zipentry, ...) by name * - * @param Name relative path of the resource about which + * @param name relative path of the resource about which * information is sought. Expects "/" to be used as the * directory separator. * @return instance of Resource; the exists attribute of Resource diff --git a/src/main/org/apache/tools/ant/types/optional/image/Arc.java b/src/main/org/apache/tools/ant/types/optional/image/Arc.java index 4fa5412dc..c47396a04 100644 --- a/src/main/org/apache/tools/ant/types/optional/image/Arc.java +++ b/src/main/org/apache/tools/ant/types/optional/image/Arc.java @@ -96,7 +96,8 @@ public class Arc extends BasicShape implements DrawOperation { } public PlanarImage executeDrawOperation() { - BufferedImage bi = new BufferedImage(width + (stroke_width * 2), height + (stroke_width * 2), BufferedImage.TYPE_4BYTE_ABGR_PRE); + BufferedImage bi = new BufferedImage(width + (stroke_width * 2), + height + (stroke_width * 2), BufferedImage.TYPE_4BYTE_ABGR_PRE); Graphics2D graphics = (Graphics2D) bi.getGraphics(); @@ -104,12 +105,14 @@ public class Arc extends BasicShape implements DrawOperation { BasicStroke b_stroke = new BasicStroke(stroke_width); graphics.setColor(ColorMapper.getColorByName(stroke)); graphics.setStroke(b_stroke); - graphics.draw(new Arc2D.Double(stroke_width, stroke_width, width, height, start, stop, type)); + graphics.draw(new Arc2D.Double(stroke_width, stroke_width, width, + height, start, stop, type)); } if (!fill.equals("transparent")) { graphics.setColor(ColorMapper.getColorByName(fill)); - graphics.fill(new Arc2D.Double(stroke_width, stroke_width, width, height, start, stop, type)); + graphics.fill(new Arc2D.Double(stroke_width, stroke_width, + width, height, start, stop, type)); } diff --git a/src/main/org/apache/tools/ant/types/optional/image/Rectangle.java b/src/main/org/apache/tools/ant/types/optional/image/Rectangle.java index e5bdbcc99..ca8df5d84 100644 --- a/src/main/org/apache/tools/ant/types/optional/image/Rectangle.java +++ b/src/main/org/apache/tools/ant/types/optional/image/Rectangle.java @@ -86,7 +86,8 @@ public class Rectangle extends BasicShape implements DrawOperation { } public PlanarImage executeDrawOperation() { - log("\tCreating Rectangle w=" + width + " h=" + height + " arcw=" + arcwidth + " arch=" + archeight); + log("\tCreating Rectangle w=" + width + " h=" + height + " arcw=" + + arcwidth + " arch=" + archeight); BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR_PRE); Graphics2D graphics = (Graphics2D) bi.getGraphics(); @@ -106,9 +107,12 @@ public class Rectangle extends BasicShape implements DrawOperation { if (!fill.equals("transparent")) { graphics.setColor(ColorMapper.getColorByName(fill)); if ((arcwidth != 0) || (archeight != 0)) { - graphics.fillRoundRect(stroke_width, stroke_width, width - (stroke_width * 2), height - (stroke_width * 2), arcwidth, archeight); + graphics.fillRoundRect(stroke_width, stroke_width, + width - (stroke_width * 2), height - (stroke_width * 2), + arcwidth, archeight); } else { - graphics.fillRect(stroke_width, stroke_width, width - (stroke_width * 2), height - (stroke_width * 2)); + graphics.fillRect(stroke_width, stroke_width, + width - (stroke_width * 2), height - (stroke_width * 2)); } } @@ -120,7 +124,8 @@ public class Rectangle extends BasicShape implements DrawOperation { graphics.drawImage(img.getAsBufferedImage(), null, 0, 0); } else if (instr instanceof TransformOperation) { graphics = (Graphics2D) bi.getGraphics(); - PlanarImage image = ((TransformOperation) instr).executeTransformOperation(PlanarImage.wrapRenderedImage(bi)); + PlanarImage image + = ((TransformOperation) instr).executeTransformOperation(PlanarImage.wrapRenderedImage(bi)); bi = image.getAsBufferedImage(); } } diff --git a/src/main/org/apache/tools/ant/types/optional/image/Rotate.java b/src/main/org/apache/tools/ant/types/optional/image/Rotate.java index 3ec8696a1..75f3ff7b5 100644 --- a/src/main/org/apache/tools/ant/types/optional/image/Rotate.java +++ b/src/main/org/apache/tools/ant/types/optional/image/Rotate.java @@ -125,7 +125,6 @@ public class Rotate extends TransformOperation implements DrawOperation { * It absolutely requires that there be a DrawOperation nested beneath it, * but only the FIRST DrawOperation will be handled since it can only return * ONE image. - * @param image The image to perform the transformation on. */ public PlanarImage executeDrawOperation() { for (int i = 0; i < instructions.size(); i++) { diff --git a/src/main/org/apache/tools/ant/types/resolver/ApacheCatalogResolver.java b/src/main/org/apache/tools/ant/types/resolver/ApacheCatalogResolver.java index 20bcc2ea5..255be613b 100644 --- a/src/main/org/apache/tools/ant/types/resolver/ApacheCatalogResolver.java +++ b/src/main/org/apache/tools/ant/types/resolver/ApacheCatalogResolver.java @@ -184,7 +184,7 @@ public class ApacheCatalogResolver extends CatalogResolver { * ApacheCatalog calls this for each URI entry found in an external * catalog file.

* - * @param URI The URI of the resource + * @param uri The URI of the resource * @param altURI The URI to which the resource should be mapped * (aka the location) * @param base The base URL of the resource. If the altURI diff --git a/src/main/org/apache/tools/ant/types/selectors/ContainsSelector.java b/src/main/org/apache/tools/ant/types/selectors/ContainsSelector.java index bc2a51fa9..3a3d705e2 100644 --- a/src/main/org/apache/tools/ant/types/selectors/ContainsSelector.java +++ b/src/main/org/apache/tools/ant/types/selectors/ContainsSelector.java @@ -124,7 +124,8 @@ public class ContainsSelector extends BaseExtendSelector { /** * Whether to ignore whitespace in the string being searched. * - * @param ignorewhitespace whether to ignore any whitespace (spaces, tabs, etc.) in the searchstring + * @param ignorewhitespace whether to ignore any whitespace + * (spaces, tabs, etc.) in the searchstring */ public void setIgnorewhitespace(boolean ignorewhitespace) { this.ignorewhitespace = ignorewhitespace; diff --git a/src/main/org/apache/tools/ant/types/selectors/ExtendSelector.java b/src/main/org/apache/tools/ant/types/selectors/ExtendSelector.java index 6416455f3..ed55de4b9 100644 --- a/src/main/org/apache/tools/ant/types/selectors/ExtendSelector.java +++ b/src/main/org/apache/tools/ant/types/selectors/ExtendSelector.java @@ -197,8 +197,8 @@ public class ExtendSelector extends BaseSelector { setError("The classname attribute is required"); } else if (dynselector == null) { setError("Internal Error: The custom selector was not created"); - } else if (!(dynselector instanceof ExtendFileSelector) && - (paramVec.size() > 0)) { + } else if (!(dynselector instanceof ExtendFileSelector) + && (paramVec.size() > 0)) { setError("Cannot set parameters on custom selector that does not " + "implement ExtendFileSelector"); } diff --git a/src/main/org/apache/tools/ant/types/selectors/SelectSelector.java b/src/main/org/apache/tools/ant/types/selectors/SelectSelector.java index e644350e4..e3dcca8dc 100644 --- a/src/main/org/apache/tools/ant/types/selectors/SelectSelector.java +++ b/src/main/org/apache/tools/ant/types/selectors/SelectSelector.java @@ -179,11 +179,11 @@ public class SelectSelector extends BaseSelectorContainer { * on it with if and unless. */ public boolean passesConditions() { - if (ifProperty != null && - getProject().getProperty(ifProperty) == null) { + if (ifProperty != null + && getProject().getProperty(ifProperty) == null) { return false; - } else if (unlessProperty != null && - getProject().getProperty(unlessProperty) != null) { + } else if (unlessProperty != null + && getProject().getProperty(unlessProperty) != null) { return false; } return true; diff --git a/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java b/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java index ec8dcb186..76a9e9a58 100644 --- a/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java +++ b/src/main/org/apache/tools/ant/types/selectors/SelectorUtils.java @@ -490,9 +490,9 @@ public final class SelectorUtils { + j]) { continue strLoop; } - if (!isCaseSensitive && Character.toUpperCase(ch) != - Character.toUpperCase(strArr[strIdxStart + i - + j])) { + if (!isCaseSensitive + && Character.toUpperCase(ch) + != Character.toUpperCase(strArr[strIdxStart + i + j])) { continue strLoop; } } diff --git a/src/main/org/apache/tools/ant/util/ClasspathUtils.java b/src/main/org/apache/tools/ant/util/ClasspathUtils.java index b08a8fc60..81c6faf1a 100644 --- a/src/main/org/apache/tools/ant/util/ClasspathUtils.java +++ b/src/main/org/apache/tools/ant/util/ClasspathUtils.java @@ -194,7 +194,7 @@ public class ClasspathUtils { * created loader with that id, and of course store it there upon * creation.

* @param path Path object to be used as classpath for this classloader - * @param loaderID identification for this Loader, + * @param loaderId identification for this Loader, * @param reverseLoader if set to true this new loader will take * precedence over it's parent (which is contra the regular * @param p Ant Project where the handled components are living in. @@ -210,8 +210,8 @@ public class ClasspathUtils { // magic property if (loaderId != null && reuseLoader) { Object reusedLoader = p.getReference(loaderId); - if (reusedLoader != null && - !(reusedLoader instanceof ClassLoader)) { + if (reusedLoader != null + && !(reusedLoader instanceof ClassLoader)) { throw new BuildException("The specified loader id " + loaderId + " does not reference a class loader"); } diff --git a/src/main/org/apache/tools/ant/util/DateUtils.java b/src/main/org/apache/tools/ant/util/DateUtils.java index a00caeee1..71b6ad3e5 100644 --- a/src/main/org/apache/tools/ant/util/DateUtils.java +++ b/src/main/org/apache/tools/ant/util/DateUtils.java @@ -160,7 +160,7 @@ public final class DateUtils { *
  • seconds are always displayed in plural form (ie "0 seconds" or * "10 seconds") except for 1 (ie "1 second")
  • * - * @param time the elapsed time to report in milliseconds. + * @param millis the elapsed time to report in milliseconds. * @return the formatted text in minutes/seconds. */ public static String formatElapsedTime(long millis) { diff --git a/src/main/org/apache/tools/ant/util/FileUtils.java b/src/main/org/apache/tools/ant/util/FileUtils.java index bdc6d9235..e860a9ff6 100644 --- a/src/main/org/apache/tools/ant/util/FileUtils.java +++ b/src/main/org/apache/tools/ant/util/FileUtils.java @@ -822,7 +822,7 @@ public class FileUtils { * * * @param path the path to be normalized - * @param the normalized version of the path. + * @return the normalized version of the path. * * @throws java.lang.NullPointerException if the file path is * equal to null. @@ -876,8 +876,8 @@ public class FileUtils { // Eliminate consecutive slashes after the drive spec StringBuffer sbPath = new StringBuffer(); for (int i = colon + 1; i < ca.length; i++) { - if ((ca[i] != '\\') || - (ca[i] == '\\' && ca[i - 1] != '\\')) { + if ((ca[i] != '\\') + || (ca[i] == '\\' && ca[i - 1] != '\\')) { sbPath.append(ca[i]); } } diff --git a/src/main/org/apache/tools/ant/util/LoaderUtils.java b/src/main/org/apache/tools/ant/util/LoaderUtils.java index 16d7f3a3e..eb7f26e90 100644 --- a/src/main/org/apache/tools/ant/util/LoaderUtils.java +++ b/src/main/org/apache/tools/ant/util/LoaderUtils.java @@ -143,8 +143,8 @@ public class LoaderUtils { * classloader are available. */ public static boolean isContextLoaderAvailable() { - return getContextClassLoader != null && - setContextClassLoader != null; + return getContextClassLoader != null + && setContextClassLoader != null; } /** diff --git a/src/main/org/apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java b/src/main/org/apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java index 229b0ba8d..ba07e913a 100644 --- a/src/main/org/apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java +++ b/src/main/org/apache/tools/ant/util/depend/bcel/AncestorAnalyzer.java @@ -69,6 +69,12 @@ import org.apache.tools.ant.util.depend.AbstractAnalyzer; */ public class AncestorAnalyzer extends AbstractAnalyzer { + /** + * Default constructor + * + * Causes the BCEL classes to load to ensure BCEL dependencies can + * be satisfied + */ public AncestorAnalyzer() { // force BCEL classes to load now try { diff --git a/src/main/org/apache/tools/ant/util/depend/bcel/DependencyVisitor.java b/src/main/org/apache/tools/ant/util/depend/bcel/DependencyVisitor.java index c4fd03c28..188ad54ab 100644 --- a/src/main/org/apache/tools/ant/util/depend/bcel/DependencyVisitor.java +++ b/src/main/org/apache/tools/ant/util/depend/bcel/DependencyVisitor.java @@ -118,6 +118,8 @@ public class DependencyVisitor extends EmptyVisitor { * Visit a name and type ref * * Look for class references in this + * + * @param obj the name and type reference being visited. */ public void visitConstantNameAndType(ConstantNameAndType obj) { String name = obj.getName(constantPool); diff --git a/src/main/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java b/src/main/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java index a29636dd2..7d15a67d3 100644 --- a/src/main/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java +++ b/src/main/org/apache/tools/ant/util/depend/bcel/FullAnalyzer.java @@ -69,6 +69,12 @@ import org.apache.tools.ant.util.depend.AbstractAnalyzer; * @author Holger Engels */ public class FullAnalyzer extends AbstractAnalyzer { + /** + * Default constructor + * + * Causes the BCEL classes to load to ensure BCEL dependencies can + * be satisfied + */ public FullAnalyzer() { // force BCEL classes to load now try { diff --git a/src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java b/src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java index 963e6d32c..e3134d99e 100644 --- a/src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java +++ b/src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java @@ -101,7 +101,7 @@ public class FacadeTaskHelper { /** * @param defaultValue The default value for the implementation. * Must not be null. - * @param magic the value of a magic property that may hold a user + * @param magicValue the value of a magic property that may hold a user * choice. May be null. */ public FacadeTaskHelper(String defaultValue, String magicValue) { diff --git a/src/main/org/apache/tools/mail/MailMessage.java b/src/main/org/apache/tools/mail/MailMessage.java index 74845cd53..c17d8f39c 100644 --- a/src/main/org/apache/tools/mail/MailMessage.java +++ b/src/main/org/apache/tools/mail/MailMessage.java @@ -211,16 +211,16 @@ public class MailMessage { this.port = port; } - /** - * Sets the from address. Also sets the "From" header. This method should - * be called only once. - * - * @exception IOException if there's any problem reported by the mail server - */ - public void from(String from) throws IOException { - sendFrom(from); - this.from = from; - } + /** + * Sets the from address. Also sets the "From" header. This method should + * be called only once. + * + * @exception IOException if there's any problem reported by the mail server + */ + public void from(String from) throws IOException { + sendFrom(from); + this.from = from; + } /** * Sets the replyto address @@ -469,12 +469,14 @@ public class MailMessage { try { in.close(); } catch (IOException e) { + // ignore } } if (socket != null) { try { socket.close(); } catch (IOException e) { + // ignore } } } diff --git a/src/main/org/apache/tools/tar/TarInputStream.java b/src/main/org/apache/tools/tar/TarInputStream.java index df1668468..c599aa126 100644 --- a/src/main/org/apache/tools/tar/TarInputStream.java +++ b/src/main/org/apache/tools/tar/TarInputStream.java @@ -107,7 +107,7 @@ public class TarInputStream extends FilterInputStream { /** * Sets the debugging flag. * - * @param debugF True to turn on debugging. + * @param debug True to turn on debugging. */ public void setDebug(boolean debug) { this.debug = debug; diff --git a/src/main/org/apache/tools/tar/TarOutputStream.java b/src/main/org/apache/tools/tar/TarOutputStream.java index ec47c6254..41c0f1b44 100644 --- a/src/main/org/apache/tools/tar/TarOutputStream.java +++ b/src/main/org/apache/tools/tar/TarOutputStream.java @@ -126,7 +126,7 @@ public class TarOutputStream extends FilterOutputStream { /** * Sets the debugging flag in this stream's TarBuffer. * - * @param debugF True to turn on debugging. + * @param debug True to turn on debugging. */ public void setBufferDebug(boolean debug) { this.buffer.setDebug(debug); diff --git a/src/main/org/apache/tools/tar/TarUtils.java b/src/main/org/apache/tools/tar/TarUtils.java index 9128d419e..0061b6b02 100644 --- a/src/main/org/apache/tools/tar/TarUtils.java +++ b/src/main/org/apache/tools/tar/TarUtils.java @@ -129,7 +129,7 @@ public class TarUtils { /** * Determine the number of bytes in an entry name. * - * @param header The header buffer from which to parse. + * @param name The header name from which to parse. * @param offset The offset into the buffer from which to parse. * @param length The number of header bytes to parse. * @return The number of bytes in a header's entry name. @@ -151,7 +151,7 @@ public class TarUtils { /** * Parse an octal integer from a header buffer. * - * @param header The header buffer from which to parse. + * @param value The header value * @param offset The offset into the buffer from which to parse. * @param length The number of header bytes to parse. * @return The integer value of the octal bytes. @@ -184,7 +184,7 @@ public class TarUtils { /** * Parse an octal long integer from a header buffer. * - * @param header The header buffer from which to parse. + * @param value The header value * @param offset The offset into the buffer from which to parse. * @param length The number of header bytes to parse. * @return The long value of the octal bytes. @@ -201,7 +201,7 @@ public class TarUtils { /** * Parse the checksum octal integer from a header buffer. * - * @param header The header buffer from which to parse. + * @param value The header value * @param offset The offset into the buffer from which to parse. * @param length The number of header bytes to parse. * @return The integer value of the entry's checksum.