Removed uneeded imports. Processed code through style formatter. Yay - down to 272 errors!!!!!!!!!!!!!!!!!!!!! git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270168 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -128,7 +128,7 @@ public class AntClassLoader extends ClassLoader implements BuildListener | |||||
| * value of ${build.sysclasspath} | * value of ${build.sysclasspath} | ||||
| */ | */ | ||||
| public AntClassLoader( Project project, Path classpath ) | public AntClassLoader( Project project, Path classpath ) | ||||
| throws TaskException | |||||
| throws TaskException | |||||
| { | { | ||||
| parent = AntClassLoader.class.getClassLoader(); | parent = AntClassLoader.class.getClassLoader(); | ||||
| this.project = project; | this.project = project; | ||||
| @@ -163,7 +163,7 @@ public class AntClassLoader extends ClassLoader implements BuildListener | |||||
| */ | */ | ||||
| public AntClassLoader( ClassLoader parent, Project project, Path classpath, | public AntClassLoader( ClassLoader parent, Project project, Path classpath, | ||||
| boolean parentFirst ) | boolean parentFirst ) | ||||
| throws TaskException | |||||
| throws TaskException | |||||
| { | { | ||||
| this( project, classpath ); | this( project, classpath ); | ||||
| if( parent != null ) | if( parent != null ) | ||||
| @@ -184,7 +184,7 @@ public class AntClassLoader extends ClassLoader implements BuildListener | |||||
| * be consulted before trying to load the a class through this loader. | * be consulted before trying to load the a class through this loader. | ||||
| */ | */ | ||||
| public AntClassLoader( Project project, Path classpath, boolean parentFirst ) | public AntClassLoader( Project project, Path classpath, boolean parentFirst ) | ||||
| throws TaskException | |||||
| throws TaskException | |||||
| { | { | ||||
| this( null, project, classpath, parentFirst ); | this( null, project, classpath, parentFirst ); | ||||
| } | } | ||||
| @@ -539,7 +539,7 @@ public class AntClassLoader extends ClassLoader implements BuildListener | |||||
| * Reset the current thread's context loader to its original value | * Reset the current thread's context loader to its original value | ||||
| */ | */ | ||||
| public void resetThreadContextLoader() | public void resetThreadContextLoader() | ||||
| throws TaskException | |||||
| throws TaskException | |||||
| { | { | ||||
| if( isContextLoaderSaved && | if( isContextLoaderSaved && | ||||
| getContextClassLoader != null && setContextClassLoader != null ) | getContextClassLoader != null && setContextClassLoader != null ) | ||||
| @@ -6,6 +6,7 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.util.EventObject; | import java.util.EventObject; | ||||
| public class BuildEvent extends EventObject | public class BuildEvent extends EventObject | ||||
| @@ -6,6 +6,7 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.util.EventListener; | import java.util.EventListener; | ||||
| /** | /** | ||||
| @@ -6,6 +6,7 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.io.PrintStream; | import java.io.PrintStream; | ||||
| /** | /** | ||||
| @@ -6,9 +6,8 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.io.PrintStream; | import java.io.PrintStream; | ||||
| import java.io.PrintWriter; | |||||
| import java.io.StringWriter; | |||||
| import org.apache.tools.ant.util.StringUtils; | import org.apache.tools.ant.util.StringUtils; | ||||
| /** | /** | ||||
| @@ -36,14 +35,14 @@ public class DefaultLogger implements BuildLogger | |||||
| if( minutes > 0 ) | if( minutes > 0 ) | ||||
| { | { | ||||
| return Long.toString( minutes ) + " minute" | return Long.toString( minutes ) + " minute" | ||||
| + ( minutes == 1 ? " " : "s " ) | |||||
| + Long.toString( seconds % 60 ) + " second" | |||||
| + ( seconds % 60 == 1 ? "" : "s" ); | |||||
| + ( minutes == 1 ? " " : "s " ) | |||||
| + Long.toString( seconds % 60 ) + " second" | |||||
| + ( seconds % 60 == 1 ? "" : "s" ); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| return Long.toString( seconds ) + " second" | return Long.toString( seconds ) + " second" | ||||
| + ( seconds % 60 == 1 ? "" : "s" ); | |||||
| + ( seconds % 60 == 1 ? "" : "s" ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -137,7 +136,7 @@ public class DefaultLogger implements BuildLogger | |||||
| } | } | ||||
| message.append( StringUtils.LINE_SEP ); | message.append( StringUtils.LINE_SEP ); | ||||
| message.append( "Total time: " | message.append( "Total time: " | ||||
| + formatTime( System.currentTimeMillis() - startTime ) ); | |||||
| + formatTime( System.currentTimeMillis() - startTime ) ); | |||||
| String msg = message.toString(); | String msg = message.toString(); | ||||
| if( error == null ) | if( error == null ) | ||||
| @@ -193,7 +192,9 @@ public class DefaultLogger implements BuildLogger | |||||
| } | } | ||||
| } | } | ||||
| public void targetFinished( BuildEvent event ) { } | |||||
| public void targetFinished( BuildEvent event ) | |||||
| { | |||||
| } | |||||
| public void targetStarted( BuildEvent event ) | public void targetStarted( BuildEvent event ) | ||||
| { | { | ||||
| @@ -205,9 +206,13 @@ public class DefaultLogger implements BuildLogger | |||||
| } | } | ||||
| } | } | ||||
| public void taskFinished( BuildEvent event ) { } | |||||
| public void taskFinished( BuildEvent event ) | |||||
| { | |||||
| } | |||||
| public void taskStarted( BuildEvent event ) { } | |||||
| public void taskStarted( BuildEvent event ) | |||||
| { | |||||
| } | |||||
| /** | /** | ||||
| * Empty implementation which allows subclasses to receive the same output | * Empty implementation which allows subclasses to receive the same output | ||||
| @@ -215,6 +220,8 @@ public class DefaultLogger implements BuildLogger | |||||
| * | * | ||||
| * @param message Description of Parameter | * @param message Description of Parameter | ||||
| */ | */ | ||||
| protected void log( String message ) { } | |||||
| protected void log( String message ) | |||||
| { | |||||
| } | |||||
| } | } | ||||
| @@ -6,12 +6,12 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.io.ByteArrayOutputStream; | import java.io.ByteArrayOutputStream; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.io.OutputStream; | import java.io.OutputStream; | ||||
| import java.util.Hashtable; | import java.util.Hashtable; | ||||
| /** | /** | ||||
| * Logs content written by a thread and forwards the buffers onto the project | * Logs content written by a thread and forwards the buffers onto the project | ||||
| * object which will forward the content to the appropriate task | * object which will forward the content to the appropriate task | ||||
| @@ -24,7 +24,7 @@ public class DemuxOutputStream extends OutputStream | |||||
| private final static int MAX_SIZE = 1024; | private final static int MAX_SIZE = 1024; | ||||
| private Hashtable buffers = new Hashtable(); | private Hashtable buffers = new Hashtable(); | ||||
| // private ByteArrayOutputStream buffer = new ByteArrayOutputStream(); | |||||
| // private ByteArrayOutputStream buffer = new ByteArrayOutputStream(); | |||||
| private boolean skip = false; | private boolean skip = false; | ||||
| private boolean isErrorStream; | private boolean isErrorStream; | ||||
| private Project project; | private Project project; | ||||
| @@ -76,7 +76,7 @@ public class DemuxOutputStream extends OutputStream | |||||
| public void write( int cc ) | public void write( int cc ) | ||||
| throws IOException | throws IOException | ||||
| { | { | ||||
| final byte c = ( byte )cc; | |||||
| final byte c = (byte)cc; | |||||
| if( ( c == '\n' ) || ( c == '\r' ) ) | if( ( c == '\n' ) || ( c == '\r' ) ) | ||||
| { | { | ||||
| if( !skip ) | if( !skip ) | ||||
| @@ -96,7 +96,6 @@ public class DemuxOutputStream extends OutputStream | |||||
| skip = ( c == '\r' ); | skip = ( c == '\r' ); | ||||
| } | } | ||||
| /** | /** | ||||
| * Converts the buffer to a string and sends it to <code>processLine</code> | * Converts the buffer to a string and sends it to <code>processLine</code> | ||||
| */ | */ | ||||
| @@ -110,7 +109,7 @@ public class DemuxOutputStream extends OutputStream | |||||
| private ByteArrayOutputStream getBuffer() | private ByteArrayOutputStream getBuffer() | ||||
| { | { | ||||
| Thread current = Thread.currentThread(); | Thread current = Thread.currentThread(); | ||||
| ByteArrayOutputStream buffer = ( ByteArrayOutputStream )buffers.get( current ); | |||||
| ByteArrayOutputStream buffer = (ByteArrayOutputStream)buffers.get( current ); | |||||
| if( buffer == null ) | if( buffer == null ) | ||||
| { | { | ||||
| buffer = new ByteArrayOutputStream(); | buffer = new ByteArrayOutputStream(); | ||||
| @@ -765,7 +765,7 @@ public class IntrospectionHelper implements BuildListener | |||||
| { | { | ||||
| final File file = | final File file = | ||||
| FileUtils.newFileUtils().resolveFile( p.getBaseDir(), value ); | FileUtils.newFileUtils().resolveFile( p.getBaseDir(), value ); | ||||
| m.invoke( parent, new File[]{ file } ); | |||||
| m.invoke( parent, new File[]{file} ); | |||||
| } | } | ||||
| }; | }; | ||||
| @@ -6,6 +6,7 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.io.File; | import java.io.File; | ||||
| import java.util.NoSuchElementException; | import java.util.NoSuchElementException; | ||||
| import java.util.StringTokenizer; | import java.util.StringTokenizer; | ||||
| @@ -66,8 +67,8 @@ public class PathTokenizer | |||||
| } | } | ||||
| if( token.length() == 1 && Character.isLetter( token.charAt( 0 ) ) | if( token.length() == 1 && Character.isLetter( token.charAt( 0 ) ) | ||||
| && dosStyleFilesystem | |||||
| && tokenizer.hasMoreTokens() ) | |||||
| && dosStyleFilesystem | |||||
| && tokenizer.hasMoreTokens() ) | |||||
| { | { | ||||
| // we are on a dos style system so this path could be a drive | // we are on a dos style system so this path could be a drive | ||||
| // spec. We look at the next token | // spec. We look at the next token | ||||
| @@ -184,7 +184,7 @@ public class ProjectHelper | |||||
| if( endName < 0 ) | if( endName < 0 ) | ||||
| { | { | ||||
| throw new TaskException( "Syntax error in property: " | throw new TaskException( "Syntax error in property: " | ||||
| + value ); | |||||
| + value ); | |||||
| } | } | ||||
| String propertyName = value.substring( pos + 2, endName ); | String propertyName = value.substring( pos + 2, endName ); | ||||
| fragments.addElement( null ); | fragments.addElement( null ); | ||||
| @@ -6,12 +6,13 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.util.Enumeration; | import java.util.Enumeration; | ||||
| import java.util.Locale; | import java.util.Locale; | ||||
| import java.util.Vector; | import java.util.Vector; | ||||
| import org.apache.myrmidon.api.TaskException; | |||||
| import org.xml.sax.AttributeList; | import org.xml.sax.AttributeList; | ||||
| import org.xml.sax.helpers.AttributeListImpl; | import org.xml.sax.helpers.AttributeListImpl; | ||||
| import org.apache.myrmidon.api.TaskException; | |||||
| /** | /** | ||||
| * Wrapper class that holds the attributes of a Task (or elements nested below | * Wrapper class that holds the attributes of a Task (or elements nested below | ||||
| @@ -95,7 +96,6 @@ public class RuntimeConfigurable | |||||
| addText( new String( buf, start, end ) ); | addText( new String( buf, start, end ) ); | ||||
| } | } | ||||
| /** | /** | ||||
| * Configure the wrapped element and all children. | * Configure the wrapped element and all children. | ||||
| * | * | ||||
| @@ -121,10 +121,10 @@ public class RuntimeConfigurable | |||||
| Enumeration enum = children.elements(); | Enumeration enum = children.elements(); | ||||
| while( enum.hasMoreElements() ) | while( enum.hasMoreElements() ) | ||||
| { | { | ||||
| RuntimeConfigurable child = ( RuntimeConfigurable )enum.nextElement(); | |||||
| RuntimeConfigurable child = (RuntimeConfigurable)enum.nextElement(); | |||||
| if( child.wrappedObject instanceof Task ) | if( child.wrappedObject instanceof Task ) | ||||
| { | { | ||||
| Task childTask = ( Task )child.wrappedObject; | |||||
| Task childTask = (Task)child.wrappedObject; | |||||
| childTask.setRuntimeConfigurableWrapper( child ); | childTask.setRuntimeConfigurableWrapper( child ); | ||||
| childTask.maybeConfigure(); | childTask.maybeConfigure(); | ||||
| } | } | ||||
| @@ -154,7 +154,7 @@ public class RuntimeConfigurable | |||||
| */ | */ | ||||
| RuntimeConfigurable getChild( int index ) | RuntimeConfigurable getChild( int index ) | ||||
| { | { | ||||
| return ( RuntimeConfigurable )children.elementAt( index ); | |||||
| return (RuntimeConfigurable)children.elementAt( index ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -44,8 +44,8 @@ public class Target implements TaskContainer | |||||
| if( token.equals( "" ) || token.equals( "," ) ) | if( token.equals( "" ) || token.equals( "," ) ) | ||||
| { | { | ||||
| throw new TaskException( "Syntax Error: Depend attribute " + | throw new TaskException( "Syntax Error: Depend attribute " + | ||||
| "for target \"" + getName() + | |||||
| "\" has an empty string for dependency." ); | |||||
| "for target \"" + getName() + | |||||
| "\" has an empty string for dependency." ); | |||||
| } | } | ||||
| addDependency( token ); | addDependency( token ); | ||||
| @@ -58,8 +58,8 @@ public class Target implements TaskContainer | |||||
| if( !tok.hasMoreTokens() || !token.equals( "," ) ) | if( !tok.hasMoreTokens() || !token.equals( "," ) ) | ||||
| { | { | ||||
| throw new TaskException( "Syntax Error: Depend attribute " + | throw new TaskException( "Syntax Error: Depend attribute " + | ||||
| "for target \"" + getName() + | |||||
| "\" ends with a , character" ); | |||||
| "for target \"" + getName() + | |||||
| "\" ends with a , character" ); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -228,7 +228,7 @@ public class Target implements TaskContainer | |||||
| } | } | ||||
| private boolean testUnlessCondition() | private boolean testUnlessCondition() | ||||
| throws TaskException | |||||
| throws TaskException | |||||
| { | { | ||||
| if( "".equals( unlessCondition ) ) | if( "".equals( unlessCondition ) ) | ||||
| { | { | ||||
| @@ -7,9 +7,7 @@ | |||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.io.File; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.util.FileUtils; | |||||
| public abstract class Task | public abstract class Task | ||||
| extends ProjectComponent | extends ProjectComponent | ||||
| @@ -6,11 +6,10 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.lang.reflect.Method; | import java.lang.reflect.Method; | ||||
| import java.lang.reflect.Modifier; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| /** | /** | ||||
| * Use introspection to "adapt" an arbitrary Bean ( not extending Task, but with | * Use introspection to "adapt" an arbitrary Bean ( not extending Task, but with | ||||
| * similar patterns). | * similar patterns). | ||||
| @@ -34,7 +33,7 @@ public class TaskAdapter extends Task | |||||
| * @param project Description of Parameter | * @param project Description of Parameter | ||||
| */ | */ | ||||
| public static void checkTaskClass( final Class taskClass, final Project project ) | public static void checkTaskClass( final Class taskClass, final Project project ) | ||||
| throws TaskException | |||||
| throws TaskException | |||||
| { | { | ||||
| // don't have to check for interface, since then | // don't have to check for interface, since then | ||||
| // taskClass would be abstract too. | // taskClass would be abstract too. | ||||
| @@ -101,7 +100,7 @@ public class TaskAdapter extends Task | |||||
| catch( Exception ex ) | catch( Exception ex ) | ||||
| { | { | ||||
| log( "Error setting project in " + proxy.getClass(), | log( "Error setting project in " + proxy.getClass(), | ||||
| Project.MSG_ERR ); | |||||
| Project.MSG_ERR ); | |||||
| throw new BuildException( "Error", ex ); | throw new BuildException( "Error", ex ); | ||||
| } | } | ||||
| @@ -109,7 +108,7 @@ public class TaskAdapter extends Task | |||||
| try | try | ||||
| { | { | ||||
| Class c = proxy.getClass(); | Class c = proxy.getClass(); | ||||
| executeM = c.getMethod( "execute", new Class[0] ); | |||||
| executeM = c.getMethod( "execute", new Class[ 0 ] ); | |||||
| if( executeM == null ) | if( executeM == null ) | ||||
| { | { | ||||
| log( "No public execute() in " + proxy.getClass(), Project.MSG_ERR ); | log( "No public execute() in " + proxy.getClass(), Project.MSG_ERR ); | ||||
| @@ -51,11 +51,13 @@ public class Available | |||||
| } | } | ||||
| public void setClasspath( Path classpath ) | public void setClasspath( Path classpath ) | ||||
| throws TaskException | |||||
| { | { | ||||
| createClasspath().append( classpath ); | createClasspath().append( classpath ); | ||||
| } | } | ||||
| public void setClasspathRef( Reference r ) | public void setClasspathRef( Reference r ) | ||||
| throws TaskException | |||||
| { | { | ||||
| createClasspath().setRefid( r ); | createClasspath().setRefid( r ); | ||||
| } | } | ||||
| @@ -66,6 +68,7 @@ public class Available | |||||
| } | } | ||||
| public void setFilepath( Path filepath ) | public void setFilepath( Path filepath ) | ||||
| throws TaskException | |||||
| { | { | ||||
| createFilepath().append( filepath ); | createFilepath().append( filepath ); | ||||
| } | } | ||||
| @@ -91,6 +94,7 @@ public class Available | |||||
| } | } | ||||
| public Path createClasspath() | public Path createClasspath() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( this.classpath == null ) | if( this.classpath == null ) | ||||
| { | { | ||||
| @@ -100,6 +104,7 @@ public class Available | |||||
| } | } | ||||
| public Path createFilepath() | public Path createFilepath() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( this.filepath == null ) | if( this.filepath == null ) | ||||
| { | { | ||||
| @@ -32,6 +32,7 @@ public class BUnzip2 extends Unpack | |||||
| } | } | ||||
| protected void extract() | protected void extract() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( source.lastModified() > dest.lastModified() ) | if( source.lastModified() > dest.lastModified() ) | ||||
| { | { | ||||
| @@ -20,9 +20,11 @@ import org.apache.tools.bzip2.CBZip2OutputStream; | |||||
| * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | ||||
| */ | */ | ||||
| public class BZip2 extends Pack | |||||
| public class BZip2 | |||||
| extends Pack | |||||
| { | { | ||||
| protected void pack() | protected void pack() | ||||
| throws TaskException | |||||
| { | { | ||||
| CBZip2OutputStream zOut = null; | CBZip2OutputStream zOut = null; | ||||
| try | try | ||||
| @@ -294,6 +294,7 @@ public class Copy extends Task | |||||
| protected void buildMap( File fromDir, File toDir, String[] names, | protected void buildMap( File fromDir, File toDir, String[] names, | ||||
| FileNameMapper mapper, Hashtable map ) | FileNameMapper mapper, Hashtable map ) | ||||
| throws TaskException | |||||
| { | { | ||||
| String[] toCopy = null; | String[] toCopy = null; | ||||
| @@ -413,6 +414,7 @@ public class Copy extends Task | |||||
| * @param dirs Description of Parameter | * @param dirs Description of Parameter | ||||
| */ | */ | ||||
| protected void scan( File fromDir, File toDir, String[] files, String[] dirs ) | protected void scan( File fromDir, File toDir, String[] files, String[] dirs ) | ||||
| throws TaskException | |||||
| { | { | ||||
| FileNameMapper mapper = null; | FileNameMapper mapper = null; | ||||
| if( mapperElement != null ) | if( mapperElement != null ) | ||||
| @@ -73,6 +73,7 @@ public class Delete extends MatchingTask | |||||
| * @param excludes the string containing the exclude patterns | * @param excludes the string containing the exclude patterns | ||||
| */ | */ | ||||
| public void setExcludes( String excludes ) | public void setExcludes( String excludes ) | ||||
| throws TaskException | |||||
| { | { | ||||
| usedMatchingTask = true; | usedMatchingTask = true; | ||||
| super.setExcludes( excludes ); | super.setExcludes( excludes ); | ||||
| @@ -85,6 +86,7 @@ public class Delete extends MatchingTask | |||||
| * patterns from. | * patterns from. | ||||
| */ | */ | ||||
| public void setExcludesfile( File excludesfile ) | public void setExcludesfile( File excludesfile ) | ||||
| throws TaskException | |||||
| { | { | ||||
| usedMatchingTask = true; | usedMatchingTask = true; | ||||
| super.setExcludesfile( excludesfile ); | super.setExcludesfile( excludesfile ); | ||||
| @@ -127,6 +129,7 @@ public class Delete extends MatchingTask | |||||
| * @param includes the string containing the include patterns | * @param includes the string containing the include patterns | ||||
| */ | */ | ||||
| public void setIncludes( String includes ) | public void setIncludes( String includes ) | ||||
| throws TaskException | |||||
| { | { | ||||
| usedMatchingTask = true; | usedMatchingTask = true; | ||||
| super.setIncludes( includes ); | super.setIncludes( includes ); | ||||
| @@ -139,6 +142,7 @@ public class Delete extends MatchingTask | |||||
| * patterns from. | * patterns from. | ||||
| */ | */ | ||||
| public void setIncludesfile( File includesfile ) | public void setIncludesfile( File includesfile ) | ||||
| throws TaskException | |||||
| { | { | ||||
| usedMatchingTask = true; | usedMatchingTask = true; | ||||
| super.setIncludesfile( includesfile ); | super.setIncludesfile( includesfile ); | ||||
| @@ -195,6 +199,7 @@ public class Delete extends MatchingTask | |||||
| * @return Description of the Returned Value | * @return Description of the Returned Value | ||||
| */ | */ | ||||
| public PatternSet.NameEntry createExclude() | public PatternSet.NameEntry createExclude() | ||||
| throws TaskException | |||||
| { | { | ||||
| usedMatchingTask = true; | usedMatchingTask = true; | ||||
| return super.createExclude(); | return super.createExclude(); | ||||
| @@ -206,6 +211,7 @@ public class Delete extends MatchingTask | |||||
| * @return Description of the Returned Value | * @return Description of the Returned Value | ||||
| */ | */ | ||||
| public PatternSet.NameEntry createInclude() | public PatternSet.NameEntry createInclude() | ||||
| throws TaskException | |||||
| { | { | ||||
| usedMatchingTask = true; | usedMatchingTask = true; | ||||
| return super.createInclude(); | return super.createInclude(); | ||||
| @@ -229,7 +229,7 @@ public class ExecTask extends Task | |||||
| * @exception IOException Description of Exception | * @exception IOException Description of Exception | ||||
| */ | */ | ||||
| protected final void runExecute( Execute exe ) | protected final void runExecute( Execute exe ) | ||||
| throws IOException | |||||
| throws IOException, TaskException | |||||
| { | { | ||||
| int err = -1;// assume the worst | int err = -1;// assume the worst | ||||
| @@ -179,6 +179,7 @@ public class Execute | |||||
| * @return The ProcEnvironment value | * @return The ProcEnvironment value | ||||
| */ | */ | ||||
| public static synchronized Vector getProcEnvironment() | public static synchronized Vector getProcEnvironment() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( procEnvironment != null ) | if( procEnvironment != null ) | ||||
| return procEnvironment; | return procEnvironment; | ||||
| @@ -405,6 +406,7 @@ public class Execute | |||||
| * @return the environment used to create a subprocess | * @return the environment used to create a subprocess | ||||
| */ | */ | ||||
| public String[] getEnvironment() | public String[] getEnvironment() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( env == null || newEnvironment ) | if( env == null || newEnvironment ) | ||||
| return env; | return env; | ||||
| @@ -505,6 +507,7 @@ public class Execute | |||||
| * @return the patched environment | * @return the patched environment | ||||
| */ | */ | ||||
| private String[] patchEnvironment() | private String[] patchEnvironment() | ||||
| throws TaskException | |||||
| { | { | ||||
| Vector osEnv = (Vector)getProcEnvironment().clone(); | Vector osEnv = (Vector)getProcEnvironment().clone(); | ||||
| for( int i = 0; i < env.length; i++ ) | for( int i = 0; i < env.length; i++ ) | ||||
| @@ -681,7 +684,7 @@ public class Execute | |||||
| * @exception IOException Description of Exception | * @exception IOException Description of Exception | ||||
| */ | */ | ||||
| public Process exec( Project project, String[] cmd, String[] env, File workingDir ) | public Process exec( Project project, String[] cmd, String[] env, File workingDir ) | ||||
| throws IOException | |||||
| throws IOException, TaskException | |||||
| { | { | ||||
| try | try | ||||
| { | { | ||||
| @@ -305,6 +305,7 @@ public class ExecuteOn extends ExecTask | |||||
| * @return The Dirs value | * @return The Dirs value | ||||
| */ | */ | ||||
| protected String[] getDirs( File baseDir, DirectoryScanner ds ) | protected String[] getDirs( File baseDir, DirectoryScanner ds ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( mapper != null ) | if( mapper != null ) | ||||
| { | { | ||||
| @@ -327,6 +328,7 @@ public class ExecuteOn extends ExecTask | |||||
| * @return The Files value | * @return The Files value | ||||
| */ | */ | ||||
| protected String[] getFiles( File baseDir, DirectoryScanner ds ) | protected String[] getFiles( File baseDir, DirectoryScanner ds ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( mapper != null ) | if( mapper != null ) | ||||
| { | { | ||||
| @@ -32,6 +32,7 @@ public class GUnzip extends Unpack | |||||
| } | } | ||||
| protected void extract() | protected void extract() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( source.lastModified() > dest.lastModified() ) | if( source.lastModified() > dest.lastModified() ) | ||||
| { | { | ||||
| @@ -20,10 +20,11 @@ import org.apache.myrmidon.api.TaskException; | |||||
| * @author Jon S. Stevens <a href="mailto:jon@clearink.com">jon@clearink.com</a> | * @author Jon S. Stevens <a href="mailto:jon@clearink.com">jon@clearink.com</a> | ||||
| * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | ||||
| */ | */ | ||||
| public class GZip extends Pack | |||||
| public class GZip | |||||
| extends Pack | |||||
| { | { | ||||
| protected void pack() | protected void pack() | ||||
| throws TaskException | |||||
| { | { | ||||
| GZIPOutputStream zOut = null; | GZIPOutputStream zOut = null; | ||||
| try | try | ||||
| @@ -49,6 +49,7 @@ public class GenerateKey extends Task | |||||
| } | } | ||||
| public void setDname( final String dname ) | public void setDname( final String dname ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( null != expandedDname ) | if( null != expandedDname ) | ||||
| { | { | ||||
| @@ -849,6 +849,7 @@ public class Javac extends MatchingTask | |||||
| * @param files Description of Parameter | * @param files Description of Parameter | ||||
| */ | */ | ||||
| protected void scanDir( File srcDir, File destDir, String files[] ) | protected void scanDir( File srcDir, File destDir, String files[] ) | ||||
| throws TaskException | |||||
| { | { | ||||
| GlobPatternMapper m = new GlobPatternMapper(); | GlobPatternMapper m = new GlobPatternMapper(); | ||||
| m.setFrom( "*.java" ); | m.setFrom( "*.java" ); | ||||
| @@ -16,9 +16,9 @@ import org.apache.tools.ant.Task; | |||||
| * | * | ||||
| * @author thomas.haas@softwired-inc.com | * @author thomas.haas@softwired-inc.com | ||||
| */ | */ | ||||
| public class LogStreamHandler extends PumpStreamHandler | |||||
| public class LogStreamHandler | |||||
| extends PumpStreamHandler | |||||
| { | { | ||||
| /** | /** | ||||
| * Creates a new instance of this class. | * Creates a new instance of this class. | ||||
| * | * | ||||
| @@ -33,6 +33,7 @@ public class LogStreamHandler extends PumpStreamHandler | |||||
| } | } | ||||
| public void stop() | public void stop() | ||||
| throws TaskException | |||||
| { | { | ||||
| super.stop(); | super.stop(); | ||||
| try | try | ||||
| @@ -361,6 +361,7 @@ public class Manifest extends Task | |||||
| catch( IOException e ) | catch( IOException e ) | ||||
| { | { | ||||
| throw new TaskException( "Failed to write " + manifestFile | throw new TaskException( "Failed to write " + manifestFile | ||||
| e ); | e ); | ||||
| } | } | ||||
| finally | finally | ||||
| @@ -50,6 +50,7 @@ public abstract class MatchingTask extends Task | |||||
| * @param excludes the string containing the exclude patterns | * @param excludes the string containing the exclude patterns | ||||
| */ | */ | ||||
| public void setExcludes( String excludes ) | public void setExcludes( String excludes ) | ||||
| throws TaskException | |||||
| { | { | ||||
| fileset.setExcludes( excludes ); | fileset.setExcludes( excludes ); | ||||
| } | } | ||||
| @@ -61,6 +62,7 @@ public abstract class MatchingTask extends Task | |||||
| * patterns from. | * patterns from. | ||||
| */ | */ | ||||
| public void setExcludesfile( File excludesfile ) | public void setExcludesfile( File excludesfile ) | ||||
| throws TaskException | |||||
| { | { | ||||
| fileset.setExcludesfile( excludesfile ); | fileset.setExcludesfile( excludesfile ); | ||||
| } | } | ||||
| @@ -72,6 +74,7 @@ public abstract class MatchingTask extends Task | |||||
| * @param includes the string containing the include patterns | * @param includes the string containing the include patterns | ||||
| */ | */ | ||||
| public void setIncludes( String includes ) | public void setIncludes( String includes ) | ||||
| throws TaskException | |||||
| { | { | ||||
| fileset.setIncludes( includes ); | fileset.setIncludes( includes ); | ||||
| } | } | ||||
| @@ -83,6 +86,7 @@ public abstract class MatchingTask extends Task | |||||
| * patterns from. | * patterns from. | ||||
| */ | */ | ||||
| public void setIncludesfile( File includesfile ) | public void setIncludesfile( File includesfile ) | ||||
| throws TaskException | |||||
| { | { | ||||
| fileset.setIncludesfile( includesfile ); | fileset.setIncludesfile( includesfile ); | ||||
| } | } | ||||
| @@ -93,6 +97,7 @@ public abstract class MatchingTask extends Task | |||||
| * @return Description of the Returned Value | * @return Description of the Returned Value | ||||
| */ | */ | ||||
| public PatternSet.NameEntry createExclude() | public PatternSet.NameEntry createExclude() | ||||
| throws TaskException | |||||
| { | { | ||||
| return fileset.createExclude(); | return fileset.createExclude(); | ||||
| } | } | ||||
| @@ -103,6 +108,7 @@ public abstract class MatchingTask extends Task | |||||
| * @return Description of the Returned Value | * @return Description of the Returned Value | ||||
| */ | */ | ||||
| public PatternSet.NameEntry createExcludesFile() | public PatternSet.NameEntry createExcludesFile() | ||||
| throws TaskException | |||||
| { | { | ||||
| return fileset.createExcludesFile(); | return fileset.createExcludesFile(); | ||||
| } | } | ||||
| @@ -113,6 +119,7 @@ public abstract class MatchingTask extends Task | |||||
| * @return Description of the Returned Value | * @return Description of the Returned Value | ||||
| */ | */ | ||||
| public PatternSet.NameEntry createInclude() | public PatternSet.NameEntry createInclude() | ||||
| throws TaskException | |||||
| { | { | ||||
| return fileset.createInclude(); | return fileset.createInclude(); | ||||
| } | } | ||||
| @@ -123,6 +130,7 @@ public abstract class MatchingTask extends Task | |||||
| * @return Description of the Returned Value | * @return Description of the Returned Value | ||||
| */ | */ | ||||
| public PatternSet.NameEntry createIncludesFile() | public PatternSet.NameEntry createIncludesFile() | ||||
| throws TaskException | |||||
| { | { | ||||
| return fileset.createIncludesFile(); | return fileset.createIncludesFile(); | ||||
| } | } | ||||
| @@ -62,6 +62,7 @@ public abstract class Pack extends Task | |||||
| } | } | ||||
| private void validate() | private void validate() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( zipFile == null ) | if( zipFile == null ) | ||||
| { | { | ||||
| @@ -225,6 +225,7 @@ public class Property extends Task | |||||
| } | } | ||||
| protected void loadEnvironment( String prefix ) | protected void loadEnvironment( String prefix ) | ||||
| throws TaskException | |||||
| { | { | ||||
| Properties props = new Properties(); | Properties props = new Properties(); | ||||
| if( !prefix.endsWith( "." ) ) | if( !prefix.endsWith( "." ) ) | ||||
| @@ -10,6 +10,7 @@ package org.apache.tools.ant.taskdefs; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.io.InputStream; | import java.io.InputStream; | ||||
| import java.io.OutputStream; | import java.io.OutputStream; | ||||
| import org.apache.myrmidon.api.TaskException; | |||||
| /** | /** | ||||
| * Copies standard output and error of subprocesses to standard output and error | * Copies standard output and error of subprocesses to standard output and error | ||||
| @@ -63,6 +64,7 @@ public class PumpStreamHandler implements ExecuteStreamHandler | |||||
| } | } | ||||
| public void stop() | public void stop() | ||||
| throws TaskException | |||||
| { | { | ||||
| try | try | ||||
| { | { | ||||
| @@ -607,6 +607,7 @@ public class Rmic extends MatchingTask | |||||
| */ | */ | ||||
| protected void scanDir( File baseDir, String files[], | protected void scanDir( File baseDir, String files[], | ||||
| FileNameMapper mapper ) | FileNameMapper mapper ) | ||||
| throws TaskException | |||||
| { | { | ||||
| String[] newFiles = files; | String[] newFiles = files; | ||||
| @@ -212,6 +212,7 @@ public class Tar extends MatchingTask | |||||
| } | } | ||||
| protected boolean archiveIsUpToDate( String[] files ) | protected boolean archiveIsUpToDate( String[] files ) | ||||
| throws TaskException | |||||
| { | { | ||||
| SourceFileScanner sfs = new SourceFileScanner( this ); | SourceFileScanner sfs = new SourceFileScanner( this ); | ||||
| MergingMapper mm = new MergingMapper(); | MergingMapper mm = new MergingMapper(); | ||||
| @@ -161,6 +161,7 @@ public class UpToDate extends MatchingTask implements Condition | |||||
| } | } | ||||
| protected boolean scanDir( File srcDir, String files[] ) | protected boolean scanDir( File srcDir, String files[] ) | ||||
| throws TaskException | |||||
| { | { | ||||
| SourceFileScanner sfs = new SourceFileScanner( this ); | SourceFileScanner sfs = new SourceFileScanner( this ); | ||||
| FileNameMapper mapper = null; | FileNameMapper mapper = null; | ||||
| @@ -52,6 +52,7 @@ public class FileList extends DataType | |||||
| } | } | ||||
| public void setFiles( String filenames ) | public void setFiles( String filenames ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( isReference() ) | if( isReference() ) | ||||
| { | { | ||||
| @@ -88,6 +89,7 @@ public class FileList extends DataType | |||||
| } | } | ||||
| public File getDir( Project p ) | public File getDir( Project p ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( isReference() ) | if( isReference() ) | ||||
| { | { | ||||
| @@ -103,6 +105,7 @@ public class FileList extends DataType | |||||
| * @return The Files value | * @return The Files value | ||||
| */ | */ | ||||
| public String[] getFiles( Project p ) | public String[] getFiles( Project p ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( isReference() ) | if( isReference() ) | ||||
| { | { | ||||
| @@ -132,6 +135,7 @@ public class FileList extends DataType | |||||
| * @return The Ref value | * @return The Ref value | ||||
| */ | */ | ||||
| protected FileList getRef( Project p ) | protected FileList getRef( Project p ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( !checked ) | if( !checked ) | ||||
| { | { | ||||
| @@ -22,7 +22,8 @@ import org.apache.tools.ant.Project; | |||||
| * mattinger@mindless.com</a> | * mattinger@mindless.com</a> | ||||
| * @see org.apache.oro.text.regex.Perl5Substitition | * @see org.apache.oro.text.regex.Perl5Substitition | ||||
| */ | */ | ||||
| public class Substitution extends DataType | |||||
| public class Substitution | |||||
| extends DataType | |||||
| { | { | ||||
| public final static String DATA_TYPE_NAME = "substitition"; | public final static String DATA_TYPE_NAME = "substitition"; | ||||
| @@ -45,9 +46,12 @@ public class Substitution extends DataType | |||||
| * @return The Expression value | * @return The Expression value | ||||
| */ | */ | ||||
| public String getExpression( Project p ) | public String getExpression( Project p ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( isReference() ) | if( isReference() ) | ||||
| { | |||||
| return getRef( p ).getExpression( p ); | return getRef( p ).getExpression( p ); | ||||
| } | |||||
| return expression; | return expression; | ||||
| } | } | ||||
| @@ -60,6 +64,7 @@ public class Substitution extends DataType | |||||
| * @return The Ref value | * @return The Ref value | ||||
| */ | */ | ||||
| public Substitution getRef( Project p ) | public Substitution getRef( Project p ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( !checked ) | if( !checked ) | ||||
| { | { | ||||
| @@ -79,5 +84,4 @@ public class Substitution extends DataType | |||||
| return (Substitution)o; | return (Substitution)o; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -27,9 +27,9 @@ import org.apache.tools.ant.Project; | |||||
| * | * | ||||
| * @author Don Ferguson <a href="mailto:don@bea.com">don@bea.com</a> | * @author Don Ferguson <a href="mailto:don@bea.com">don@bea.com</a> | ||||
| */ | */ | ||||
| public class ZipFileSet extends FileSet | |||||
| public class ZipFileSet | |||||
| extends FileSet | |||||
| { | { | ||||
| private File srcFile = null; | private File srcFile = null; | ||||
| private String prefix = ""; | private String prefix = ""; | ||||
| private String fullpath = ""; | private String fullpath = ""; | ||||
| @@ -84,6 +84,7 @@ public class ZipFileSet extends FileSet | |||||
| * @param srcFile The zip file from which to extract entries. | * @param srcFile The zip file from which to extract entries. | ||||
| */ | */ | ||||
| public void setSrc( File srcFile ) | public void setSrc( File srcFile ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( hasDir ) | if( hasDir ) | ||||
| { | { | ||||
| @@ -153,5 +154,4 @@ public class ZipFileSet extends FileSet | |||||
| { | { | ||||
| return srcFile; | return srcFile; | ||||
| } | } | ||||
| } | } | ||||
| @@ -9,6 +9,7 @@ package org.apache.tools.ant.util; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.util.Vector; | import java.util.Vector; | ||||
| import org.apache.myrmidon.api.TaskException; | |||||
| import org.apache.myrmidon.framework.Os; | import org.apache.myrmidon.framework.Os; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| @@ -53,6 +54,7 @@ public class SourceFileScanner | |||||
| */ | */ | ||||
| public String[] restrict( String[] files, File srcDir, File destDir, | public String[] restrict( String[] files, File srcDir, File destDir, | ||||
| FileNameMapper mapper ) | FileNameMapper mapper ) | ||||
| throws TaskException | |||||
| { | { | ||||
| long now = ( new java.util.Date() ).getTime(); | long now = ( new java.util.Date() ).getTime(); | ||||
| @@ -146,6 +148,7 @@ public class SourceFileScanner | |||||
| */ | */ | ||||
| public File[] restrictAsFiles( String[] files, File srcDir, File destDir, | public File[] restrictAsFiles( String[] files, File srcDir, File destDir, | ||||
| FileNameMapper mapper ) | FileNameMapper mapper ) | ||||
| throws TaskException | |||||
| { | { | ||||
| String[] res = restrict( files, srcDir, destDir, mapper ); | String[] res = restrict( files, srcDir, destDir, mapper ); | ||||
| File[] result = new File[ res.length ]; | File[] result = new File[ res.length ]; | ||||
| @@ -128,7 +128,7 @@ public class AntClassLoader extends ClassLoader implements BuildListener | |||||
| * value of ${build.sysclasspath} | * value of ${build.sysclasspath} | ||||
| */ | */ | ||||
| public AntClassLoader( Project project, Path classpath ) | public AntClassLoader( Project project, Path classpath ) | ||||
| throws TaskException | |||||
| throws TaskException | |||||
| { | { | ||||
| parent = AntClassLoader.class.getClassLoader(); | parent = AntClassLoader.class.getClassLoader(); | ||||
| this.project = project; | this.project = project; | ||||
| @@ -163,7 +163,7 @@ public class AntClassLoader extends ClassLoader implements BuildListener | |||||
| */ | */ | ||||
| public AntClassLoader( ClassLoader parent, Project project, Path classpath, | public AntClassLoader( ClassLoader parent, Project project, Path classpath, | ||||
| boolean parentFirst ) | boolean parentFirst ) | ||||
| throws TaskException | |||||
| throws TaskException | |||||
| { | { | ||||
| this( project, classpath ); | this( project, classpath ); | ||||
| if( parent != null ) | if( parent != null ) | ||||
| @@ -184,7 +184,7 @@ public class AntClassLoader extends ClassLoader implements BuildListener | |||||
| * be consulted before trying to load the a class through this loader. | * be consulted before trying to load the a class through this loader. | ||||
| */ | */ | ||||
| public AntClassLoader( Project project, Path classpath, boolean parentFirst ) | public AntClassLoader( Project project, Path classpath, boolean parentFirst ) | ||||
| throws TaskException | |||||
| throws TaskException | |||||
| { | { | ||||
| this( null, project, classpath, parentFirst ); | this( null, project, classpath, parentFirst ); | ||||
| } | } | ||||
| @@ -539,7 +539,7 @@ public class AntClassLoader extends ClassLoader implements BuildListener | |||||
| * Reset the current thread's context loader to its original value | * Reset the current thread's context loader to its original value | ||||
| */ | */ | ||||
| public void resetThreadContextLoader() | public void resetThreadContextLoader() | ||||
| throws TaskException | |||||
| throws TaskException | |||||
| { | { | ||||
| if( isContextLoaderSaved && | if( isContextLoaderSaved && | ||||
| getContextClassLoader != null && setContextClassLoader != null ) | getContextClassLoader != null && setContextClassLoader != null ) | ||||
| @@ -6,6 +6,7 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.util.EventObject; | import java.util.EventObject; | ||||
| public class BuildEvent extends EventObject | public class BuildEvent extends EventObject | ||||
| @@ -6,6 +6,7 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.util.EventListener; | import java.util.EventListener; | ||||
| /** | /** | ||||
| @@ -6,6 +6,7 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.io.PrintStream; | import java.io.PrintStream; | ||||
| /** | /** | ||||
| @@ -6,9 +6,8 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.io.PrintStream; | import java.io.PrintStream; | ||||
| import java.io.PrintWriter; | |||||
| import java.io.StringWriter; | |||||
| import org.apache.tools.ant.util.StringUtils; | import org.apache.tools.ant.util.StringUtils; | ||||
| /** | /** | ||||
| @@ -36,14 +35,14 @@ public class DefaultLogger implements BuildLogger | |||||
| if( minutes > 0 ) | if( minutes > 0 ) | ||||
| { | { | ||||
| return Long.toString( minutes ) + " minute" | return Long.toString( minutes ) + " minute" | ||||
| + ( minutes == 1 ? " " : "s " ) | |||||
| + Long.toString( seconds % 60 ) + " second" | |||||
| + ( seconds % 60 == 1 ? "" : "s" ); | |||||
| + ( minutes == 1 ? " " : "s " ) | |||||
| + Long.toString( seconds % 60 ) + " second" | |||||
| + ( seconds % 60 == 1 ? "" : "s" ); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| return Long.toString( seconds ) + " second" | return Long.toString( seconds ) + " second" | ||||
| + ( seconds % 60 == 1 ? "" : "s" ); | |||||
| + ( seconds % 60 == 1 ? "" : "s" ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -137,7 +136,7 @@ public class DefaultLogger implements BuildLogger | |||||
| } | } | ||||
| message.append( StringUtils.LINE_SEP ); | message.append( StringUtils.LINE_SEP ); | ||||
| message.append( "Total time: " | message.append( "Total time: " | ||||
| + formatTime( System.currentTimeMillis() - startTime ) ); | |||||
| + formatTime( System.currentTimeMillis() - startTime ) ); | |||||
| String msg = message.toString(); | String msg = message.toString(); | ||||
| if( error == null ) | if( error == null ) | ||||
| @@ -193,7 +192,9 @@ public class DefaultLogger implements BuildLogger | |||||
| } | } | ||||
| } | } | ||||
| public void targetFinished( BuildEvent event ) { } | |||||
| public void targetFinished( BuildEvent event ) | |||||
| { | |||||
| } | |||||
| public void targetStarted( BuildEvent event ) | public void targetStarted( BuildEvent event ) | ||||
| { | { | ||||
| @@ -205,9 +206,13 @@ public class DefaultLogger implements BuildLogger | |||||
| } | } | ||||
| } | } | ||||
| public void taskFinished( BuildEvent event ) { } | |||||
| public void taskFinished( BuildEvent event ) | |||||
| { | |||||
| } | |||||
| public void taskStarted( BuildEvent event ) { } | |||||
| public void taskStarted( BuildEvent event ) | |||||
| { | |||||
| } | |||||
| /** | /** | ||||
| * Empty implementation which allows subclasses to receive the same output | * Empty implementation which allows subclasses to receive the same output | ||||
| @@ -215,6 +220,8 @@ public class DefaultLogger implements BuildLogger | |||||
| * | * | ||||
| * @param message Description of Parameter | * @param message Description of Parameter | ||||
| */ | */ | ||||
| protected void log( String message ) { } | |||||
| protected void log( String message ) | |||||
| { | |||||
| } | |||||
| } | } | ||||
| @@ -6,12 +6,12 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.io.ByteArrayOutputStream; | import java.io.ByteArrayOutputStream; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.io.OutputStream; | import java.io.OutputStream; | ||||
| import java.util.Hashtable; | import java.util.Hashtable; | ||||
| /** | /** | ||||
| * Logs content written by a thread and forwards the buffers onto the project | * Logs content written by a thread and forwards the buffers onto the project | ||||
| * object which will forward the content to the appropriate task | * object which will forward the content to the appropriate task | ||||
| @@ -24,7 +24,7 @@ public class DemuxOutputStream extends OutputStream | |||||
| private final static int MAX_SIZE = 1024; | private final static int MAX_SIZE = 1024; | ||||
| private Hashtable buffers = new Hashtable(); | private Hashtable buffers = new Hashtable(); | ||||
| // private ByteArrayOutputStream buffer = new ByteArrayOutputStream(); | |||||
| // private ByteArrayOutputStream buffer = new ByteArrayOutputStream(); | |||||
| private boolean skip = false; | private boolean skip = false; | ||||
| private boolean isErrorStream; | private boolean isErrorStream; | ||||
| private Project project; | private Project project; | ||||
| @@ -76,7 +76,7 @@ public class DemuxOutputStream extends OutputStream | |||||
| public void write( int cc ) | public void write( int cc ) | ||||
| throws IOException | throws IOException | ||||
| { | { | ||||
| final byte c = ( byte )cc; | |||||
| final byte c = (byte)cc; | |||||
| if( ( c == '\n' ) || ( c == '\r' ) ) | if( ( c == '\n' ) || ( c == '\r' ) ) | ||||
| { | { | ||||
| if( !skip ) | if( !skip ) | ||||
| @@ -96,7 +96,6 @@ public class DemuxOutputStream extends OutputStream | |||||
| skip = ( c == '\r' ); | skip = ( c == '\r' ); | ||||
| } | } | ||||
| /** | /** | ||||
| * Converts the buffer to a string and sends it to <code>processLine</code> | * Converts the buffer to a string and sends it to <code>processLine</code> | ||||
| */ | */ | ||||
| @@ -110,7 +109,7 @@ public class DemuxOutputStream extends OutputStream | |||||
| private ByteArrayOutputStream getBuffer() | private ByteArrayOutputStream getBuffer() | ||||
| { | { | ||||
| Thread current = Thread.currentThread(); | Thread current = Thread.currentThread(); | ||||
| ByteArrayOutputStream buffer = ( ByteArrayOutputStream )buffers.get( current ); | |||||
| ByteArrayOutputStream buffer = (ByteArrayOutputStream)buffers.get( current ); | |||||
| if( buffer == null ) | if( buffer == null ) | ||||
| { | { | ||||
| buffer = new ByteArrayOutputStream(); | buffer = new ByteArrayOutputStream(); | ||||
| @@ -765,7 +765,7 @@ public class IntrospectionHelper implements BuildListener | |||||
| { | { | ||||
| final File file = | final File file = | ||||
| FileUtils.newFileUtils().resolveFile( p.getBaseDir(), value ); | FileUtils.newFileUtils().resolveFile( p.getBaseDir(), value ); | ||||
| m.invoke( parent, new File[]{ file } ); | |||||
| m.invoke( parent, new File[]{file} ); | |||||
| } | } | ||||
| }; | }; | ||||
| @@ -6,6 +6,7 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.io.File; | import java.io.File; | ||||
| import java.util.NoSuchElementException; | import java.util.NoSuchElementException; | ||||
| import java.util.StringTokenizer; | import java.util.StringTokenizer; | ||||
| @@ -66,8 +67,8 @@ public class PathTokenizer | |||||
| } | } | ||||
| if( token.length() == 1 && Character.isLetter( token.charAt( 0 ) ) | if( token.length() == 1 && Character.isLetter( token.charAt( 0 ) ) | ||||
| && dosStyleFilesystem | |||||
| && tokenizer.hasMoreTokens() ) | |||||
| && dosStyleFilesystem | |||||
| && tokenizer.hasMoreTokens() ) | |||||
| { | { | ||||
| // we are on a dos style system so this path could be a drive | // we are on a dos style system so this path could be a drive | ||||
| // spec. We look at the next token | // spec. We look at the next token | ||||
| @@ -184,7 +184,7 @@ public class ProjectHelper | |||||
| if( endName < 0 ) | if( endName < 0 ) | ||||
| { | { | ||||
| throw new TaskException( "Syntax error in property: " | throw new TaskException( "Syntax error in property: " | ||||
| + value ); | |||||
| + value ); | |||||
| } | } | ||||
| String propertyName = value.substring( pos + 2, endName ); | String propertyName = value.substring( pos + 2, endName ); | ||||
| fragments.addElement( null ); | fragments.addElement( null ); | ||||
| @@ -6,12 +6,13 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.util.Enumeration; | import java.util.Enumeration; | ||||
| import java.util.Locale; | import java.util.Locale; | ||||
| import java.util.Vector; | import java.util.Vector; | ||||
| import org.apache.myrmidon.api.TaskException; | |||||
| import org.xml.sax.AttributeList; | import org.xml.sax.AttributeList; | ||||
| import org.xml.sax.helpers.AttributeListImpl; | import org.xml.sax.helpers.AttributeListImpl; | ||||
| import org.apache.myrmidon.api.TaskException; | |||||
| /** | /** | ||||
| * Wrapper class that holds the attributes of a Task (or elements nested below | * Wrapper class that holds the attributes of a Task (or elements nested below | ||||
| @@ -95,7 +96,6 @@ public class RuntimeConfigurable | |||||
| addText( new String( buf, start, end ) ); | addText( new String( buf, start, end ) ); | ||||
| } | } | ||||
| /** | /** | ||||
| * Configure the wrapped element and all children. | * Configure the wrapped element and all children. | ||||
| * | * | ||||
| @@ -121,10 +121,10 @@ public class RuntimeConfigurable | |||||
| Enumeration enum = children.elements(); | Enumeration enum = children.elements(); | ||||
| while( enum.hasMoreElements() ) | while( enum.hasMoreElements() ) | ||||
| { | { | ||||
| RuntimeConfigurable child = ( RuntimeConfigurable )enum.nextElement(); | |||||
| RuntimeConfigurable child = (RuntimeConfigurable)enum.nextElement(); | |||||
| if( child.wrappedObject instanceof Task ) | if( child.wrappedObject instanceof Task ) | ||||
| { | { | ||||
| Task childTask = ( Task )child.wrappedObject; | |||||
| Task childTask = (Task)child.wrappedObject; | |||||
| childTask.setRuntimeConfigurableWrapper( child ); | childTask.setRuntimeConfigurableWrapper( child ); | ||||
| childTask.maybeConfigure(); | childTask.maybeConfigure(); | ||||
| } | } | ||||
| @@ -154,7 +154,7 @@ public class RuntimeConfigurable | |||||
| */ | */ | ||||
| RuntimeConfigurable getChild( int index ) | RuntimeConfigurable getChild( int index ) | ||||
| { | { | ||||
| return ( RuntimeConfigurable )children.elementAt( index ); | |||||
| return (RuntimeConfigurable)children.elementAt( index ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -44,8 +44,8 @@ public class Target implements TaskContainer | |||||
| if( token.equals( "" ) || token.equals( "," ) ) | if( token.equals( "" ) || token.equals( "," ) ) | ||||
| { | { | ||||
| throw new TaskException( "Syntax Error: Depend attribute " + | throw new TaskException( "Syntax Error: Depend attribute " + | ||||
| "for target \"" + getName() + | |||||
| "\" has an empty string for dependency." ); | |||||
| "for target \"" + getName() + | |||||
| "\" has an empty string for dependency." ); | |||||
| } | } | ||||
| addDependency( token ); | addDependency( token ); | ||||
| @@ -58,8 +58,8 @@ public class Target implements TaskContainer | |||||
| if( !tok.hasMoreTokens() || !token.equals( "," ) ) | if( !tok.hasMoreTokens() || !token.equals( "," ) ) | ||||
| { | { | ||||
| throw new TaskException( "Syntax Error: Depend attribute " + | throw new TaskException( "Syntax Error: Depend attribute " + | ||||
| "for target \"" + getName() + | |||||
| "\" ends with a , character" ); | |||||
| "for target \"" + getName() + | |||||
| "\" ends with a , character" ); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -228,7 +228,7 @@ public class Target implements TaskContainer | |||||
| } | } | ||||
| private boolean testUnlessCondition() | private boolean testUnlessCondition() | ||||
| throws TaskException | |||||
| throws TaskException | |||||
| { | { | ||||
| if( "".equals( unlessCondition ) ) | if( "".equals( unlessCondition ) ) | ||||
| { | { | ||||
| @@ -7,9 +7,7 @@ | |||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.io.File; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.util.FileUtils; | |||||
| public abstract class Task | public abstract class Task | ||||
| extends ProjectComponent | extends ProjectComponent | ||||
| @@ -6,11 +6,10 @@ | |||||
| * the LICENSE file. | * the LICENSE file. | ||||
| */ | */ | ||||
| package org.apache.tools.ant; | package org.apache.tools.ant; | ||||
| import java.lang.reflect.Method; | import java.lang.reflect.Method; | ||||
| import java.lang.reflect.Modifier; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| /** | /** | ||||
| * Use introspection to "adapt" an arbitrary Bean ( not extending Task, but with | * Use introspection to "adapt" an arbitrary Bean ( not extending Task, but with | ||||
| * similar patterns). | * similar patterns). | ||||
| @@ -34,7 +33,7 @@ public class TaskAdapter extends Task | |||||
| * @param project Description of Parameter | * @param project Description of Parameter | ||||
| */ | */ | ||||
| public static void checkTaskClass( final Class taskClass, final Project project ) | public static void checkTaskClass( final Class taskClass, final Project project ) | ||||
| throws TaskException | |||||
| throws TaskException | |||||
| { | { | ||||
| // don't have to check for interface, since then | // don't have to check for interface, since then | ||||
| // taskClass would be abstract too. | // taskClass would be abstract too. | ||||
| @@ -101,7 +100,7 @@ public class TaskAdapter extends Task | |||||
| catch( Exception ex ) | catch( Exception ex ) | ||||
| { | { | ||||
| log( "Error setting project in " + proxy.getClass(), | log( "Error setting project in " + proxy.getClass(), | ||||
| Project.MSG_ERR ); | |||||
| Project.MSG_ERR ); | |||||
| throw new BuildException( "Error", ex ); | throw new BuildException( "Error", ex ); | ||||
| } | } | ||||
| @@ -109,7 +108,7 @@ public class TaskAdapter extends Task | |||||
| try | try | ||||
| { | { | ||||
| Class c = proxy.getClass(); | Class c = proxy.getClass(); | ||||
| executeM = c.getMethod( "execute", new Class[0] ); | |||||
| executeM = c.getMethod( "execute", new Class[ 0 ] ); | |||||
| if( executeM == null ) | if( executeM == null ) | ||||
| { | { | ||||
| log( "No public execute() in " + proxy.getClass(), Project.MSG_ERR ); | log( "No public execute() in " + proxy.getClass(), Project.MSG_ERR ); | ||||
| @@ -51,11 +51,13 @@ public class Available | |||||
| } | } | ||||
| public void setClasspath( Path classpath ) | public void setClasspath( Path classpath ) | ||||
| throws TaskException | |||||
| { | { | ||||
| createClasspath().append( classpath ); | createClasspath().append( classpath ); | ||||
| } | } | ||||
| public void setClasspathRef( Reference r ) | public void setClasspathRef( Reference r ) | ||||
| throws TaskException | |||||
| { | { | ||||
| createClasspath().setRefid( r ); | createClasspath().setRefid( r ); | ||||
| } | } | ||||
| @@ -66,6 +68,7 @@ public class Available | |||||
| } | } | ||||
| public void setFilepath( Path filepath ) | public void setFilepath( Path filepath ) | ||||
| throws TaskException | |||||
| { | { | ||||
| createFilepath().append( filepath ); | createFilepath().append( filepath ); | ||||
| } | } | ||||
| @@ -91,6 +94,7 @@ public class Available | |||||
| } | } | ||||
| public Path createClasspath() | public Path createClasspath() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( this.classpath == null ) | if( this.classpath == null ) | ||||
| { | { | ||||
| @@ -100,6 +104,7 @@ public class Available | |||||
| } | } | ||||
| public Path createFilepath() | public Path createFilepath() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( this.filepath == null ) | if( this.filepath == null ) | ||||
| { | { | ||||
| @@ -32,6 +32,7 @@ public class BUnzip2 extends Unpack | |||||
| } | } | ||||
| protected void extract() | protected void extract() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( source.lastModified() > dest.lastModified() ) | if( source.lastModified() > dest.lastModified() ) | ||||
| { | { | ||||
| @@ -20,9 +20,11 @@ import org.apache.tools.bzip2.CBZip2OutputStream; | |||||
| * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | ||||
| */ | */ | ||||
| public class BZip2 extends Pack | |||||
| public class BZip2 | |||||
| extends Pack | |||||
| { | { | ||||
| protected void pack() | protected void pack() | ||||
| throws TaskException | |||||
| { | { | ||||
| CBZip2OutputStream zOut = null; | CBZip2OutputStream zOut = null; | ||||
| try | try | ||||
| @@ -294,6 +294,7 @@ public class Copy extends Task | |||||
| protected void buildMap( File fromDir, File toDir, String[] names, | protected void buildMap( File fromDir, File toDir, String[] names, | ||||
| FileNameMapper mapper, Hashtable map ) | FileNameMapper mapper, Hashtable map ) | ||||
| throws TaskException | |||||
| { | { | ||||
| String[] toCopy = null; | String[] toCopy = null; | ||||
| @@ -413,6 +414,7 @@ public class Copy extends Task | |||||
| * @param dirs Description of Parameter | * @param dirs Description of Parameter | ||||
| */ | */ | ||||
| protected void scan( File fromDir, File toDir, String[] files, String[] dirs ) | protected void scan( File fromDir, File toDir, String[] files, String[] dirs ) | ||||
| throws TaskException | |||||
| { | { | ||||
| FileNameMapper mapper = null; | FileNameMapper mapper = null; | ||||
| if( mapperElement != null ) | if( mapperElement != null ) | ||||
| @@ -73,6 +73,7 @@ public class Delete extends MatchingTask | |||||
| * @param excludes the string containing the exclude patterns | * @param excludes the string containing the exclude patterns | ||||
| */ | */ | ||||
| public void setExcludes( String excludes ) | public void setExcludes( String excludes ) | ||||
| throws TaskException | |||||
| { | { | ||||
| usedMatchingTask = true; | usedMatchingTask = true; | ||||
| super.setExcludes( excludes ); | super.setExcludes( excludes ); | ||||
| @@ -85,6 +86,7 @@ public class Delete extends MatchingTask | |||||
| * patterns from. | * patterns from. | ||||
| */ | */ | ||||
| public void setExcludesfile( File excludesfile ) | public void setExcludesfile( File excludesfile ) | ||||
| throws TaskException | |||||
| { | { | ||||
| usedMatchingTask = true; | usedMatchingTask = true; | ||||
| super.setExcludesfile( excludesfile ); | super.setExcludesfile( excludesfile ); | ||||
| @@ -127,6 +129,7 @@ public class Delete extends MatchingTask | |||||
| * @param includes the string containing the include patterns | * @param includes the string containing the include patterns | ||||
| */ | */ | ||||
| public void setIncludes( String includes ) | public void setIncludes( String includes ) | ||||
| throws TaskException | |||||
| { | { | ||||
| usedMatchingTask = true; | usedMatchingTask = true; | ||||
| super.setIncludes( includes ); | super.setIncludes( includes ); | ||||
| @@ -139,6 +142,7 @@ public class Delete extends MatchingTask | |||||
| * patterns from. | * patterns from. | ||||
| */ | */ | ||||
| public void setIncludesfile( File includesfile ) | public void setIncludesfile( File includesfile ) | ||||
| throws TaskException | |||||
| { | { | ||||
| usedMatchingTask = true; | usedMatchingTask = true; | ||||
| super.setIncludesfile( includesfile ); | super.setIncludesfile( includesfile ); | ||||
| @@ -195,6 +199,7 @@ public class Delete extends MatchingTask | |||||
| * @return Description of the Returned Value | * @return Description of the Returned Value | ||||
| */ | */ | ||||
| public PatternSet.NameEntry createExclude() | public PatternSet.NameEntry createExclude() | ||||
| throws TaskException | |||||
| { | { | ||||
| usedMatchingTask = true; | usedMatchingTask = true; | ||||
| return super.createExclude(); | return super.createExclude(); | ||||
| @@ -206,6 +211,7 @@ public class Delete extends MatchingTask | |||||
| * @return Description of the Returned Value | * @return Description of the Returned Value | ||||
| */ | */ | ||||
| public PatternSet.NameEntry createInclude() | public PatternSet.NameEntry createInclude() | ||||
| throws TaskException | |||||
| { | { | ||||
| usedMatchingTask = true; | usedMatchingTask = true; | ||||
| return super.createInclude(); | return super.createInclude(); | ||||
| @@ -229,7 +229,7 @@ public class ExecTask extends Task | |||||
| * @exception IOException Description of Exception | * @exception IOException Description of Exception | ||||
| */ | */ | ||||
| protected final void runExecute( Execute exe ) | protected final void runExecute( Execute exe ) | ||||
| throws IOException | |||||
| throws IOException, TaskException | |||||
| { | { | ||||
| int err = -1;// assume the worst | int err = -1;// assume the worst | ||||
| @@ -179,6 +179,7 @@ public class Execute | |||||
| * @return The ProcEnvironment value | * @return The ProcEnvironment value | ||||
| */ | */ | ||||
| public static synchronized Vector getProcEnvironment() | public static synchronized Vector getProcEnvironment() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( procEnvironment != null ) | if( procEnvironment != null ) | ||||
| return procEnvironment; | return procEnvironment; | ||||
| @@ -405,6 +406,7 @@ public class Execute | |||||
| * @return the environment used to create a subprocess | * @return the environment used to create a subprocess | ||||
| */ | */ | ||||
| public String[] getEnvironment() | public String[] getEnvironment() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( env == null || newEnvironment ) | if( env == null || newEnvironment ) | ||||
| return env; | return env; | ||||
| @@ -505,6 +507,7 @@ public class Execute | |||||
| * @return the patched environment | * @return the patched environment | ||||
| */ | */ | ||||
| private String[] patchEnvironment() | private String[] patchEnvironment() | ||||
| throws TaskException | |||||
| { | { | ||||
| Vector osEnv = (Vector)getProcEnvironment().clone(); | Vector osEnv = (Vector)getProcEnvironment().clone(); | ||||
| for( int i = 0; i < env.length; i++ ) | for( int i = 0; i < env.length; i++ ) | ||||
| @@ -681,7 +684,7 @@ public class Execute | |||||
| * @exception IOException Description of Exception | * @exception IOException Description of Exception | ||||
| */ | */ | ||||
| public Process exec( Project project, String[] cmd, String[] env, File workingDir ) | public Process exec( Project project, String[] cmd, String[] env, File workingDir ) | ||||
| throws IOException | |||||
| throws IOException, TaskException | |||||
| { | { | ||||
| try | try | ||||
| { | { | ||||
| @@ -305,6 +305,7 @@ public class ExecuteOn extends ExecTask | |||||
| * @return The Dirs value | * @return The Dirs value | ||||
| */ | */ | ||||
| protected String[] getDirs( File baseDir, DirectoryScanner ds ) | protected String[] getDirs( File baseDir, DirectoryScanner ds ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( mapper != null ) | if( mapper != null ) | ||||
| { | { | ||||
| @@ -327,6 +328,7 @@ public class ExecuteOn extends ExecTask | |||||
| * @return The Files value | * @return The Files value | ||||
| */ | */ | ||||
| protected String[] getFiles( File baseDir, DirectoryScanner ds ) | protected String[] getFiles( File baseDir, DirectoryScanner ds ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( mapper != null ) | if( mapper != null ) | ||||
| { | { | ||||
| @@ -32,6 +32,7 @@ public class GUnzip extends Unpack | |||||
| } | } | ||||
| protected void extract() | protected void extract() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( source.lastModified() > dest.lastModified() ) | if( source.lastModified() > dest.lastModified() ) | ||||
| { | { | ||||
| @@ -20,10 +20,11 @@ import org.apache.myrmidon.api.TaskException; | |||||
| * @author Jon S. Stevens <a href="mailto:jon@clearink.com">jon@clearink.com</a> | * @author Jon S. Stevens <a href="mailto:jon@clearink.com">jon@clearink.com</a> | ||||
| * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a> | ||||
| */ | */ | ||||
| public class GZip extends Pack | |||||
| public class GZip | |||||
| extends Pack | |||||
| { | { | ||||
| protected void pack() | protected void pack() | ||||
| throws TaskException | |||||
| { | { | ||||
| GZIPOutputStream zOut = null; | GZIPOutputStream zOut = null; | ||||
| try | try | ||||
| @@ -49,6 +49,7 @@ public class GenerateKey extends Task | |||||
| } | } | ||||
| public void setDname( final String dname ) | public void setDname( final String dname ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( null != expandedDname ) | if( null != expandedDname ) | ||||
| { | { | ||||
| @@ -849,6 +849,7 @@ public class Javac extends MatchingTask | |||||
| * @param files Description of Parameter | * @param files Description of Parameter | ||||
| */ | */ | ||||
| protected void scanDir( File srcDir, File destDir, String files[] ) | protected void scanDir( File srcDir, File destDir, String files[] ) | ||||
| throws TaskException | |||||
| { | { | ||||
| GlobPatternMapper m = new GlobPatternMapper(); | GlobPatternMapper m = new GlobPatternMapper(); | ||||
| m.setFrom( "*.java" ); | m.setFrom( "*.java" ); | ||||
| @@ -16,9 +16,9 @@ import org.apache.tools.ant.Task; | |||||
| * | * | ||||
| * @author thomas.haas@softwired-inc.com | * @author thomas.haas@softwired-inc.com | ||||
| */ | */ | ||||
| public class LogStreamHandler extends PumpStreamHandler | |||||
| public class LogStreamHandler | |||||
| extends PumpStreamHandler | |||||
| { | { | ||||
| /** | /** | ||||
| * Creates a new instance of this class. | * Creates a new instance of this class. | ||||
| * | * | ||||
| @@ -33,6 +33,7 @@ public class LogStreamHandler extends PumpStreamHandler | |||||
| } | } | ||||
| public void stop() | public void stop() | ||||
| throws TaskException | |||||
| { | { | ||||
| super.stop(); | super.stop(); | ||||
| try | try | ||||
| @@ -361,6 +361,7 @@ public class Manifest extends Task | |||||
| catch( IOException e ) | catch( IOException e ) | ||||
| { | { | ||||
| throw new TaskException( "Failed to write " + manifestFile | throw new TaskException( "Failed to write " + manifestFile | ||||
| e ); | e ); | ||||
| } | } | ||||
| finally | finally | ||||
| @@ -50,6 +50,7 @@ public abstract class MatchingTask extends Task | |||||
| * @param excludes the string containing the exclude patterns | * @param excludes the string containing the exclude patterns | ||||
| */ | */ | ||||
| public void setExcludes( String excludes ) | public void setExcludes( String excludes ) | ||||
| throws TaskException | |||||
| { | { | ||||
| fileset.setExcludes( excludes ); | fileset.setExcludes( excludes ); | ||||
| } | } | ||||
| @@ -61,6 +62,7 @@ public abstract class MatchingTask extends Task | |||||
| * patterns from. | * patterns from. | ||||
| */ | */ | ||||
| public void setExcludesfile( File excludesfile ) | public void setExcludesfile( File excludesfile ) | ||||
| throws TaskException | |||||
| { | { | ||||
| fileset.setExcludesfile( excludesfile ); | fileset.setExcludesfile( excludesfile ); | ||||
| } | } | ||||
| @@ -72,6 +74,7 @@ public abstract class MatchingTask extends Task | |||||
| * @param includes the string containing the include patterns | * @param includes the string containing the include patterns | ||||
| */ | */ | ||||
| public void setIncludes( String includes ) | public void setIncludes( String includes ) | ||||
| throws TaskException | |||||
| { | { | ||||
| fileset.setIncludes( includes ); | fileset.setIncludes( includes ); | ||||
| } | } | ||||
| @@ -83,6 +86,7 @@ public abstract class MatchingTask extends Task | |||||
| * patterns from. | * patterns from. | ||||
| */ | */ | ||||
| public void setIncludesfile( File includesfile ) | public void setIncludesfile( File includesfile ) | ||||
| throws TaskException | |||||
| { | { | ||||
| fileset.setIncludesfile( includesfile ); | fileset.setIncludesfile( includesfile ); | ||||
| } | } | ||||
| @@ -93,6 +97,7 @@ public abstract class MatchingTask extends Task | |||||
| * @return Description of the Returned Value | * @return Description of the Returned Value | ||||
| */ | */ | ||||
| public PatternSet.NameEntry createExclude() | public PatternSet.NameEntry createExclude() | ||||
| throws TaskException | |||||
| { | { | ||||
| return fileset.createExclude(); | return fileset.createExclude(); | ||||
| } | } | ||||
| @@ -103,6 +108,7 @@ public abstract class MatchingTask extends Task | |||||
| * @return Description of the Returned Value | * @return Description of the Returned Value | ||||
| */ | */ | ||||
| public PatternSet.NameEntry createExcludesFile() | public PatternSet.NameEntry createExcludesFile() | ||||
| throws TaskException | |||||
| { | { | ||||
| return fileset.createExcludesFile(); | return fileset.createExcludesFile(); | ||||
| } | } | ||||
| @@ -113,6 +119,7 @@ public abstract class MatchingTask extends Task | |||||
| * @return Description of the Returned Value | * @return Description of the Returned Value | ||||
| */ | */ | ||||
| public PatternSet.NameEntry createInclude() | public PatternSet.NameEntry createInclude() | ||||
| throws TaskException | |||||
| { | { | ||||
| return fileset.createInclude(); | return fileset.createInclude(); | ||||
| } | } | ||||
| @@ -123,6 +130,7 @@ public abstract class MatchingTask extends Task | |||||
| * @return Description of the Returned Value | * @return Description of the Returned Value | ||||
| */ | */ | ||||
| public PatternSet.NameEntry createIncludesFile() | public PatternSet.NameEntry createIncludesFile() | ||||
| throws TaskException | |||||
| { | { | ||||
| return fileset.createIncludesFile(); | return fileset.createIncludesFile(); | ||||
| } | } | ||||
| @@ -62,6 +62,7 @@ public abstract class Pack extends Task | |||||
| } | } | ||||
| private void validate() | private void validate() | ||||
| throws TaskException | |||||
| { | { | ||||
| if( zipFile == null ) | if( zipFile == null ) | ||||
| { | { | ||||
| @@ -225,6 +225,7 @@ public class Property extends Task | |||||
| } | } | ||||
| protected void loadEnvironment( String prefix ) | protected void loadEnvironment( String prefix ) | ||||
| throws TaskException | |||||
| { | { | ||||
| Properties props = new Properties(); | Properties props = new Properties(); | ||||
| if( !prefix.endsWith( "." ) ) | if( !prefix.endsWith( "." ) ) | ||||
| @@ -10,6 +10,7 @@ package org.apache.tools.ant.taskdefs; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.io.InputStream; | import java.io.InputStream; | ||||
| import java.io.OutputStream; | import java.io.OutputStream; | ||||
| import org.apache.myrmidon.api.TaskException; | |||||
| /** | /** | ||||
| * Copies standard output and error of subprocesses to standard output and error | * Copies standard output and error of subprocesses to standard output and error | ||||
| @@ -63,6 +64,7 @@ public class PumpStreamHandler implements ExecuteStreamHandler | |||||
| } | } | ||||
| public void stop() | public void stop() | ||||
| throws TaskException | |||||
| { | { | ||||
| try | try | ||||
| { | { | ||||
| @@ -607,6 +607,7 @@ public class Rmic extends MatchingTask | |||||
| */ | */ | ||||
| protected void scanDir( File baseDir, String files[], | protected void scanDir( File baseDir, String files[], | ||||
| FileNameMapper mapper ) | FileNameMapper mapper ) | ||||
| throws TaskException | |||||
| { | { | ||||
| String[] newFiles = files; | String[] newFiles = files; | ||||
| @@ -212,6 +212,7 @@ public class Tar extends MatchingTask | |||||
| } | } | ||||
| protected boolean archiveIsUpToDate( String[] files ) | protected boolean archiveIsUpToDate( String[] files ) | ||||
| throws TaskException | |||||
| { | { | ||||
| SourceFileScanner sfs = new SourceFileScanner( this ); | SourceFileScanner sfs = new SourceFileScanner( this ); | ||||
| MergingMapper mm = new MergingMapper(); | MergingMapper mm = new MergingMapper(); | ||||
| @@ -161,6 +161,7 @@ public class UpToDate extends MatchingTask implements Condition | |||||
| } | } | ||||
| protected boolean scanDir( File srcDir, String files[] ) | protected boolean scanDir( File srcDir, String files[] ) | ||||
| throws TaskException | |||||
| { | { | ||||
| SourceFileScanner sfs = new SourceFileScanner( this ); | SourceFileScanner sfs = new SourceFileScanner( this ); | ||||
| FileNameMapper mapper = null; | FileNameMapper mapper = null; | ||||
| @@ -52,6 +52,7 @@ public class FileList extends DataType | |||||
| } | } | ||||
| public void setFiles( String filenames ) | public void setFiles( String filenames ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( isReference() ) | if( isReference() ) | ||||
| { | { | ||||
| @@ -88,6 +89,7 @@ public class FileList extends DataType | |||||
| } | } | ||||
| public File getDir( Project p ) | public File getDir( Project p ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( isReference() ) | if( isReference() ) | ||||
| { | { | ||||
| @@ -103,6 +105,7 @@ public class FileList extends DataType | |||||
| * @return The Files value | * @return The Files value | ||||
| */ | */ | ||||
| public String[] getFiles( Project p ) | public String[] getFiles( Project p ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( isReference() ) | if( isReference() ) | ||||
| { | { | ||||
| @@ -132,6 +135,7 @@ public class FileList extends DataType | |||||
| * @return The Ref value | * @return The Ref value | ||||
| */ | */ | ||||
| protected FileList getRef( Project p ) | protected FileList getRef( Project p ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( !checked ) | if( !checked ) | ||||
| { | { | ||||
| @@ -22,7 +22,8 @@ import org.apache.tools.ant.Project; | |||||
| * mattinger@mindless.com</a> | * mattinger@mindless.com</a> | ||||
| * @see org.apache.oro.text.regex.Perl5Substitition | * @see org.apache.oro.text.regex.Perl5Substitition | ||||
| */ | */ | ||||
| public class Substitution extends DataType | |||||
| public class Substitution | |||||
| extends DataType | |||||
| { | { | ||||
| public final static String DATA_TYPE_NAME = "substitition"; | public final static String DATA_TYPE_NAME = "substitition"; | ||||
| @@ -45,9 +46,12 @@ public class Substitution extends DataType | |||||
| * @return The Expression value | * @return The Expression value | ||||
| */ | */ | ||||
| public String getExpression( Project p ) | public String getExpression( Project p ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( isReference() ) | if( isReference() ) | ||||
| { | |||||
| return getRef( p ).getExpression( p ); | return getRef( p ).getExpression( p ); | ||||
| } | |||||
| return expression; | return expression; | ||||
| } | } | ||||
| @@ -60,6 +64,7 @@ public class Substitution extends DataType | |||||
| * @return The Ref value | * @return The Ref value | ||||
| */ | */ | ||||
| public Substitution getRef( Project p ) | public Substitution getRef( Project p ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( !checked ) | if( !checked ) | ||||
| { | { | ||||
| @@ -79,5 +84,4 @@ public class Substitution extends DataType | |||||
| return (Substitution)o; | return (Substitution)o; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -27,9 +27,9 @@ import org.apache.tools.ant.Project; | |||||
| * | * | ||||
| * @author Don Ferguson <a href="mailto:don@bea.com">don@bea.com</a> | * @author Don Ferguson <a href="mailto:don@bea.com">don@bea.com</a> | ||||
| */ | */ | ||||
| public class ZipFileSet extends FileSet | |||||
| public class ZipFileSet | |||||
| extends FileSet | |||||
| { | { | ||||
| private File srcFile = null; | private File srcFile = null; | ||||
| private String prefix = ""; | private String prefix = ""; | ||||
| private String fullpath = ""; | private String fullpath = ""; | ||||
| @@ -84,6 +84,7 @@ public class ZipFileSet extends FileSet | |||||
| * @param srcFile The zip file from which to extract entries. | * @param srcFile The zip file from which to extract entries. | ||||
| */ | */ | ||||
| public void setSrc( File srcFile ) | public void setSrc( File srcFile ) | ||||
| throws TaskException | |||||
| { | { | ||||
| if( hasDir ) | if( hasDir ) | ||||
| { | { | ||||
| @@ -153,5 +154,4 @@ public class ZipFileSet extends FileSet | |||||
| { | { | ||||
| return srcFile; | return srcFile; | ||||
| } | } | ||||
| } | } | ||||
| @@ -9,6 +9,7 @@ package org.apache.tools.ant.util; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.util.Vector; | import java.util.Vector; | ||||
| import org.apache.myrmidon.api.TaskException; | |||||
| import org.apache.myrmidon.framework.Os; | import org.apache.myrmidon.framework.Os; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| @@ -53,6 +54,7 @@ public class SourceFileScanner | |||||
| */ | */ | ||||
| public String[] restrict( String[] files, File srcDir, File destDir, | public String[] restrict( String[] files, File srcDir, File destDir, | ||||
| FileNameMapper mapper ) | FileNameMapper mapper ) | ||||
| throws TaskException | |||||
| { | { | ||||
| long now = ( new java.util.Date() ).getTime(); | long now = ( new java.util.Date() ).getTime(); | ||||
| @@ -146,6 +148,7 @@ public class SourceFileScanner | |||||
| */ | */ | ||||
| public File[] restrictAsFiles( String[] files, File srcDir, File destDir, | public File[] restrictAsFiles( String[] files, File srcDir, File destDir, | ||||
| FileNameMapper mapper ) | FileNameMapper mapper ) | ||||
| throws TaskException | |||||
| { | { | ||||
| String[] res = restrict( files, srcDir, destDir, mapper ); | String[] res = restrict( files, srcDir, destDir, mapper ); | ||||
| File[] result = new File[ res.length ]; | File[] result = new File[ res.length ]; | ||||