Author: peterreilly Date: Wed Sep 12 04:35:15 2007 New Revision: 574889 URL: http://svn.apache.org/viewvc?rev=574889&view=rev Log: checkstyle
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/TempFile.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Equals.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FailureRecorder.java ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java ant/core/trunk/src/main/org/apache/tools/ant/util/FileUtils.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java?rev=574889&r1=574888&r2=574889&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java Wed Sep 12 04:35:15 2007 @@ -338,7 +338,7 @@ log(actualCommandLine, Project.MSG_VERBOSE); int retCode = exe.execute(); log("retCode=" + retCode, Project.MSG_DEBUG); - + if (failOnError && Execute.isFailure(retCode)) { throw new BuildException("cvs exited with error code " + retCode @@ -430,7 +430,7 @@ } /** - * Removes the cvs password from the command line, if given on the command + * Removes the cvs password from the command line, if given on the command * line. This password can be given on the command line in the cvsRoot * -d:pserver:user:[EMAIL PROTECTED]:path * It has to be noted that the password may be omitted altogether. @@ -450,16 +450,16 @@ stop = cmdLine.indexOf("@", start); if (stop >= 0 && startpass > startproto && startpass < stop) { for (int i = startpass + 1; i < stop; i++) { - stringBuffer.replace(i, i+1, "*"); + stringBuffer.replace(i, i + 1, "*"); } } } return stringBuffer; } - + /** * The CVSROOT variable. - * + * * @param root * the CVSROOT variable */ Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/TempFile.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/TempFile.java?rev=574889&r1=574888&r2=574889&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/TempFile.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/TempFile.java Wed Sep 12 04:35:15 2007 @@ -65,7 +65,7 @@ /** deleteOnExit flag */ private boolean deleteOnExit; - + /** createFile flag */ private boolean createFile; @@ -126,7 +126,7 @@ public boolean isDeleteOnExit() { return deleteOnExit; } - + /** * If set the file is actually created, if not just a name is created. * @param createFile boolean flag. Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Equals.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Equals.java?rev=574889&r1=574888&r2=574889&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Equals.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/Equals.java Wed Sep 12 04:35:15 2007 @@ -59,7 +59,7 @@ this.arg1 = arg1; args |= 1; } - + /** * Set the second argument * @param arg2 the second argument. @@ -86,7 +86,7 @@ this.arg2 = arg2; args |= 2; } - + /** * Should we want to trim the arguments before comparing them? * @param b if true trim the arguments Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FailureRecorder.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FailureRecorder.java?rev=574889&r1=574888&r2=574889&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FailureRecorder.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/FailureRecorder.java Wed Sep 12 04:35:15 2007 @@ -129,6 +129,8 @@ /** * Add the failed test to the list. + * @param test the test that errored. + * @param throwable the reason it errored. * @see junit.framework.TestListener#addError(junit.framework.Test, java.lang.Throwable) */ public void addError(Test test, Throwable throwable) { @@ -138,6 +140,8 @@ // CheckStyle:LineLengthCheck OFF - @see is long /** * Add the failed test to the list. + * @param test the test that failed. + * @param error the assertion that failed. * @see junit.framework.TestListener#addFailure(junit.framework.Test, junit.framework.AssertionFailedError) */ // CheckStyle:LineLengthCheck ON @@ -215,7 +219,7 @@ writer.println(" super(testname);"); writer.println(" }"); } - + private void createSuiteMethod() { writer.println(" public static Test suite() {"); writer.println(" TestSuite suite = new TestSuite();"); @@ -228,24 +232,24 @@ writer.println(" return suite;"); writer.println(" }"); } - + private void createClassFooter() { writer.println("}"); } // Helper classes - + /** * TestInfos holds information about a given test for later use. */ public class TestInfos implements Comparable { - + /** The class name of the test. */ - String className; - + private String className; + /** The method name of the testcase. */ - String methodName; - + private String methodName; + /** * This constructor extracts the needed information from the given test. * @param test Test to analyze @@ -255,21 +259,24 @@ methodName = test.toString(); methodName = methodName.substring(0, methodName.indexOf('(')); } - + /** * This String-Representation can directly be used for instantiation of * the JUnit testcase. + * @return the string representation. * @see java.lang.Object#toString() * @see FailureRecorder#createSuiteMethod() */ public String toString() { return "new " + className + "(\"" + methodName + "\")"; } - - /* + + /** * The SortedMap needs comparable elements. + * @param other the object to compare to. + * @return the result of the comparison. * @see java.lang.Comparable#compareTo(T) - * @see SortedSet#comparator() + * @see SortedSet#comparator() */ public int compareTo(Object other) { if (other instanceof TestInfos) { Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java?rev=574889&r1=574888&r2=574889&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java Wed Sep 12 04:35:15 2007 @@ -371,7 +371,7 @@ } for (int i = 0; i < newfiles.length; i++) { FTPFile file = newfiles[i]; - if (file != null + if (file != null && !file.getName().equals(".") && !file.getName().equals("..")) { if (isFunctioningAsDirectory(ftp, dir, file)) { @@ -581,7 +581,9 @@ + target + " where a directory called " + array[icounter].getName() + " exists", Project.MSG_DEBUG); for (int pcounter = 0; pcounter < array.length; pcounter++) { - if (array[pcounter] != null && pcounter != icounter && target.equals(array[pcounter].getName()) ) { + if (array[pcounter] != null + && pcounter != icounter + && target.equals(array[pcounter].getName())) { candidateFound = false; } } @@ -720,7 +722,8 @@ return null; } for (int icounter = 0; icounter < theFiles.length; icounter++) { - if (theFiles[icounter] != null && theFiles[icounter].getName().equalsIgnoreCase(soughtPathElement)) { + if (theFiles[icounter] != null + && theFiles[icounter].getName().equalsIgnoreCase(soughtPathElement)) { return theFiles[icounter].getName(); } } @@ -1824,7 +1827,8 @@ FTPFile [] theFiles = null; final int maxIterations = 1000; for (int counter = 1; counter < maxIterations; counter++) { - File localFile = FILE_UTILS.createTempFileName("ant" + Integer.toString(counter), ".tmp", + File localFile = FILE_UTILS.createTempFileName( + "ant" + Integer.toString(counter), ".tmp", null, false); String fileName = localFile.getName(); boolean found = false; @@ -1833,7 +1837,8 @@ theFiles = ftp.listFiles(); } for (int counter2 = 0; counter2 < theFiles.length; counter2++) { - if (theFiles[counter2] != null && theFiles[counter2].getName().equals(fileName)) { + if (theFiles[counter2] != null + && theFiles[counter2].getName().equals(fileName)) { found = true; break; } 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=574889&r1=574888&r2=574889&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 Wed Sep 12 04:35:15 2007 @@ -826,19 +826,17 @@ String parent = (parentDir == null) ? System.getProperty("java.io.tmpdir") : parentDir.getPath(); - try { result = File.createTempFile(prefix, suffix, new File(parent)); } catch (IOException e) { throw new BuildException("Could not create tempfile in " + parent, e); } - if (deleteOnExit) { result.deleteOnExit(); } return result; } - + /** * Create a File object for a temporary file in a given directory. Without * actually creating the file. @@ -878,8 +876,6 @@ } return result; } - - /** * Compares the contents of two files. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]