git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271189 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -9,11 +9,11 @@ package org.apache.antlib.build; | |||
| import java.io.File; | |||
| import java.io.IOException; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * Task as a layer on top of patch. Patch applies a diff file to an original. | |||
| @@ -10,12 +10,12 @@ package org.apache.antlib.cvslib; | |||
| import java.io.File; | |||
| import java.io.IOException; | |||
| import java.util.Properties; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.util.FileUtils; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * Task to interact with a CVS repository. | |||
| @@ -151,8 +151,9 @@ public class Cvs | |||
| final ExecManager execManager = (ExecManager)getService( ExecManager.class ); | |||
| final Execute2 exe = new Execute2( execManager ); | |||
| setupLogger( exe ); | |||
| if( m_dest == null ) { | |||
| m_dest = getBaseDirectory(); | |||
| if( m_dest == null ) | |||
| { | |||
| m_dest = getBaseDirectory(); | |||
| } | |||
| exe.setWorkingDirectory( m_dest ); | |||
| @@ -10,8 +10,8 @@ package org.apache.antlib.nativelib; | |||
| import java.io.File; | |||
| import java.io.IOException; | |||
| import java.util.Properties; | |||
| import org.apache.aut.nativelib.Os; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.aut.nativelib.Os; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| @@ -8,11 +8,11 @@ | |||
| package org.apache.antlib.security; | |||
| import java.io.IOException; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * Generates a key. | |||
| @@ -13,6 +13,7 @@ import java.util.ArrayList; | |||
| import java.util.Enumeration; | |||
| import java.util.zip.ZipEntry; | |||
| import java.util.zip.ZipFile; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| @@ -20,7 +21,6 @@ import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.ScannerUtil; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * Sign a archive. | |||
| @@ -182,7 +182,8 @@ public class TraXLiaison | |||
| if( e.getLocator().getSystemId() != null ) | |||
| { | |||
| String url = e.getLocator().getSystemId(); | |||
| if( url.startsWith( "file:///" ) ) { | |||
| if( url.startsWith( "file:///" ) ) | |||
| { | |||
| url = url.substring( 8 ); | |||
| } | |||
| msg.append( url ); | |||
| @@ -8,32 +8,26 @@ | |||
| package org.apache.antlib.xml; | |||
| import java.io.File; | |||
| import java.io.FileReader; | |||
| import java.io.IOException; | |||
| import java.net.URL; | |||
| import java.net.URLClassLoader; | |||
| import java.util.ArrayList; | |||
| import java.util.Enumeration; | |||
| import java.util.Hashtable; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.PathUtil; | |||
| import org.apache.tools.ant.types.ScannerUtil; | |||
| import org.xml.sax.EntityResolver; | |||
| import org.xml.sax.InputSource; | |||
| import org.xml.sax.Parser; | |||
| import org.xml.sax.SAXException; | |||
| import org.xml.sax.SAXNotRecognizedException; | |||
| import org.xml.sax.SAXNotSupportedException; | |||
| import org.xml.sax.XMLReader; | |||
| import org.xml.sax.helpers.ParserAdapter; | |||
| @@ -7,8 +7,6 @@ | |||
| */ | |||
| package org.apache.antlib.xml; | |||
| public final class XSLTParam | |||
| { | |||
| private String m_name; | |||
| @@ -8,8 +8,8 @@ | |||
| package org.apache.antlib.xml; | |||
| import java.io.File; | |||
| import java.net.URLClassLoader; | |||
| import java.net.URL; | |||
| import java.net.URLClassLoader; | |||
| import java.util.ArrayList; | |||
| import java.util.Iterator; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| @@ -244,7 +244,8 @@ public class XSLTProcess | |||
| for( int j = 0; j < dirs.length; ++j ) | |||
| { | |||
| list = new File( m_baseDir, dirs[ j ] ).list(); | |||
| for( int i = 0; i < list.length; ++i ) { | |||
| for( int i = 0; i < list.length; ++i ) | |||
| { | |||
| process( m_baseDir, list[ i ], m_destDir, stylesheet ); | |||
| } | |||
| } | |||
| @@ -471,7 +472,8 @@ public class XSLTProcess | |||
| catch( Exception ex ) | |||
| { | |||
| getLogger().info( "Failed to process " + inFile ); | |||
| if( outFile != null ) { | |||
| if( outFile != null ) | |||
| { | |||
| outFile.delete(); | |||
| } | |||
| throw new TaskException( "Error", ex ); | |||
| @@ -175,7 +175,8 @@ public class CBZip2InputStream | |||
| m_blockSize100k = newSize100k; | |||
| if( newSize100k == 0 ) { | |||
| if( newSize100k == 0 ) | |||
| { | |||
| return; | |||
| } | |||
| @@ -303,7 +304,8 @@ public class CBZip2InputStream | |||
| { | |||
| m_rNToGo = RAND_NUMS[ m_rTPos ]; | |||
| m_rTPos++; | |||
| if( m_rTPos == 512 ) { | |||
| if( m_rTPos == 512 ) | |||
| { | |||
| m_rTPos = 0; | |||
| } | |||
| } | |||
| @@ -342,7 +344,8 @@ public class CBZip2InputStream | |||
| { | |||
| m_rNToGo = RAND_NUMS[ m_rTPos ]; | |||
| m_rTPos++; | |||
| if( m_rTPos == 512 ) { | |||
| if( m_rTPos == 512 ) | |||
| { | |||
| m_rTPos = 0; | |||
| } | |||
| } | |||
| @@ -467,11 +470,14 @@ public class CBZip2InputStream | |||
| int N = 1; | |||
| do | |||
| { | |||
| if( nextSym == RUNA ) { | |||
| if( nextSym == RUNA ) | |||
| { | |||
| s = s + ( 0 + 1 ) * N; | |||
| } else if( nextSym == RUNB ) { | |||
| } | |||
| else if( nextSym == RUNB ) | |||
| { | |||
| s = s + ( 1 + 1 ) * N; | |||
| } | |||
| } | |||
| N = N * 2; | |||
| if( groupPos == 0 ) | |||
| @@ -12,7 +12,6 @@ import java.io.IOException; | |||
| import java.io.OutputStream; | |||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||
| /** | |||
| * Logs each line written to this stream to the specified | |||
| * <code>ExecOutputHandler</code>. Tries to be smart about | |||
| @@ -256,8 +256,9 @@ class ProcessMonitor | |||
| try | |||
| { | |||
| final int available = input.available(); | |||
| if( 0 >= available ) { | |||
| return; | |||
| if( 0 >= available ) | |||
| { | |||
| return; | |||
| } | |||
| final byte[] data = new byte[ available ]; | |||
| @@ -8,8 +8,8 @@ | |||
| package org.apache.aut.nativelib.impl.launchers; | |||
| import java.io.IOException; | |||
| import org.apache.aut.nativelib.ExecMetaData; | |||
| import org.apache.aut.nativelib.ExecException; | |||
| import org.apache.aut.nativelib.ExecMetaData; | |||
| /** | |||
| * This is the interface implemented by objects which are capable of | |||
| @@ -11,12 +11,10 @@ import java.io.File; | |||
| import java.io.IOException; | |||
| import java.lang.reflect.InvocationTargetException; | |||
| import java.lang.reflect.Method; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| import org.apache.aut.nativelib.ExecException; | |||
| import org.apache.aut.nativelib.ExecMetaData; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| /** | |||
| * A command launcher for a particular JVM/OS platform. This class is a | |||
| @@ -9,8 +9,8 @@ | |||
| */ | |||
| package org.apache.aut.vfs; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| /** | |||
| * An enumeration that represents a file's type. | |||
| @@ -7,20 +7,20 @@ | |||
| */ | |||
| package org.apache.aut.vfs.impl; | |||
| import java.io.File; | |||
| import java.util.HashMap; | |||
| import java.util.Iterator; | |||
| import java.util.Map; | |||
| import java.io.File; | |||
| import org.apache.aut.vfs.FileObject; | |||
| import org.apache.aut.vfs.FileSystemException; | |||
| import org.apache.aut.vfs.FileSystemManager; | |||
| import org.apache.aut.vfs.provider.local.LocalFileSystemProvider; | |||
| import org.apache.aut.vfs.provider.FileSystem; | |||
| import org.apache.aut.vfs.provider.FileSystemProvider; | |||
| import org.apache.aut.vfs.provider.UriParser; | |||
| import org.apache.aut.vfs.provider.FileSystemProviderContext; | |||
| import org.apache.aut.vfs.provider.FileSystem; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| import org.apache.aut.vfs.provider.UriParser; | |||
| import org.apache.aut.vfs.provider.local.LocalFileSystemProvider; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| /** | |||
| * A default file system manager implementation. | |||
| @@ -19,8 +19,8 @@ import org.apache.aut.vfs.FileObject; | |||
| import org.apache.aut.vfs.FileSystemException; | |||
| import org.apache.aut.vfs.FileType; | |||
| import org.apache.aut.vfs.NameScope; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| /** | |||
| * A partial file object implementation. | |||
| @@ -348,7 +348,7 @@ public abstract class AbstractFileObject implements FileObject | |||
| } | |||
| // Update cached info | |||
| updateType(null); | |||
| updateType( null ); | |||
| } | |||
| /** | |||
| @@ -462,7 +462,7 @@ public abstract class AbstractFileObject implements FileObject | |||
| } | |||
| // Update cached info | |||
| updateType(type); | |||
| updateType( type ); | |||
| } | |||
| /** | |||
| @@ -604,7 +604,7 @@ public abstract class AbstractFileObject implements FileObject | |||
| /** | |||
| * Update cached info when this file's type changes. | |||
| */ | |||
| private void updateType(FileType type) | |||
| private void updateType( FileType type ) | |||
| { | |||
| // Notify parent that its child list may no longer be valid | |||
| notifyParent(); | |||
| @@ -9,8 +9,8 @@ package org.apache.aut.vfs.provider; | |||
| import org.apache.aut.vfs.FileObject; | |||
| import org.apache.aut.vfs.FileSystemException; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| /** | |||
| * A partial file system provider implementation. | |||
| @@ -10,8 +10,8 @@ package org.apache.aut.vfs.provider; | |||
| import java.util.HashSet; | |||
| import java.util.Iterator; | |||
| import org.apache.aut.vfs.FileSystemException; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| /** | |||
| * A name parser which parses absolute URIs. See RFC 2396 for details. | |||
| @@ -7,9 +7,9 @@ | |||
| */ | |||
| package org.apache.aut.vfs.provider.ftp; | |||
| import org.apache.aut.vfs.provider.UriParser; | |||
| import org.apache.aut.vfs.provider.ParsedUri; | |||
| import org.apache.aut.vfs.FileSystemException; | |||
| import org.apache.aut.vfs.provider.ParsedUri; | |||
| import org.apache.aut.vfs.provider.UriParser; | |||
| /** | |||
| * A parser for FTP URI. | |||
| @@ -32,15 +32,15 @@ public class FtpFileNameParser extends UriParser | |||
| String userInfo = uri.getUserInfo(); | |||
| if( userInfo != null ) | |||
| { | |||
| int idx = userInfo.indexOf(':'); | |||
| int idx = userInfo.indexOf( ':' ); | |||
| if( idx == -1 ) | |||
| { | |||
| uri.setUserName( userInfo ); | |||
| } | |||
| else | |||
| { | |||
| String userName = userInfo.substring(0, idx); | |||
| String password = userInfo.substring(idx+1); | |||
| String userName = userInfo.substring( 0, idx ); | |||
| String password = userInfo.substring( idx + 1 ); | |||
| uri.setUserName( userName ); | |||
| uri.setPassword( password ); | |||
| } | |||
| @@ -14,8 +14,8 @@ import org.apache.aut.vfs.FileName; | |||
| import org.apache.aut.vfs.FileSystemException; | |||
| import org.apache.aut.vfs.FileType; | |||
| import org.apache.aut.vfs.provider.AbstractFileObject; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| /** | |||
| * An FTP file. | |||
| @@ -15,8 +15,8 @@ import org.apache.aut.vfs.FileName; | |||
| import org.apache.aut.vfs.FileObject; | |||
| import org.apache.aut.vfs.FileSystemException; | |||
| import org.apache.aut.vfs.provider.AbstractFileSystem; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| /** | |||
| * An FTP file system. | |||
| @@ -17,8 +17,8 @@ import org.apache.aut.vfs.FileObject; | |||
| import org.apache.aut.vfs.FileSystemException; | |||
| import org.apache.aut.vfs.FileType; | |||
| import org.apache.aut.vfs.provider.AbstractFileObject; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| /** | |||
| * A file object implementation which uses direct file access. | |||
| @@ -11,8 +11,8 @@ import java.io.File; | |||
| import org.apache.aut.vfs.FileSystemException; | |||
| import org.apache.aut.vfs.provider.ParsedUri; | |||
| import org.apache.aut.vfs.provider.UriParser; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| /** | |||
| * A name parser. | |||
| @@ -10,8 +10,8 @@ package org.apache.aut.vfs.provider.smb; | |||
| import org.apache.aut.vfs.FileSystemException; | |||
| import org.apache.aut.vfs.provider.ParsedUri; | |||
| import org.apache.aut.vfs.provider.UriParser; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| /** | |||
| * A parser for SMB URI. | |||
| @@ -18,8 +18,8 @@ import org.apache.aut.vfs.FileSystemException; | |||
| import org.apache.aut.vfs.provider.AbstractFileSystem; | |||
| import org.apache.aut.vfs.provider.DefaultFileName; | |||
| import org.apache.aut.vfs.provider.FileSystem; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||
| import org.apache.avalon.excalibur.i18n.Resources; | |||
| /** | |||
| * A read-only file system for Zip/Jar files. | |||
| @@ -73,11 +73,15 @@ public class ATIProjectBuilder | |||
| final String target = reactorHandler.getTarget( i ); | |||
| final String data = reactorHandler.getData( i ); | |||
| if( target.equals( "xsl-param" ) ) { | |||
| if( target.equals( "xsl-param" ) ) | |||
| { | |||
| handleParameter( data ); | |||
| } else if( target.equals( "xsl-params" ) ) { | |||
| } | |||
| else if( target.equals( "xsl-params" ) ) | |||
| { | |||
| handleParameters( data, sourceID ); | |||
| } else if( target.equals( "xsl-stylesheet" ) ) | |||
| } | |||
| else if( target.equals( "xsl-stylesheet" ) ) | |||
| { | |||
| if( null != transformer ) | |||
| { | |||
| @@ -23,8 +23,9 @@ public class DefaultConverterRegistry | |||
| public String getConverterName( final String source, final String destination ) | |||
| { | |||
| final HashMap map = (HashMap)m_mapping.get( source ); | |||
| if( null == map ) { | |||
| return null; | |||
| if( null == map ) | |||
| { | |||
| return null; | |||
| } | |||
| return (String)map.get( destination ); | |||
| } | |||
| @@ -149,7 +149,7 @@ public class DefaultDeployer | |||
| checkFile( canonFile ); | |||
| final File[] extensions = getOptionalPackagesFor( canonFile ); | |||
| final URL[] urls = buildClasspath( canonFile, extensions ); | |||
| classLoader = new URLClassLoader( urls, Thread.currentThread().getContextClassLoader() ); | |||
| classLoader = new URLClassLoader( urls, Thread.currentThread().getContextClassLoader() ); | |||
| m_fileDeployers.put( canonFile, classLoader ); | |||
| } | |||
| return classLoader; | |||
| @@ -142,7 +142,7 @@ class Deployment | |||
| for( int i = 0; i < m_descriptors.length; i++ ) | |||
| { | |||
| Configuration descriptor = m_descriptors[ i ]; | |||
| deployFromDescriptor( descriptor, m_classLoader, m_descriptorUrls[i] ); | |||
| deployFromDescriptor( descriptor, m_classLoader, m_descriptorUrls[ i ] ); | |||
| } | |||
| } | |||
| @@ -338,7 +338,7 @@ class Deployment | |||
| /** | |||
| * Returns the type factory for a role. | |||
| */ | |||
| private DefaultTypeFactory getFactory( final Class roleType) | |||
| private DefaultTypeFactory getFactory( final Class roleType ) | |||
| { | |||
| DefaultTypeFactory factory = (DefaultTypeFactory)m_factories.get( roleType ); | |||
| @@ -138,14 +138,17 @@ public class AspectAwareExecutor | |||
| final ArrayList elementList = (ArrayList)elementMap.remove( names[ i ] ); | |||
| Parameters parameters = (Parameters)parameterMap.remove( names[ i ] ); | |||
| if( null == parameters ) { | |||
| parameters = Parameters.EMPTY_PARAMETERS; | |||
| if( null == parameters ) | |||
| { | |||
| parameters = Parameters.EMPTY_PARAMETERS; | |||
| } | |||
| Configuration[] elements = null; | |||
| if( null == elementList ) { | |||
| if( null == elementList ) | |||
| { | |||
| elements = EMPTY_ELEMENTS; | |||
| } else | |||
| } | |||
| else | |||
| { | |||
| elements = (Configuration[])elementList.toArray( EMPTY_ELEMENTS ); | |||
| } | |||
| @@ -171,9 +174,11 @@ public class AspectAwareExecutor | |||
| Configuration[] elements = null; | |||
| if( null == elementList ) { | |||
| if( null == elementList ) | |||
| { | |||
| elements = EMPTY_ELEMENTS; | |||
| } else | |||
| } | |||
| else | |||
| { | |||
| elements = (Configuration[])elementList.toArray( EMPTY_ELEMENTS ); | |||
| } | |||
| @@ -99,14 +99,14 @@ public class DefaultRoleManager | |||
| throws IllegalArgumentException | |||
| { | |||
| final String oldRole = (String)m_names.get( name ); | |||
| if( null != oldRole && ! oldRole.equals( role ) ) | |||
| if( null != oldRole && !oldRole.equals( role ) ) | |||
| { | |||
| final String message = REZ.getString( "duplicate-name.error", oldRole ); | |||
| throw new IllegalArgumentException( message ); | |||
| } | |||
| final String oldName = (String)m_roles.get( role ); | |||
| if( null != oldName && ! oldName.equals( name ) ) | |||
| if( null != oldName && !oldName.equals( name ) ) | |||
| { | |||
| final String message = REZ.getString( "duplicate-role.error", oldName ); | |||
| throw new IllegalArgumentException( message ); | |||
| @@ -50,8 +50,9 @@ public class ProjectListenerSupport | |||
| } | |||
| } | |||
| if( -1 == found ) { | |||
| return; | |||
| if( -1 == found ) | |||
| { | |||
| return; | |||
| } | |||
| final ProjectListener[] listeners = new ProjectListener[ m_listeners.length - 1 ]; | |||
| @@ -108,7 +108,6 @@ public class Pattern | |||
| return null; | |||
| } | |||
| public String toString() | |||
| { | |||
| String result = "Pattern['" + m_name + "',"; | |||
| @@ -96,7 +96,8 @@ public class Project | |||
| */ | |||
| public String getProperty( String name ) | |||
| { | |||
| if( name == null ) { | |||
| if( name == null ) | |||
| { | |||
| return null; | |||
| } | |||
| String property = (String)properties.get( name ); | |||
| @@ -11,10 +11,8 @@ import java.io.File; | |||
| import java.net.URL; | |||
| import java.net.URLClassLoader; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.taskdefs.condition.Condition; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.PathUtil; | |||
| @@ -55,13 +53,13 @@ public class Available | |||
| public void addClasspath( Path classpath ) | |||
| throws TaskException | |||
| { | |||
| if ( m_classpath == null ) | |||
| if( m_classpath == null ) | |||
| { | |||
| m_classpath = classpath; | |||
| } | |||
| else | |||
| { | |||
| m_classpath.addPath(classpath); | |||
| m_classpath.addPath( classpath ); | |||
| } | |||
| } | |||
| @@ -11,9 +11,9 @@ import java.io.BufferedReader; | |||
| import java.io.File; | |||
| import java.io.FileInputStream; | |||
| import java.io.FileOutputStream; | |||
| import java.io.InputStreamReader; | |||
| import java.io.IOException; | |||
| import java.io.InputStream; | |||
| import java.io.InputStreamReader; | |||
| import java.security.DigestInputStream; | |||
| import java.security.MessageDigest; | |||
| import java.security.NoSuchAlgorithmException; | |||
| @@ -23,7 +23,6 @@ import java.util.Enumeration; | |||
| import java.util.Hashtable; | |||
| import org.apache.avalon.excalibur.io.IOUtil; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.tools.ant.taskdefs.condition.Condition; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| @@ -285,7 +284,6 @@ public class Checksum | |||
| final byte[] fileDigest = buildDigest( fis ); | |||
| IOUtil.shutdownStream( fis ); | |||
| String checksum = ""; | |||
| for( int i = 0; i < fileDigest.length; i++ ) | |||
| { | |||
| @@ -8,7 +8,6 @@ | |||
| package org.apache.tools.ant.taskdefs; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.tools.ant.taskdefs.condition.Condition; | |||
| import org.apache.tools.ant.taskdefs.condition.ConditionBase; | |||
| @@ -11,8 +11,8 @@ import java.io.File; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.Iterator; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.aut.nativelib.Os; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileList; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| @@ -14,8 +14,8 @@ import java.net.URLClassLoader; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.SysProperties; | |||
| import org.apache.tools.ant.types.PathUtil; | |||
| import org.apache.tools.ant.types.SysProperties; | |||
| /* | |||
| * @author thomas.haas@softwired-inc.com | |||
| @@ -239,7 +239,8 @@ public class Get extends Task | |||
| if( is == null ) | |||
| { | |||
| getLogger().info( "Can't get " + source + " to " + dest ); | |||
| if( ignoreErrors ) { | |||
| if( ignoreErrors ) | |||
| { | |||
| return; | |||
| } | |||
| throw new TaskException( "Can't get " + source + " to " + dest ); | |||
| @@ -251,11 +252,13 @@ public class Get extends Task | |||
| while( ( length = is.read( buffer ) ) >= 0 ) | |||
| { | |||
| fos.write( buffer, 0, length ); | |||
| if( verbose ) { | |||
| if( verbose ) | |||
| { | |||
| System.out.print( "." ); | |||
| } | |||
| } | |||
| if( verbose ) { | |||
| if( verbose ) | |||
| { | |||
| System.out.println(); | |||
| } | |||
| fos.close(); | |||
| @@ -282,7 +285,8 @@ public class Get extends Task | |||
| catch( IOException ioe ) | |||
| { | |||
| getLogger().info( "Error getting " + source + " to " + dest ); | |||
| if( ignoreErrors ) { | |||
| if( ignoreErrors ) | |||
| { | |||
| return; | |||
| } | |||
| throw new TaskException( "Error", ioe ); | |||
| @@ -13,7 +13,6 @@ import java.io.InputStreamReader; | |||
| import java.util.ArrayList; | |||
| import java.util.StringTokenizer; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.tools.ant.Task; | |||
| /** | |||
| @@ -11,6 +11,7 @@ import java.io.File; | |||
| import java.io.IOException; | |||
| import java.io.PrintStream; | |||
| import java.util.ArrayList; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| @@ -19,7 +20,6 @@ import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.CommandlineJava; | |||
| import org.apache.tools.ant.types.EnvironmentVariable; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * This task acts as a loader for java applications but allows to use the same | |||
| @@ -10,16 +10,16 @@ package org.apache.tools.ant.taskdefs; | |||
| import java.io.File; | |||
| import java.util.ArrayList; | |||
| import java.util.Iterator; | |||
| import org.apache.aut.nativelib.Os; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.framework.JavaVersion; | |||
| import org.apache.aut.nativelib.Os; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.compilers.CompilerAdapter; | |||
| import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory; | |||
| import org.apache.tools.ant.types.Argument; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.util.mappers.GlobPatternMapper; | |||
| import org.apache.tools.ant.types.SourceFileScanner; | |||
| import org.apache.tools.ant.util.mappers.GlobPatternMapper; | |||
| /** | |||
| * Task to compile Java source files. This task can take the following | |||
| @@ -10,7 +10,6 @@ package org.apache.tools.ant.taskdefs; | |||
| import java.io.File; | |||
| import java.util.ArrayList; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.types.Path; | |||
| @@ -150,7 +149,8 @@ public class PathConvert extends Task | |||
| elem = elem.replace( fromDirSep, toDirSep ); | |||
| if( i != 0 ) { | |||
| if( i != 0 ) | |||
| { | |||
| rslt.append( m_pathSep ); | |||
| } | |||
| rslt.append( elem ); | |||
| @@ -212,17 +212,20 @@ public class PathConvert extends Task | |||
| throws TaskException | |||
| { | |||
| if( m_path == null ) { | |||
| if( m_path == null ) | |||
| { | |||
| throw new TaskException( "You must specify a path to convert" ); | |||
| } | |||
| if( m_property == null ) { | |||
| if( m_property == null ) | |||
| { | |||
| throw new TaskException( "You must specify a property" ); | |||
| } | |||
| // Must either have a target OS or both a dirSep and pathSep | |||
| if( m_targetOS == null && m_pathSep == null && m_dirSep == null ) { | |||
| if( m_targetOS == null && m_pathSep == null && m_dirSep == null ) | |||
| { | |||
| throw new TaskException( "You must specify at least one of targetOS, dirSep, or pathSep" ); | |||
| } | |||
| @@ -15,7 +15,6 @@ import java.net.URLClassLoader; | |||
| import java.util.Iterator; | |||
| import java.util.Properties; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.PathUtil; | |||
| @@ -82,7 +81,8 @@ public class Property | |||
| getContext().setProperty( name, value ); | |||
| } | |||
| if( m_resource != null ) { | |||
| if( m_resource != null ) | |||
| { | |||
| loadResource( m_resource ); | |||
| } | |||
| } | |||
| @@ -13,9 +13,9 @@ import java.io.IOException; | |||
| import java.io.PrintStream; | |||
| import java.util.Hashtable; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.framework.LogLevel; | |||
| import org.apache.tools.ant.Project; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.myrmidon.framework.LogLevel; | |||
| /** | |||
| * This task is the manager for RecorderEntry's. It is this class that holds all | |||
| @@ -9,19 +9,19 @@ package org.apache.tools.ant.taskdefs; | |||
| import java.io.File; | |||
| import java.io.IOException; | |||
| import java.net.URLClassLoader; | |||
| import java.net.URL; | |||
| import java.net.URLClassLoader; | |||
| import java.rmi.Remote; | |||
| import java.util.ArrayList; | |||
| import org.apache.avalon.excalibur.io.FileUtil; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.rmic.RmicAdapter; | |||
| import org.apache.tools.ant.taskdefs.rmic.RmicAdapterFactory; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.util.mappers.FileNameMapper; | |||
| import org.apache.tools.ant.types.SourceFileScanner; | |||
| import org.apache.tools.ant.types.PathUtil; | |||
| import org.apache.tools.ant.types.SourceFileScanner; | |||
| import org.apache.tools.ant.util.mappers.FileNameMapper; | |||
| /** | |||
| * Task to compile RMI stubs and skeletons. This task can take the following | |||
| @@ -18,8 +18,8 @@ import java.io.InputStreamReader; | |||
| import java.io.PrintStream; | |||
| import java.io.Reader; | |||
| import java.io.StringReader; | |||
| import java.net.URLClassLoader; | |||
| import java.net.URL; | |||
| import java.net.URLClassLoader; | |||
| import java.sql.Connection; | |||
| import java.sql.DatabaseMetaData; | |||
| import java.sql.Driver; | |||
| @@ -33,8 +33,8 @@ import java.util.Iterator; | |||
| import java.util.Properties; | |||
| import java.util.StringTokenizer; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.EnumeratedAttribute; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.Path; | |||
| @@ -469,7 +469,8 @@ public class SQLExec | |||
| throw new SQLException( "No suitable Driver for " + url ); | |||
| } | |||
| if( !isValidRdbms( conn ) ) { | |||
| if( !isValidRdbms( conn ) ) | |||
| { | |||
| return; | |||
| } | |||
| @@ -565,7 +566,8 @@ public class SQLExec | |||
| */ | |||
| protected boolean isValidRdbms( Connection conn ) | |||
| { | |||
| if( rdbms == null && version == null ) { | |||
| if( rdbms == null && version == null ) | |||
| { | |||
| return true; | |||
| } | |||
| @@ -620,7 +622,8 @@ public class SQLExec | |||
| throws SQLException | |||
| { | |||
| // Check and ignore empty statements | |||
| if( "".equals( sql.trim() ) ) { | |||
| if( "".equals( sql.trim() ) ) | |||
| { | |||
| return; | |||
| } | |||
| @@ -651,7 +654,8 @@ public class SQLExec | |||
| catch( SQLException e ) | |||
| { | |||
| getLogger().error( "Failed to execute: " + sql ); | |||
| if( !onError.equals( "continue" ) ) { | |||
| if( !onError.equals( "continue" ) ) | |||
| { | |||
| throw e; | |||
| } | |||
| getLogger().error( e.toString() ); | |||
| @@ -731,10 +735,12 @@ public class SQLExec | |||
| { | |||
| line = line.trim(); | |||
| line = "" + resolveValue( line ); | |||
| if( line.startsWith( "//" ) ) { | |||
| if( line.startsWith( "//" ) ) | |||
| { | |||
| continue; | |||
| } | |||
| if( line.startsWith( "--" ) ) { | |||
| if( line.startsWith( "--" ) ) | |||
| { | |||
| continue; | |||
| } | |||
| StringTokenizer st = new StringTokenizer( line ); | |||
| @@ -753,7 +759,8 @@ public class SQLExec | |||
| // SQL defines "--" as a comment to EOL | |||
| // and in Oracle it may contain a hint | |||
| // so we cannot just remove it, instead we must end it | |||
| if( line.indexOf( "--" ) >= 0 ) { | |||
| if( line.indexOf( "--" ) >= 0 ) | |||
| { | |||
| sql += "\n"; | |||
| } | |||
| @@ -18,7 +18,6 @@ import java.util.NoSuchElementException; | |||
| import java.util.StringTokenizer; | |||
| import java.util.TimeZone; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.types.EnumeratedAttribute; | |||
| @@ -11,15 +11,14 @@ import java.io.File; | |||
| import java.util.ArrayList; | |||
| import java.util.Iterator; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.condition.Condition; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.util.mappers.Mapper; | |||
| import org.apache.tools.ant.types.ScannerUtil; | |||
| import org.apache.tools.ant.types.SourceFileScanner; | |||
| import org.apache.tools.ant.util.mappers.FileNameMapper; | |||
| import org.apache.tools.ant.util.mappers.Mapper; | |||
| import org.apache.tools.ant.util.mappers.MergingMapper; | |||
| import org.apache.tools.ant.types.SourceFileScanner; | |||
| import org.apache.tools.ant.types.ScannerUtil; | |||
| /** | |||
| * Will set the given property if the specified target has a timestamp greater | |||
| @@ -121,7 +120,8 @@ public class UpToDate extends MatchingTask implements Condition | |||
| } | |||
| // if not there then it can't be up to date | |||
| if( _targetFile != null && !_targetFile.exists() ) { | |||
| if( _targetFile != null && !_targetFile.exists() ) | |||
| { | |||
| return false; | |||
| } | |||
| @@ -9,7 +9,6 @@ package org.apache.tools.ant.taskdefs; | |||
| import java.util.Hashtable; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.tools.ant.taskdefs.condition.Condition; | |||
| import org.apache.tools.ant.taskdefs.condition.ConditionBase; | |||
| import org.apache.tools.ant.types.EnumeratedAttribute; | |||
| @@ -9,8 +9,8 @@ package org.apache.tools.ant.taskdefs.archive; | |||
| import java.io.File; | |||
| import java.io.IOException; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.aut.zip.ZipOutputStream; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| /** | |||
| * Creates a EAR archive. Based on WAR task | |||
| @@ -20,11 +20,11 @@ import java.io.Reader; | |||
| import java.util.Enumeration; | |||
| import java.util.Iterator; | |||
| import java.util.zip.ZipFile; | |||
| import org.apache.aut.zip.ZipOutputStream; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.FileScanner; | |||
| import org.apache.tools.ant.taskdefs.Manifest; | |||
| import org.apache.tools.ant.taskdefs.ManifestException; | |||
| import org.apache.aut.zip.ZipOutputStream; | |||
| import org.apache.tools.ant.types.FileScanner; | |||
| /** | |||
| * Creates a JAR archive. | |||
| @@ -17,10 +17,10 @@ import org.apache.aut.tar.TarEntry; | |||
| import org.apache.aut.tar.TarOutputStream; | |||
| import org.apache.avalon.excalibur.io.IOUtil; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.SourceFileScanner; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.types.ScannerUtil; | |||
| import org.apache.tools.ant.types.SourceFileScanner; | |||
| import org.apache.tools.ant.util.mappers.MergingMapper; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| /** | |||
| * Creates a TAR archive. | |||
| @@ -9,8 +9,8 @@ package org.apache.tools.ant.taskdefs.archive; | |||
| import java.io.File; | |||
| import java.io.IOException; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.aut.zip.ZipOutputStream; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| /** | |||
| * Creates a WAR archive. | |||
| @@ -41,7 +41,7 @@ public class War | |||
| throw new TaskException( message ); | |||
| } | |||
| addFileAs(descr, "WEB-INF/web.xml" ); | |||
| addFileAs( descr, "WEB-INF/web.xml" ); | |||
| } | |||
| public void addClasses( final ZipFileSet fs ) | |||
| @@ -22,15 +22,15 @@ import java.util.zip.CRC32; | |||
| import java.util.zip.ZipInputStream; | |||
| import org.apache.aut.zip.ZipEntry; | |||
| import org.apache.aut.zip.ZipOutputStream; | |||
| import org.apache.avalon.excalibur.io.IOUtil; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileScanner; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.ScannerUtil; | |||
| import org.apache.tools.ant.types.SourceFileScanner; | |||
| import org.apache.tools.ant.util.mappers.MergingMapper; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.avalon.excalibur.io.IOUtil; | |||
| /** | |||
| * Create a ZIP archive. | |||
| @@ -11,6 +11,7 @@ import java.io.File; | |||
| import java.io.FileWriter; | |||
| import java.io.IOException; | |||
| import java.io.PrintWriter; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.avalon.excalibur.io.IOUtil; | |||
| import org.apache.avalon.excalibur.util.StringUtil; | |||
| import org.apache.avalon.framework.logger.AbstractLogEnabled; | |||
| @@ -21,7 +22,6 @@ import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.PathUtil; | |||
| import org.apache.tools.ant.util.FileUtils; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * This is the default implementation for the CompilerAdapter interface. | |||
| @@ -83,7 +83,8 @@ public class Jikes | |||
| Commandline cmd = new Commandline(); | |||
| cmd.setExecutable( "jikes" ); | |||
| if( m_deprecation == true ) { | |||
| if( m_deprecation == true ) | |||
| { | |||
| cmd.addArgument( "-deprecation" ); | |||
| } | |||
| @@ -18,7 +18,6 @@ import java.util.Iterator; | |||
| import java.util.Properties; | |||
| import org.apache.avalon.excalibur.util.StringUtil; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.types.Argument; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| @@ -316,10 +315,12 @@ public class ExecTask | |||
| { | |||
| try | |||
| { | |||
| if( m_ouput != null ) { | |||
| if( m_ouput != null ) | |||
| { | |||
| m_ouput.close(); | |||
| } | |||
| if( m_byteArrayOutput != null ) { | |||
| if( m_byteArrayOutput != null ) | |||
| { | |||
| m_byteArrayOutput.close(); | |||
| } | |||
| } | |||
| @@ -350,8 +351,9 @@ public class ExecTask | |||
| throws TaskException | |||
| { | |||
| // default directory to the project's base directory | |||
| if( m_workingDirectory == null ) { | |||
| m_workingDirectory = getBaseDirectory(); | |||
| if( m_workingDirectory == null ) | |||
| { | |||
| m_workingDirectory = getBaseDirectory(); | |||
| } | |||
| // show the command | |||
| getLogger().debug( m_command.toString() ); | |||
| @@ -13,12 +13,11 @@ import java.util.ArrayList; | |||
| import java.util.Hashtable; | |||
| import org.apache.avalon.excalibur.util.StringUtil; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.Marker; | |||
| import org.apache.tools.ant.types.SourceFileScanner; | |||
| import org.apache.tools.ant.types.ScannerUtil; | |||
| import org.apache.tools.ant.types.SourceFileScanner; | |||
| import org.apache.tools.ant.util.mappers.FileNameMapper; | |||
| import org.apache.tools.ant.util.mappers.Mapper; | |||
| @@ -50,7 +50,8 @@ public class Move | |||
| throws TaskException | |||
| { | |||
| String[] list = d.list(); | |||
| if( list == null ) { | |||
| if( list == null ) | |||
| { | |||
| return; | |||
| }// on an io error list() can return null | |||
| @@ -225,7 +226,8 @@ public class Move | |||
| protected boolean okToDelete( File d ) | |||
| { | |||
| String[] list = d.list(); | |||
| if( list == null ) { | |||
| if( list == null ) | |||
| { | |||
| return false; | |||
| }// maybe io error? | |||
| @@ -235,7 +237,8 @@ public class Move | |||
| File f = new File( d, s ); | |||
| if( f.isDirectory() ) | |||
| { | |||
| if( !okToDelete( f ) ) { | |||
| if( !okToDelete( f ) ) | |||
| { | |||
| return false; | |||
| } | |||
| } | |||
| @@ -15,19 +15,19 @@ import java.io.PrintWriter; | |||
| import java.util.ArrayList; | |||
| import java.util.Iterator; | |||
| import java.util.StringTokenizer; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||
| import org.apache.aut.nativelib.Os; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.framework.Pattern; | |||
| import org.apache.aut.nativelib.Os; | |||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.util.FileUtils; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.ScannerUtil; | |||
| import org.apache.tools.ant.util.FileUtils; | |||
| /** | |||
| * This task makes it easy to generate Javadoc documentation for a collection of | |||
| @@ -567,17 +567,19 @@ public class Javadoc | |||
| // Build the classpath to pass to Javadoc | |||
| Path classpath = new Path(); | |||
| classpath.addPath( m_sourcePath ); | |||
| if ( m_classpath != null ) | |||
| if( m_classpath != null ) | |||
| { | |||
| classpath.addPath( m_classpath ); | |||
| } | |||
| cmd.addArgument( "-classpath" ); | |||
| cmd.addArgument( classpath.toString() ); | |||
| if( m_version && m_doclet == null ) { | |||
| if( m_version && m_doclet == null ) | |||
| { | |||
| cmd.addArgument( "-version" ); | |||
| } | |||
| if( m_author && m_doclet == null ) { | |||
| if( m_author && m_doclet == null ) | |||
| { | |||
| cmd.addArgument( "-author" ); | |||
| } | |||
| @@ -938,7 +940,8 @@ public class Javadoc | |||
| ArrayList addedPackages = new ArrayList(); | |||
| String[] list = sourcePath.list(); | |||
| if( list == null ) { | |||
| if( list == null ) | |||
| { | |||
| list = new String[ 0 ]; | |||
| } | |||
| @@ -12,15 +12,15 @@ import java.io.File; | |||
| import java.io.FileReader; | |||
| import java.io.IOException; | |||
| import java.net.URL; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.taskdefs.ExecuteJava; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Argument; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.CommandlineJava; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * ANTLR task. | |||
| @@ -14,13 +14,13 @@ import java.io.OutputStream; | |||
| import java.io.PrintWriter; | |||
| import java.util.ArrayList; | |||
| import java.util.Iterator; | |||
| import org.apache.aut.nativelib.Os; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.aut.nativelib.Os; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.ScannerUtil; | |||
| @@ -198,7 +198,8 @@ public class Cab | |||
| { | |||
| String file = files.get( i ).toString(); | |||
| if( new File( m_baseDir, file ).lastModified() > | |||
| m_cabFile.lastModified() ) { | |||
| m_cabFile.lastModified() ) | |||
| { | |||
| upToDate = false; | |||
| } | |||
| } | |||
| @@ -159,7 +159,8 @@ public class Entry | |||
| GregorianCalendar value = new GregorianCalendar(); | |||
| GregorianCalendar newValue = new GregorianCalendar(); | |||
| if( m_pattern == null ) { | |||
| if( m_pattern == null ) | |||
| { | |||
| m_pattern = "yyyy/MM/dd HH:mm"; | |||
| } | |||
| DateFormat fmt = new SimpleDateFormat( m_pattern ); | |||
| @@ -12,9 +12,8 @@ import java.util.ArrayList; | |||
| import java.util.Iterator; | |||
| import java.util.StringTokenizer; | |||
| import org.apache.avalon.excalibur.util.StringUtil; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.util.FileUtils; | |||
| @@ -20,8 +20,8 @@ import netrexx.lang.Rexx; | |||
| import org.apache.avalon.excalibur.io.FileUtil; | |||
| import org.apache.avalon.excalibur.util.StringUtil; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| /** | |||
| * Task to compile NetRexx source files. This task can take the following | |||
| @@ -169,7 +169,8 @@ public class NetRexxC extends MatchingTask | |||
| public void setCompile( boolean compile ) | |||
| { | |||
| this.compile = compile; | |||
| if( !this.compile && !this.keep ) { | |||
| if( !this.compile && !this.keep ) | |||
| { | |||
| this.keep = true; | |||
| } | |||
| } | |||
| @@ -46,7 +46,8 @@ public class Script extends Task | |||
| public void setSrc( String fileName ) | |||
| { | |||
| File file = new File( fileName ); | |||
| if( !file.exists() ) { | |||
| if( !file.exists() ) | |||
| { | |||
| throw new TaskException( "file " + fileName + " not found." ); | |||
| } | |||
| @@ -140,11 +141,13 @@ public class Script extends Task | |||
| boolean isValid = key.length() > 0 && | |||
| Character.isJavaIdentifierStart( key.charAt( 0 ) ); | |||
| for( int i = 1; isValid && i < key.length(); i++ ) { | |||
| for( int i = 1; isValid && i < key.length(); i++ ) | |||
| { | |||
| isValid = Character.isJavaIdentifierPart( key.charAt( i ) ); | |||
| } | |||
| if( isValid ) { | |||
| if( isValid ) | |||
| { | |||
| beans.put( key, dictionary.get( key ) ); | |||
| } | |||
| } | |||
| @@ -7,8 +7,8 @@ | |||
| */ | |||
| package org.apache.tools.ant.taskdefs.optional.ccm; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| /** | |||
| @@ -9,10 +9,10 @@ package org.apache.tools.ant.taskdefs.optional.ccm; | |||
| import java.io.File; | |||
| import java.io.IOException; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| @@ -9,11 +9,11 @@ package org.apache.tools.ant.taskdefs.optional.clearcase; | |||
| import java.io.File; | |||
| import java.io.IOException; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * A base class for creating tasks for executing commands on ClearCase. <p> | |||
| @@ -21,8 +21,8 @@ import java.util.Enumeration; | |||
| import java.util.Hashtable; | |||
| import java.util.Iterator; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.PathUtil; | |||
| @@ -9,9 +9,9 @@ package org.apache.tools.ant.taskdefs.optional.dotnet; | |||
| import java.io.File; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| // ==================================================================== | |||
| @@ -420,7 +420,8 @@ public class CSharp | |||
| throws TaskException | |||
| { | |||
| //demand create pathlist | |||
| if( _referenceFiles == null ) { | |||
| if( _referenceFiles == null ) | |||
| { | |||
| _referenceFiles = new Path(); | |||
| } | |||
| _referenceFiles.append( path ); | |||
| @@ -462,7 +463,8 @@ public class CSharp | |||
| { | |||
| _targetType = targetType; | |||
| } | |||
| else { | |||
| else | |||
| { | |||
| throw new TaskException( "targetType " + targetType + " is not a valid type" ); | |||
| } | |||
| } | |||
| @@ -650,8 +652,9 @@ public class CSharp | |||
| public void execute() | |||
| throws TaskException | |||
| { | |||
| if( _srcDir == null ) { | |||
| _srcDir = getBaseDirectory(); | |||
| if( _srcDir == null ) | |||
| { | |||
| _srcDir = getBaseDirectory(); | |||
| } | |||
| NetCommand command = new NetCommand( this, "CSC", csc_exe_name ); | |||
| @@ -710,9 +713,12 @@ public class CSharp | |||
| */ | |||
| protected String getAdditionalModulesParameter() | |||
| { | |||
| if( notEmpty( _additionalModules ) ) { | |||
| if( notEmpty( _additionalModules ) ) | |||
| { | |||
| return "/addmodule:" + _additionalModules; | |||
| } else { | |||
| } | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -740,7 +746,8 @@ public class CSharp | |||
| s.append( DEFAULT_REFERENCE_LIST ); | |||
| return new String( s ); | |||
| } | |||
| else { | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -752,9 +759,12 @@ public class CSharp | |||
| */ | |||
| protected String getDefinitionsParameter() | |||
| { | |||
| if( notEmpty( _definitions ) ) { | |||
| if( notEmpty( _definitions ) ) | |||
| { | |||
| return "/define:" + _definitions; | |||
| } else { | |||
| } | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -766,9 +776,12 @@ public class CSharp | |||
| */ | |||
| protected String getDocFileParameter() | |||
| { | |||
| if( _docFile != null ) { | |||
| if( _docFile != null ) | |||
| { | |||
| return "/doc:" + _docFile.toString(); | |||
| } else { | |||
| } | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -780,9 +793,12 @@ public class CSharp | |||
| */ | |||
| protected String getExtraOptionsParameter() | |||
| { | |||
| if( _extraOptions != null && _extraOptions.length() != 0 ) { | |||
| if( _extraOptions != null && _extraOptions.length() != 0 ) | |||
| { | |||
| return _extraOptions; | |||
| } else { | |||
| } | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -819,9 +835,12 @@ public class CSharp | |||
| */ | |||
| protected String getMainClassParameter() | |||
| { | |||
| if( _mainClass != null && _mainClass.length() != 0 ) { | |||
| if( _mainClass != null && _mainClass.length() != 0 ) | |||
| { | |||
| return "/main:" + _mainClass; | |||
| } else { | |||
| } | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -853,7 +872,8 @@ public class CSharp | |||
| File f = _outputFile; | |||
| return "/out:" + f.toString(); | |||
| } | |||
| else { | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -866,7 +886,8 @@ public class CSharp | |||
| protected String getReferenceFilesParameter() | |||
| { | |||
| //bail on no references | |||
| if( _references == null ) { | |||
| if( _references == null ) | |||
| { | |||
| return null; | |||
| } | |||
| //iterate through the ref list & generate an entry for each | |||
| @@ -875,7 +896,8 @@ public class CSharp | |||
| String refpath = _references.toString(); | |||
| //bail on no references listed | |||
| if( refpath.length() == 0 ) { | |||
| if( refpath.length() == 0 ) | |||
| { | |||
| return null; | |||
| } | |||
| @@ -892,9 +914,12 @@ public class CSharp | |||
| protected String getReferencesParameter() | |||
| { | |||
| //bail on no references | |||
| if( notEmpty( _references ) ) { | |||
| if( notEmpty( _references ) ) | |||
| { | |||
| return "/reference:" + _references; | |||
| } else { | |||
| } | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -906,9 +931,12 @@ public class CSharp | |||
| */ | |||
| protected String getTargetTypeParameter() | |||
| { | |||
| if( notEmpty( _targetType ) ) { | |||
| if( notEmpty( _targetType ) ) | |||
| { | |||
| return "/target:" + _targetType; | |||
| } else { | |||
| } | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -945,9 +973,12 @@ public class CSharp | |||
| */ | |||
| protected String getWin32IconParameter() | |||
| { | |||
| if( _win32icon != null ) { | |||
| if( _win32icon != null ) | |||
| { | |||
| return "/win32icon:" + _win32icon.toString(); | |||
| } else { | |||
| } | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -959,9 +990,12 @@ public class CSharp | |||
| */ | |||
| protected String getWin32ResParameter() | |||
| { | |||
| if( _win32res != null ) { | |||
| if( _win32res != null ) | |||
| { | |||
| return "/win32res:" + _win32res.toString(); | |||
| } else { | |||
| } | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -226,7 +226,8 @@ public class Ilasm | |||
| { | |||
| _targetType = targetType; | |||
| } | |||
| else { | |||
| else | |||
| { | |||
| throw new TaskException( "targetType " + targetType + " is not a valid type" ); | |||
| } | |||
| } | |||
| @@ -306,8 +307,9 @@ public class Ilasm | |||
| public void execute() | |||
| throws TaskException | |||
| { | |||
| if( _srcDir == null ) { | |||
| _srcDir = getBaseDirectory(); | |||
| if( _srcDir == null ) | |||
| { | |||
| _srcDir = getBaseDirectory(); | |||
| } | |||
| //get dependencies list. | |||
| @@ -375,9 +377,12 @@ public class Ilasm | |||
| */ | |||
| protected String getExtraOptionsParameter() | |||
| { | |||
| if( _extraOptions != null && _extraOptions.length() != 0 ) { | |||
| if( _extraOptions != null && _extraOptions.length() != 0 ) | |||
| { | |||
| return _extraOptions; | |||
| } else { | |||
| } | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -389,9 +394,12 @@ public class Ilasm | |||
| */ | |||
| protected String getKeyfileParameter() | |||
| { | |||
| if( _keyfile != null ) { | |||
| if( _keyfile != null ) | |||
| { | |||
| return "/keyfile:" + _keyfile.toString(); | |||
| } else { | |||
| } | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -413,7 +421,8 @@ public class Ilasm | |||
| */ | |||
| protected String getOutputFileParameter() | |||
| { | |||
| if( _outputFile == null || _outputFile.length() == 0 ) { | |||
| if( _outputFile == null || _outputFile.length() == 0 ) | |||
| { | |||
| return null; | |||
| } | |||
| File f = _outputFile; | |||
| @@ -440,16 +449,22 @@ public class Ilasm | |||
| protected String getTargetTypeParameter() | |||
| { | |||
| if( !notEmpty( _targetType ) ) { | |||
| if( !notEmpty( _targetType ) ) | |||
| { | |||
| return null; | |||
| } | |||
| if( _targetType.equals( "exe" ) ) { | |||
| if( _targetType.equals( "exe" ) ) | |||
| { | |||
| return "/exe"; | |||
| } else if( _targetType.equals( "library" ) ) { | |||
| } | |||
| else if( _targetType.equals( "library" ) ) | |||
| { | |||
| return "/dll"; | |||
| } else { | |||
| } | |||
| else | |||
| { | |||
| return null; | |||
| } | |||
| } | |||
| } | |||
| /** | |||
| @@ -9,12 +9,12 @@ package org.apache.tools.ant.taskdefs.optional.dotnet;// imports | |||
| import java.io.File; | |||
| import java.io.IOException; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.avalon.framework.logger.AbstractLogEnabled; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * This is a helper class to spawn net commands out. In its initial form it | |||
| @@ -16,6 +16,7 @@ import java.io.OutputStream; | |||
| import java.util.ArrayList; | |||
| import java.util.Hashtable; | |||
| import java.util.Iterator; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.taskdefs.Java; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| @@ -24,7 +25,6 @@ import org.apache.tools.ant.types.Argument; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.util.FileUtils; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * BorlandDeploymentTool is dedicated to the Borland Application Server 4.5 and | |||
| @@ -8,13 +8,13 @@ | |||
| package org.apache.tools.ant.taskdefs.optional.ejb; | |||
| import java.io.File; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Argument; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.Argument; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * BorlandGenerateClient is dedicated to the Borland Application Server 4.5 This | |||
| @@ -9,10 +9,10 @@ package org.apache.tools.ant.taskdefs.optional.ejb; | |||
| import java.io.File; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.Java; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.types.Argument; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.Path; | |||
| /** | |||
| @@ -15,8 +15,8 @@ import javax.xml.parsers.ParserConfigurationException; | |||
| import javax.xml.parsers.SAXParser; | |||
| import javax.xml.parsers.SAXParserFactory; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.EnumeratedAttribute; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.Path; | |||
| @@ -9,10 +9,10 @@ package org.apache.tools.ant.taskdefs.optional.ejb; | |||
| import java.io.File; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.Java; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.types.Argument; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.Path; | |||
| /** | |||
| @@ -12,8 +12,8 @@ import java.io.FileInputStream; | |||
| import java.io.FileOutputStream; | |||
| import java.io.IOException; | |||
| import java.io.InputStream; | |||
| import java.net.URLClassLoader; | |||
| import java.net.URL; | |||
| import java.net.URLClassLoader; | |||
| import java.util.ArrayList; | |||
| import java.util.HashSet; | |||
| import java.util.Hashtable; | |||
| @@ -26,13 +26,12 @@ import java.util.jar.Manifest; | |||
| import java.util.zip.ZipEntry; | |||
| import javax.xml.parsers.SAXParser; | |||
| import org.apache.avalon.framework.logger.AbstractLogEnabled; | |||
| import org.apache.bcel.classfile.JavaClass; | |||
| import org.apache.bcel.classfile.ClassParser; | |||
| import org.apache.bcel.classfile.JavaClass; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.Project; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.PathUtil; | |||
| @@ -608,7 +607,8 @@ public class GenericDeploymentTool | |||
| while( i.hasNext() ) | |||
| { | |||
| String entryName = (String)i.next(); | |||
| if( entryName.endsWith( ".class" ) ) { | |||
| if( entryName.endsWith( ".class" ) ) | |||
| { | |||
| newSet.add( entryName.substring( 0, entryName.length() - ".class".length() ).replace( File.separatorChar, '/' ) ); | |||
| } | |||
| } | |||
| @@ -12,8 +12,8 @@ import java.io.FileInputStream; | |||
| import java.io.FileOutputStream; | |||
| import java.io.IOException; | |||
| import java.io.InputStream; | |||
| import java.net.URLClassLoader; | |||
| import java.net.URL; | |||
| import java.net.URLClassLoader; | |||
| import java.util.Hashtable; | |||
| import java.util.Iterator; | |||
| import java.util.jar.JarEntry; | |||
| @@ -11,8 +11,8 @@ import java.io.File; | |||
| import java.io.FileOutputStream; | |||
| import java.io.IOException; | |||
| import java.io.InputStream; | |||
| import java.net.URLClassLoader; | |||
| import java.net.URL; | |||
| import java.net.URLClassLoader; | |||
| import java.util.Hashtable; | |||
| import java.util.Iterator; | |||
| import java.util.jar.JarEntry; | |||
| @@ -943,7 +943,8 @@ public class WebsphereDeploymentTool | |||
| " " + tempdir + | |||
| " " + destJar.getPath() + | |||
| " " + getOptions(); | |||
| if( getCombinedClasspath() != null && getCombinedClasspath().toString().length() > 0 ) { | |||
| if( getCombinedClasspath() != null && getCombinedClasspath().toString().length() > 0 ) | |||
| { | |||
| args += " -cp " + getCombinedClasspath(); | |||
| } | |||
| @@ -20,8 +20,8 @@ import java.util.Hashtable; | |||
| import java.util.Locale; | |||
| import org.apache.avalon.excalibur.io.FileUtil; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.ScannerUtil; | |||
| @@ -44,7 +44,6 @@ import org.apache.tools.ant.BuildEvent; | |||
| import org.apache.tools.ant.BuildListener; | |||
| import org.apache.tools.ant.Project; | |||
| /** | |||
| * This is a simple grafical user interface to provide the information needed by | |||
| * ANT and to start the build-process within IBM VisualAge for Java. <p> | |||
| @@ -1544,31 +1543,38 @@ public class VAJAntToolGUI extends Frame | |||
| } | |||
| } | |||
| // MenuItems | |||
| if( e.getSource() == VAJAntToolGUI.this.getSaveMenuItem() ) { | |||
| if( e.getSource() == VAJAntToolGUI.this.getSaveMenuItem() ) | |||
| { | |||
| saveBuildInfo(); | |||
| } | |||
| if( e.getSource() == VAJAntToolGUI.this.getAboutMenuItem() ) { | |||
| if( e.getSource() == VAJAntToolGUI.this.getAboutMenuItem() ) | |||
| { | |||
| getAboutDialog().show(); | |||
| } | |||
| if( e.getSource() == VAJAntToolGUI.this.getShowLogMenuItem() ) { | |||
| if( e.getSource() == VAJAntToolGUI.this.getShowLogMenuItem() ) | |||
| { | |||
| getMessageFrame().show(); | |||
| } | |||
| /* | |||
| * #### About dialog #### | |||
| */ | |||
| if( e.getSource() == VAJAntToolGUI.this.getAboutOkButton() ) { | |||
| if( e.getSource() == VAJAntToolGUI.this.getAboutOkButton() ) | |||
| { | |||
| getAboutDialog().dispose(); | |||
| } | |||
| /* | |||
| * #### Log frame #### | |||
| */ | |||
| if( e.getSource() == VAJAntToolGUI.this.getMessageOkButton() ) { | |||
| if( e.getSource() == VAJAntToolGUI.this.getMessageOkButton() ) | |||
| { | |||
| getMessageFrame().dispose(); | |||
| } | |||
| if( e.getSource() == VAJAntToolGUI.this.getMessageClearLogButton() ) { | |||
| if( e.getSource() == VAJAntToolGUI.this.getMessageClearLogButton() ) | |||
| { | |||
| getMessageTextArea().setText( "" ); | |||
| } | |||
| if( e.getSource() == VAJAntToolGUI.this.getMessageOkButton() ) { | |||
| if( e.getSource() == VAJAntToolGUI.this.getMessageOkButton() ) | |||
| { | |||
| getMessageFrame().dispose(); | |||
| } | |||
| } | |||
| @@ -1587,13 +1593,16 @@ public class VAJAntToolGUI extends Frame | |||
| { | |||
| try | |||
| { | |||
| if( e.getSource() == VAJAntToolGUI.this.getTargetList() ) { | |||
| if( e.getSource() == VAJAntToolGUI.this.getTargetList() ) | |||
| { | |||
| getBuildButton().setEnabled( true ); | |||
| } | |||
| if( e.getSource() == VAJAntToolGUI.this.getMessageOutputLevelChoice() ) { | |||
| if( e.getSource() == VAJAntToolGUI.this.getMessageOutputLevelChoice() ) | |||
| { | |||
| getBuildInfo().setOutputMessageLevel( getMessageOutputLevelChoice().getSelectedIndex() ); | |||
| } | |||
| if( e.getSource() == VAJAntToolGUI.this.getTargetList() ) { | |||
| if( e.getSource() == VAJAntToolGUI.this.getTargetList() ) | |||
| { | |||
| getBuildInfo().setTarget( getTargetList().getSelectedItem() ); | |||
| } | |||
| } | |||
| @@ -1610,10 +1619,12 @@ public class VAJAntToolGUI extends Frame | |||
| */ | |||
| public void propertyChange( java.beans.PropertyChangeEvent evt ) | |||
| { | |||
| if( evt.getSource() == VAJAntToolGUI.this.getBuildInfo() && ( evt.getPropertyName().equals( "projectName" ) ) ) { | |||
| if( evt.getSource() == VAJAntToolGUI.this.getBuildInfo() && ( evt.getPropertyName().equals( "projectName" ) ) ) | |||
| { | |||
| connectProjectNameToLabel(); | |||
| } | |||
| if( evt.getSource() == VAJAntToolGUI.this.getBuildInfo() && ( evt.getPropertyName().equals( "buildFileName" ) ) ) { | |||
| if( evt.getSource() == VAJAntToolGUI.this.getBuildInfo() && ( evt.getPropertyName().equals( "buildFileName" ) ) ) | |||
| { | |||
| connectBuildFileNameToTextField(); | |||
| } | |||
| } | |||
| @@ -1625,7 +1636,8 @@ public class VAJAntToolGUI extends Frame | |||
| */ | |||
| public void textValueChanged( TextEvent e ) | |||
| { | |||
| if( e.getSource() == VAJAntToolGUI.this.getBuildFileTextField() ) { | |||
| if( e.getSource() == VAJAntToolGUI.this.getBuildFileTextField() ) | |||
| { | |||
| connectTextFieldToBuildFileName(); | |||
| } | |||
| } | |||
| @@ -1652,10 +1664,12 @@ public class VAJAntToolGUI extends Frame | |||
| dispose(); | |||
| System.exit( 0 ); | |||
| } | |||
| if( e.getSource() == VAJAntToolGUI.this.getAboutDialog() ) { | |||
| if( e.getSource() == VAJAntToolGUI.this.getAboutDialog() ) | |||
| { | |||
| getAboutDialog().dispose(); | |||
| } | |||
| if( e.getSource() == VAJAntToolGUI.this.getMessageFrame() ) { | |||
| if( e.getSource() == VAJAntToolGUI.this.getMessageFrame() ) | |||
| { | |||
| getMessageFrame().dispose(); | |||
| } | |||
| } | |||
| @@ -8,8 +8,8 @@ | |||
| package org.apache.tools.ant.taskdefs.optional.ide; | |||
| import java.io.File; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.TaskContext; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.framework.Pattern; | |||
| import org.apache.myrmidon.framework.PatternSet; | |||
| import org.apache.myrmidon.framework.PatternUtil; | |||
| @@ -11,15 +11,14 @@ import java.io.File; | |||
| import java.io.IOException; | |||
| import java.util.Enumeration; | |||
| import java.util.Hashtable; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.CommandlineJava; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.PathUtil; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * Taskdef for the JJTree compiler compiler. | |||
| @@ -11,17 +11,14 @@ import java.io.File; | |||
| import java.io.IOException; | |||
| import java.util.Enumeration; | |||
| import java.util.Hashtable; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.CommandlineJava; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.PathUtil; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.avalon.excalibur.util.StringUtil; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * Taskdef for the JavaCC compiler compiler. | |||
| @@ -11,15 +11,14 @@ import java.io.File; | |||
| import java.io.FileWriter; | |||
| import java.io.IOException; | |||
| import java.io.PrintWriter; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.CommandlineJava; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.util.FileUtils; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * Ant task to run JDepend tests. <p> | |||
| @@ -234,7 +233,8 @@ public class JDependTask | |||
| File f = new File( elements[ i ] ); | |||
| // not necessary as JDepend would fail, but why loose some time? | |||
| if( !f.exists() || !f.isDirectory() ) { | |||
| if( !f.exists() || !f.isDirectory() ) | |||
| { | |||
| throw new TaskException( "\"" + f.getPath() + "\" does not represent a valid directory. JDepend would fail." ); | |||
| } | |||
| commandline.addArgument( f.getPath() ); | |||
| @@ -11,10 +11,10 @@ import java.io.File; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapter; | |||
| import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapterFactory; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.Path; | |||
| /** | |||
| @@ -101,9 +101,12 @@ public class JspC extends MatchingTask | |||
| public void setClasspath( Path cp ) | |||
| throws TaskException | |||
| { | |||
| if( classpath == null ) { | |||
| if( classpath == null ) | |||
| { | |||
| classpath = cp; | |||
| } else { | |||
| } | |||
| else | |||
| { | |||
| classpath.append( cp ); | |||
| } | |||
| } | |||
| @@ -299,7 +302,8 @@ public class JspC extends MatchingTask | |||
| public Path createClasspath() | |||
| throws TaskException | |||
| { | |||
| if( classpath == null ) { | |||
| if( classpath == null ) | |||
| { | |||
| classpath = new Path(); | |||
| } | |||
| Path path1 = classpath; | |||
| @@ -334,9 +338,11 @@ public class JspC extends MatchingTask | |||
| // calculate where the files will end up: | |||
| File dest = null; | |||
| if( packageName == null ) { | |||
| if( packageName == null ) | |||
| { | |||
| dest = destDir; | |||
| } else | |||
| } | |||
| else | |||
| { | |||
| String path = destDir.getPath() + File.separatorChar + | |||
| packageName.replace( '.', File.separatorChar ); | |||
| @@ -12,11 +12,11 @@ import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.StringTokenizer; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.Java; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.Argument; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.Path; | |||
| /** | |||
| * Class to precompile JSP's using weblogic's jsp compiler (weblogic.jspc) | |||
| @@ -10,8 +10,8 @@ package org.apache.tools.ant.taskdefs.optional.jsp.compilers; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.taskdefs.Java; | |||
| import org.apache.tools.ant.taskdefs.optional.jsp.JspC; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.Argument; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| /** | |||
| * The implementation of the jasper compiler. This is a cut-and-paste of the | |||
| @@ -37,12 +37,14 @@ public class JasperC | |||
| // the project log | |||
| //FIXME | |||
| Java java = null;//(Java)( getJspc().getProject() ).createTask( "java" ); | |||
| if( getJspc().getClasspath() != null ) { | |||
| if( getJspc().getClasspath() != null ) | |||
| { | |||
| java.addClasspath( getJspc().getClasspath() ); | |||
| } | |||
| java.setClassname( "org.apache.jasper.JspC" ); | |||
| String args[] = cmd.getArguments(); | |||
| for( int i = 0; i < args.length; i++ ) { | |||
| for( int i = 0; i < args.length; i++ ) | |||
| { | |||
| java.addArg( new Argument( args[ i ] ) ); | |||
| } | |||
| java.execute(); | |||
| @@ -13,7 +13,6 @@ import java.util.Arrays; | |||
| import java.util.Iterator; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.ScannerUtil; | |||
| @@ -19,20 +19,19 @@ import java.util.Hashtable; | |||
| import java.util.Iterator; | |||
| import java.util.Properties; | |||
| import java.util.Random; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.taskdefs.exec.LogOutputStream; | |||
| import org.apache.tools.ant.types.Argument; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.CommandlineJava; | |||
| import org.apache.tools.ant.types.EnumeratedAttribute; | |||
| import org.apache.tools.ant.types.EnvironmentVariable; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.SysProperties; | |||
| import org.apache.tools.ant.types.PathUtil; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.tools.ant.types.SysProperties; | |||
| /** | |||
| * Ant task to run JUnit tests. <p> | |||
| @@ -671,7 +670,8 @@ public class JUnitTask extends Task | |||
| } | |||
| finally | |||
| { | |||
| if( !propsFile.delete() ) { | |||
| if( !propsFile.delete() ) | |||
| { | |||
| throw new TaskException( "Could not delete temporary properties file." ); | |||
| } | |||
| } | |||
| @@ -15,7 +15,6 @@ import java.text.NumberFormat; | |||
| import java.util.Hashtable; | |||
| import junit.framework.AssertionFailedError; | |||
| import junit.framework.Test; | |||
| import org.apache.avalon.excalibur.util.StringUtil; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| @@ -18,7 +18,6 @@ import javax.xml.parsers.DocumentBuilder; | |||
| import javax.xml.parsers.DocumentBuilderFactory; | |||
| import junit.framework.AssertionFailedError; | |||
| import junit.framework.Test; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.w3c.dom.Document; | |||
| import org.w3c.dom.Element; | |||
| @@ -19,8 +19,8 @@ import javax.xml.parsers.DocumentBuilder; | |||
| import javax.xml.parsers.DocumentBuilderFactory; | |||
| import org.apache.avalon.framework.ExceptionUtil; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.ScannerUtil; | |||
| import org.w3c.dom.Document; | |||
| @@ -15,17 +15,17 @@ import java.util.ArrayList; | |||
| import java.util.Hashtable; | |||
| import java.util.Iterator; | |||
| import java.util.Random; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.myrmidon.api.AbstractTask; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Argument; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.CommandlineJava; | |||
| import org.apache.tools.ant.types.DirectoryScanner; | |||
| import org.apache.tools.ant.types.FileSet; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.ScannerUtil; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * Somewhat abstract framework to be used for other metama 2.0 tasks. This | |||
| @@ -13,15 +13,15 @@ import java.io.IOException; | |||
| import java.io.PrintWriter; | |||
| import java.util.ArrayList; | |||
| import java.util.Random; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| import org.apache.avalon.excalibur.io.IOUtil; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.Task; | |||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | |||
| import org.apache.tools.ant.types.Argument; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.tools.ant.types.CommandlineJava; | |||
| import org.apache.tools.ant.types.Path; | |||
| import org.apache.tools.ant.types.Commandline; | |||
| import org.apache.avalon.excalibur.io.IOUtil; | |||
| import org.apache.aut.nativelib.ExecManager; | |||
| /** | |||
| * Simple Metamata MParse task based on the original written by <a | |||