peterreilly 2003/07/25 01:59:40 Modified: src/main/org/apache/tools/ant/taskdefs Antlib.java Concat.java Delete.java MatchingTask.java Parallel.java Patch.java Replace.java Log: checkstyle Revision Changes Path 1.4 +3 -4 ant/src/main/org/apache/tools/ant/taskdefs/Antlib.java Index: Antlib.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Antlib.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Antlib.java 24 Jul 2003 13:48:45 -0000 1.3 +++ Antlib.java 25 Jul 2003 08:59:39 -0000 1.4 @@ -65,7 +65,6 @@ import org.apache.tools.ant.Location; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; -import org.apache.tools.ant.Target; import org.apache.tools.ant.helper.ProjectHelper2; import org.apache.tools.ant.UnknownElement; @@ -104,13 +103,13 @@ // Should be safe to parse try { ProjectHelper2 parser = new ProjectHelper2(); - UnknownElement ue = + UnknownElement ue = parser.parseUnknownElement(project, antlibUrl); // Check name is "antlib" if (!(ue.getTag().equals(TAG))) { throw new BuildException( - "Unexpected tag " + ue.getTag() + " expecting " + - TAG, ue.getLocation()); + "Unexpected tag " + ue.getTag() + " expecting " + + TAG, ue.getLocation()); } Antlib antlib = new Antlib(); antlib.setProject(project); 1.24 +5 -2 ant/src/main/org/apache/tools/ant/taskdefs/Concat.java Index: Concat.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Concat.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- Concat.java 20 Jul 2003 09:42:21 -0000 1.23 +++ Concat.java 25 Jul 2003 08:59:39 -0000 1.24 @@ -101,6 +101,9 @@ * @author Peter Reilly */ public class Concat extends Task { + + // The size of buffers to be used + private static final int BUFFER_SIZE = 8192; // Attributes. @@ -442,7 +445,7 @@ private void cat() { OutputStream os = null; Reader reader = null; - char[] buffer = new char[8192]; + char[] buffer = new char[BUFFER_SIZE]; try { @@ -535,7 +538,7 @@ throws IOException { if (filterChains != null) { ChainReaderHelper helper = new ChainReaderHelper(); - helper.setBufferSize(8192); + helper.setBufferSize(BUFFER_SIZE); helper.setPrimaryReader(in); helper.setFilterChains(filterChains); helper.setProject(getProject()); 1.45 +34 -3 ant/src/main/org/apache/tools/ant/taskdefs/Delete.java Index: Delete.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Delete.java,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- Delete.java 19 Jul 2003 11:20:12 -0000 1.44 +++ Delete.java 25 Jul 2003 08:59:39 -0000 1.45 @@ -100,6 +100,7 @@ * @ant.task category="filesystem" */ public class Delete extends MatchingTask { + private static final int DELETE_RETRY_SLEEP_MILLIS = 10; protected File file = null; protected File dir = null; protected Vector filesets = new Vector(); @@ -170,20 +171,24 @@ /** * If true, delete empty directories. + * @param includeEmpty if true delete empty directories (only + * for filesets). Default is false. */ public void setIncludeEmptyDirs(boolean includeEmpty) { this.includeEmpty = includeEmpty; } /** - * Adds a set of files to be deleted. - */ + * Adds a set of files to be deleted. + * @param set the set of files to be deleted + */ public void addFileset(FileSet set) { filesets.addElement(set); } /** * add a name entry on the include list + * @return a NameEntry object to be configured */ public PatternSet.NameEntry createInclude() { usedMatchingTask = true; @@ -192,6 +197,7 @@ /** * add a name entry on the include files list + * @return an NameEntry object to be configured */ public PatternSet.NameEntry createIncludesFile() { usedMatchingTask = true; @@ -200,6 +206,7 @@ /** * add a name entry on the exclude list + * @return an NameEntry object to be configured */ public PatternSet.NameEntry createExclude() { usedMatchingTask = true; @@ -208,6 +215,7 @@ /** * add a name entry on the include files list + * @return an NameEntry object to be configured */ public PatternSet.NameEntry createExcludesFile() { usedMatchingTask = true; @@ -216,6 +224,7 @@ /** * add a set of patterns + * @return PatternSet object to be configured */ public PatternSet createPatternSet() { usedMatchingTask = true; @@ -301,6 +310,7 @@ /** * add a "Select" selector entry on the selector list + * @param selector the selector to be added */ public void addSelector(SelectSelector selector) { usedMatchingTask = true; @@ -309,6 +319,7 @@ /** * add an "And" selector entry on the selector list + * @param selector the selector to be added */ public void addAnd(AndSelector selector) { usedMatchingTask = true; @@ -317,6 +328,7 @@ /** * add an "Or" selector entry on the selector list + * @param selector the selector to be added */ public void addOr(OrSelector selector) { usedMatchingTask = true; @@ -325,6 +337,7 @@ /** * add a "Not" selector entry on the selector list + * @param selector the selector to be added */ public void addNot(NotSelector selector) { usedMatchingTask = true; @@ -333,6 +346,7 @@ /** * add a "None" selector entry on the selector list + * @param selector the selector to be added */ public void addNone(NoneSelector selector) { usedMatchingTask = true; @@ -341,6 +355,7 @@ /** * add a majority selector entry on the selector list + * @param selector the selector to be added */ public void addMajority(MajoritySelector selector) { usedMatchingTask = true; @@ -349,6 +364,7 @@ /** * add a selector date entry on the selector list + * @param selector the selector to be added */ public void addDate(DateSelector selector) { usedMatchingTask = true; @@ -357,6 +373,7 @@ /** * add a selector size entry on the selector list + * @param selector the selector to be added */ public void addSize(SizeSelector selector) { usedMatchingTask = true; @@ -365,6 +382,7 @@ /** * add a selector filename entry on the selector list + * @param selector the selector to be added */ public void addFilename(FilenameSelector selector) { usedMatchingTask = true; @@ -373,6 +391,7 @@ /** * add an extended selector entry on the selector list + * @param selector the selector to be added */ public void addCustom(ExtendSelector selector) { usedMatchingTask = true; @@ -381,6 +400,7 @@ /** * add a contains selector entry on the selector list + * @param selector the selector to be added */ public void addContains(ContainsSelector selector) { usedMatchingTask = true; @@ -389,6 +409,7 @@ /** * add a present selector entry on the selector list + * @param selector the selector to be added */ public void addPresent(PresentSelector selector) { usedMatchingTask = true; @@ -397,6 +418,7 @@ /** * add a depth selector entry on the selector list + * @param selector the selector to be added */ public void addDepth(DepthSelector selector) { usedMatchingTask = true; @@ -405,6 +427,7 @@ /** * add a depends selector entry on the selector list + * @param selector the selector to be added */ public void addDepend(DependSelector selector) { usedMatchingTask = true; @@ -413,6 +436,7 @@ /** * add a regular expression selector entry on the selector list + * @param selector the selector to be added */ public void addContainsRegexp(ContainsRegexpSelector selector) { usedMatchingTask = true; @@ -421,6 +445,7 @@ /** * add an arbitary selector + * @param selector the selector to be added * @since Ant 1.6 */ public void add(FileSelector selector) { @@ -430,6 +455,7 @@ /** * Delete the file(s). + * @exception BuildException if an error occurs */ public void execute() throws BuildException { if (usedMatchingTask) { @@ -542,7 +568,7 @@ private boolean delete(File f) { if (!f.delete()) { try { - Thread.sleep(10); + Thread.sleep(DELETE_RETRY_SLEEP_MILLIS); return f.delete(); } catch (InterruptedException ex) { return f.delete(); @@ -551,6 +577,11 @@ return true; } + /** + * Delete a directory + * + * @param d the directory to delete + */ protected void removeDir(File d) { String[] list = d.list(); if (list == null) { 1.39 +5 -0 ant/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java Index: MatchingTask.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/MatchingTask.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- MatchingTask.java 19 Jul 2003 08:10:59 -0000 1.38 +++ MatchingTask.java 25 Jul 2003 08:59:39 -0000 1.39 @@ -111,6 +111,7 @@ /** * add a name entry on the include list + * @return a NameEntry object to be configured */ public PatternSet.NameEntry createInclude() { return fileset.createInclude(); @@ -118,6 +119,7 @@ /** * add a name entry on the include files list + * @return an NameEntry object to be configured */ public PatternSet.NameEntry createIncludesFile() { return fileset.createIncludesFile(); @@ -125,6 +127,7 @@ /** * add a name entry on the exclude list + * @return an NameEntry object to be configured */ public PatternSet.NameEntry createExclude() { return fileset.createExclude(); @@ -132,6 +135,7 @@ /** * add a name entry on the include files list + * @return an NameEntry object to be configured */ public PatternSet.NameEntry createExcludesFile() { return fileset.createExcludesFile(); @@ -139,6 +143,7 @@ /** * add a set of patterns + * @return PatternSet object to be configured */ public PatternSet createPatternSet() { return fileset.createPatternSet(); 1.22 +3 -3 ant/src/main/org/apache/tools/ant/taskdefs/Parallel.java Index: Parallel.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Parallel.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- Parallel.java 24 Jul 2003 14:24:07 -0000 1.21 +++ Parallel.java 25 Jul 2003 08:59:39 -0000 1.22 @@ -250,7 +250,7 @@ public synchronized void run() { try { wait(timeout); - synchronized(semaphore) { + synchronized (semaphore) { stillRunning = false; timedOut = true; semaphore.notifyAll(); @@ -290,7 +290,7 @@ } } - synchronized(semaphore) { + synchronized (semaphore) { // are all threads finished outer2: while (stillRunning) { @@ -318,7 +318,7 @@ StringBuffer exceptionMessage = new StringBuffer(); int numExceptions = 0; Throwable firstException = null; - Location firstLocation = Location.UNKNOWN_LOCATION;; + Location firstLocation = Location.UNKNOWN_LOCATION; for (int i = 0; i < numTasks; ++i) { Throwable t = runnables[i].getException(); if (t != null) { 1.25 +10 -3 ant/src/main/org/apache/tools/ant/taskdefs/Patch.java Index: Patch.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Patch.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- Patch.java 19 Jul 2003 08:10:59 -0000 1.24 +++ Patch.java 25 Jul 2003 08:59:39 -0000 1.25 @@ -80,6 +80,7 @@ /** * The file to patch; optional if it can be inferred from * the diff file + * @param file the file to patch */ public void setOriginalfile(File file) { originalFile = file; @@ -88,7 +89,7 @@ /** * The name of a file to send the output to, instead of patching * the file(s) in place; optional. - * + * @param file the file to send the output to * @since Ant 1.6 */ public void setDestfile(File file) { @@ -100,6 +101,7 @@ /** * The file containing the diff output; required. + * @param file the file containing the diff output */ public void setPatchfile(File file) { if (!file.exists()) { @@ -113,6 +115,7 @@ /** * flag to create backups; optional, default=false + * @param backups if true create backups */ public void setBackups(boolean backups) { if (backups) { @@ -122,6 +125,7 @@ /** * flag to ignore whitespace differences; default=false + * @param ignore if true ignore whitespace differences */ public void setIgnorewhitespace(boolean ignore) { if (ignore) { @@ -135,6 +139,7 @@ * * <p>patch's <i>-p</i> option. * @param num number of lines to strip + * @exception BuildException if num is < 0, or other errors */ public void setStrip(int num) throws BuildException { if (num < 0) { @@ -145,6 +150,7 @@ /** * Work silently unless an error occurs; optional, default=false + * @param q if true supress set the -s option on the patch command */ public void setQuiet(boolean q) { if (q) { @@ -155,6 +161,7 @@ /** * Assume patch was created with old and new files swapped; optional, * default=false + * @param r if true set the -R option on the patch command */ public void setReverse(boolean r) { if (r) { @@ -165,10 +172,10 @@ /** * The directory to run the patch command in, defaults to the * project's base directory. - * + * @param directory the directory to run the patch command in * @since Ant 1.5 */ - public void setDir(File directory) throws BuildException { + public void setDir(File directory) { this.directory = directory; } 1.45 +11 -1 ant/src/main/org/apache/tools/ant/taskdefs/Replace.java Index: Replace.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Replace.java,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- Replace.java 19 Jul 2003 11:20:13 -0000 1.44 +++ Replace.java 25 Jul 2003 08:59:39 -0000 1.45 @@ -119,10 +119,18 @@ private StringBuffer buf = new StringBuffer(); + /** + * the text of the element + * + * @param val the string to add + */ public void addText(String val) { buf.append(val); } + /** + * @return the text + */ public String getText() { return buf.substring(0); } @@ -183,6 +191,7 @@ /** * Get the replacement value for this filter token. + * @return the replacement value */ public String getReplaceValue() { if (property != null) { @@ -352,7 +361,7 @@ /** * helper method to load a properties file and throw a build exception * if it cannot be loaded - * @param propertyFile + * @param propertyFile the file to load the properties from * @return loaded properties collection * @throws BuildException if the file could not be found or read */ @@ -600,6 +609,7 @@ /** * Add a nested <replacefilter> element. + * @return a nested ReplaceFilter object to be configured */ public Replacefilter createReplacefilter() { Replacefilter filter = new Replacefilter();
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]