git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271339 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -16,7 +16,6 @@ import org.apache.myrmidon.api.TaskContext; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.AbstractContainerTask; | import org.apache.myrmidon.framework.AbstractContainerTask; | ||||
| import org.apache.myrmidon.framework.DataType; | import org.apache.myrmidon.framework.DataType; | ||||
| import org.apache.myrmidon.interfaces.type.TypeFactory; | |||||
| /** | /** | ||||
| * This is the property "task" to declare a binding of a datatype to a name. | * This is the property "task" to declare a binding of a datatype to a name. | ||||
| @@ -423,7 +423,7 @@ public class CopyTask | |||||
| * to a destination. | * to a destination. | ||||
| */ | */ | ||||
| protected void doOperation( final String sourceFilename, | protected void doOperation( final String sourceFilename, | ||||
| final String destinationFilename ) | |||||
| final String destinationFilename ) | |||||
| throws IOException | throws IOException | ||||
| { | { | ||||
| final File source = new File( sourceFilename ); | final File source = new File( sourceFilename ); | ||||
| @@ -23,8 +23,8 @@ import java.io.Writer; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.avalon.excalibur.io.IOUtil; | import org.apache.avalon.excalibur.io.IOUtil; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.types.FilterSet; | |||||
| import org.apache.myrmidon.framework.FilterSetCollection; | import org.apache.myrmidon.framework.FilterSetCollection; | ||||
| import org.apache.tools.ant.types.FilterSet; | |||||
| /** | /** | ||||
| * A task used to copy files and simultaneously apply a | * A task used to copy files and simultaneously apply a | ||||
| @@ -16,7 +16,6 @@ import org.apache.myrmidon.api.TaskException; | |||||
| import org.apache.myrmidon.aspects.AspectHandler; | import org.apache.myrmidon.aspects.AspectHandler; | ||||
| import org.apache.myrmidon.framework.AbstractContainerTask; | import org.apache.myrmidon.framework.AbstractContainerTask; | ||||
| import org.apache.myrmidon.interfaces.aspect.AspectManager; | import org.apache.myrmidon.interfaces.aspect.AspectManager; | ||||
| import org.apache.myrmidon.interfaces.type.TypeFactory; | |||||
| /** | /** | ||||
| * Task that definesMethod to register a single converter. | * Task that definesMethod to register a single converter. | ||||
| @@ -10,11 +10,11 @@ package org.apache.antlib.sound; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Random; | import java.util.Random; | ||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||||
| import org.apache.avalon.excalibur.i18n.Resources; | |||||
| import org.apache.myrmidon.api.AbstractTask; | import org.apache.myrmidon.api.AbstractTask; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.interfaces.workspace.Workspace; | import org.apache.myrmidon.interfaces.workspace.Workspace; | ||||
| import org.apache.avalon.excalibur.i18n.Resources; | |||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||||
| /** | /** | ||||
| * This is an example of an AntTask that makes of use of the AntSoundPlayer. | * This is an example of an AntTask that makes of use of the AntSoundPlayer. | ||||
| @@ -7,9 +7,6 @@ | |||||
| */ | */ | ||||
| package org.apache.aut.converter; | package org.apache.aut.converter; | ||||
| import org.apache.avalon.framework.context.Context; | |||||
| import java.util.Map; | |||||
| /** | /** | ||||
| * Instances of this interface are used to convert between different types. | * Instances of this interface are used to convert between different types. | ||||
| * | * | ||||
| @@ -7,15 +7,14 @@ | |||||
| */ | */ | ||||
| package org.apache.aut.manifest; | package org.apache.aut.manifest; | ||||
| import java.io.BufferedReader; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.io.InputStream; | import java.io.InputStream; | ||||
| import java.io.InputStreamReader; | import java.io.InputStreamReader; | ||||
| import java.io.PrintWriter; | import java.io.PrintWriter; | ||||
| import java.io.Reader; | import java.io.Reader; | ||||
| import java.io.UnsupportedEncodingException; | import java.io.UnsupportedEncodingException; | ||||
| import java.io.BufferedReader; | |||||
| import java.util.jar.Attributes; | import java.util.jar.Attributes; | ||||
| import org.apache.myrmidon.api.TaskException; | |||||
| import org.apache.tools.ant.taskdefs.manifest.Manifest; | import org.apache.tools.ant.taskdefs.manifest.Manifest; | ||||
| import org.apache.tools.ant.taskdefs.manifest.Section; | import org.apache.tools.ant.taskdefs.manifest.Section; | ||||
| @@ -39,7 +39,6 @@ public abstract class AbstractFileObject | |||||
| private AbstractFileSystem m_fs; | private AbstractFileSystem m_fs; | ||||
| private DefaultFileContent m_content; | private DefaultFileContent m_content; | ||||
| // Cached info | // Cached info | ||||
| private boolean m_attached; | private boolean m_attached; | ||||
| private AbstractFileObject m_parent; | private AbstractFileObject m_parent; | ||||
| @@ -36,7 +36,6 @@ class FtpFileObject | |||||
| private FTPFile m_fileInfo; | private FTPFile m_fileInfo; | ||||
| private FTPFile[] m_children; | private FTPFile[] m_children; | ||||
| public FtpFileObject( final FileName name, final FtpFileSystem fileSystem ) | public FtpFileObject( final FileName name, final FtpFileSystem fileSystem ) | ||||
| { | { | ||||
| super( name, fileSystem ); | super( name, fileSystem ); | ||||
| @@ -15,8 +15,8 @@ import javax.xml.parsers.SAXParser; | |||||
| import javax.xml.parsers.SAXParserFactory; | import javax.xml.parsers.SAXParserFactory; | ||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | import org.apache.avalon.excalibur.i18n.ResourceManager; | ||||
| import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
| import org.apache.avalon.excalibur.util.StringUtil; | |||||
| import org.apache.avalon.excalibur.io.FileUtil; | import org.apache.avalon.excalibur.io.FileUtil; | ||||
| import org.apache.avalon.excalibur.util.StringUtil; | |||||
| import org.apache.avalon.framework.CascadingException; | import org.apache.avalon.framework.CascadingException; | ||||
| import org.apache.avalon.framework.Version; | import org.apache.avalon.framework.Version; | ||||
| import org.apache.avalon.framework.configuration.Configuration; | import org.apache.avalon.framework.configuration.Configuration; | ||||
| @@ -129,7 +129,7 @@ public class DefaultProjectBuilder | |||||
| //get project-level attributes | //get project-level attributes | ||||
| final String projectName = configuration.getAttribute( "name", | final String projectName = configuration.getAttribute( "name", | ||||
| FileUtil.removeExtension(file.getName()) ); | |||||
| FileUtil.removeExtension( file.getName() ) ); | |||||
| final String baseDirectoryName = configuration.getAttribute( "basedir", null ); | final String baseDirectoryName = configuration.getAttribute( "basedir", null ); | ||||
| final String defaultTarget = configuration.getAttribute( "default", "main" ); | final String defaultTarget = configuration.getAttribute( "default", "main" ); | ||||
| final Version version = getVersion( configuration ); | final Version version = getVersion( configuration ); | ||||
| @@ -23,13 +23,13 @@ import org.apache.avalon.framework.context.Context; | |||||
| import org.apache.avalon.framework.context.ContextException; | import org.apache.avalon.framework.context.ContextException; | ||||
| import org.apache.avalon.framework.logger.AbstractLogEnabled; | import org.apache.avalon.framework.logger.AbstractLogEnabled; | ||||
| import org.apache.avalon.framework.logger.LogEnabled; | import org.apache.avalon.framework.logger.LogEnabled; | ||||
| import org.apache.myrmidon.framework.DataType; | |||||
| import org.apache.myrmidon.interfaces.configurer.Configurer; | import org.apache.myrmidon.interfaces.configurer.Configurer; | ||||
| import org.apache.myrmidon.interfaces.converter.MasterConverter; | import org.apache.myrmidon.interfaces.converter.MasterConverter; | ||||
| import org.apache.myrmidon.interfaces.role.RoleManager; | |||||
| import org.apache.myrmidon.interfaces.type.TypeException; | import org.apache.myrmidon.interfaces.type.TypeException; | ||||
| import org.apache.myrmidon.interfaces.type.TypeFactory; | import org.apache.myrmidon.interfaces.type.TypeFactory; | ||||
| import org.apache.myrmidon.interfaces.type.TypeManager; | import org.apache.myrmidon.interfaces.type.TypeManager; | ||||
| import org.apache.myrmidon.interfaces.role.RoleManager; | |||||
| import org.apache.myrmidon.framework.DataType; | |||||
| /** | /** | ||||
| * Class used to configure tasks. | * Class used to configure tasks. | ||||
| @@ -472,10 +472,10 @@ public class DefaultConfigurer | |||||
| // Try a typed property | // Try a typed property | ||||
| final PropertyConfigurer propertyConfigurer = configurer.getTypedProperty(); | final PropertyConfigurer propertyConfigurer = configurer.getTypedProperty(); | ||||
| if( ! ignoreRoleName ) | |||||
| if( !ignoreRoleName ) | |||||
| { | { | ||||
| final String roleShorthand = m_roleManager.getNameForRole( propertyConfigurer.getType().getName() ); | final String roleShorthand = m_roleManager.getNameForRole( propertyConfigurer.getType().getName() ); | ||||
| if( ! name.equalsIgnoreCase(roleShorthand) ) | |||||
| if( !name.equalsIgnoreCase( roleShorthand ) ) | |||||
| { | { | ||||
| // Rethrow the original exception | // Rethrow the original exception | ||||
| throw exc; | throw exc; | ||||
| @@ -510,7 +510,7 @@ public class DefaultConfigurer | |||||
| } | } | ||||
| // Check the types | // Check the types | ||||
| if( ! type.isInstance( obj ) ) | |||||
| if( !type.isInstance( obj ) ) | |||||
| { | { | ||||
| final String message = | final String message = | ||||
| REZ.getString( "mismatched-typed-object.error", name, type.getName() ); | REZ.getString( "mismatched-typed-object.error", name, type.getName() ); | ||||
| @@ -124,7 +124,7 @@ class DefaultObjectConfigurer | |||||
| type = addMethod.getParameterTypes()[ 0 ]; | type = addMethod.getParameterTypes()[ 0 ]; | ||||
| } | } | ||||
| final boolean isTypedProp = (propName.length() == 0); | |||||
| final boolean isTypedProp = ( propName.length() == 0 ); | |||||
| if( isTypedProp && !type.isInterface() ) | if( isTypedProp && !type.isInterface() ) | ||||
| { | { | ||||
| final String message = | final String message = | ||||
| @@ -190,7 +190,7 @@ class DefaultObjectConfigurer | |||||
| // Extract property name | // Extract property name | ||||
| final String propName = extractName( 3, methodName ); | final String propName = extractName( 3, methodName ); | ||||
| final Class type = method.getParameterTypes()[0]; | |||||
| final Class type = method.getParameterTypes()[ 0 ]; | |||||
| // Add to the adders map | // Add to the adders map | ||||
| if( adders.containsKey( propName ) ) | if( adders.containsKey( propName ) ) | ||||
| @@ -76,7 +76,7 @@ public class DefaultDeployer | |||||
| public Deployer createChildDeployer( ComponentManager componentManager ) | public Deployer createChildDeployer( ComponentManager componentManager ) | ||||
| throws ComponentException | throws ComponentException | ||||
| { | { | ||||
| final DefaultDeployer child = new DefaultDeployer( ); | |||||
| final DefaultDeployer child = new DefaultDeployer(); | |||||
| setupLogger( child ); | setupLogger( child ); | ||||
| child.compose( componentManager ); | child.compose( componentManager ); | ||||
| return child; | return child; | ||||
| @@ -39,7 +39,7 @@ class RoleDescriptorBuilder | |||||
| // Check version | // Check version | ||||
| final String versionString = config.getAttribute( "version" ); | final String versionString = config.getAttribute( "version" ); | ||||
| final Version version = Version.getVersion( versionString ); | final Version version = Version.getVersion( versionString ); | ||||
| if( ! ROLE_DESCRIPTOR_VERSION.complies( version ) ) | |||||
| if( !ROLE_DESCRIPTOR_VERSION.complies( version ) ) | |||||
| { | { | ||||
| final String message = REZ.getString( "role-descriptor-version.error", version, ROLE_DESCRIPTOR_VERSION ); | final String message = REZ.getString( "role-descriptor-version.error", version, ROLE_DESCRIPTOR_VERSION ); | ||||
| throw new DeploymentException( message ); | throw new DeploymentException( message ); | ||||
| @@ -39,7 +39,7 @@ class ServiceDescriptorBuilder | |||||
| // Check version | // Check version | ||||
| final String versionString = config.getAttribute( "version" ); | final String versionString = config.getAttribute( "version" ); | ||||
| final Version version = Version.getVersion( versionString ); | final Version version = Version.getVersion( versionString ); | ||||
| if( ! SERVICE_DESCRIPTOR_VERSION.complies( version ) ) | |||||
| if( !SERVICE_DESCRIPTOR_VERSION.complies( version ) ) | |||||
| { | { | ||||
| final String message = REZ.getString( "service-descriptor-version.error", version, SERVICE_DESCRIPTOR_VERSION ); | final String message = REZ.getString( "service-descriptor-version.error", version, SERVICE_DESCRIPTOR_VERSION ); | ||||
| throw new DeploymentException( message ); | throw new DeploymentException( message ); | ||||
| @@ -42,7 +42,7 @@ class TypeDescriptorBuilder | |||||
| // Check version | // Check version | ||||
| final String versionString = config.getAttribute( "version" ); | final String versionString = config.getAttribute( "version" ); | ||||
| final Version version = Version.getVersion( versionString ); | final Version version = Version.getVersion( versionString ); | ||||
| if( ! TYPE_DESCRIPTOR_VERSION.complies( version ) ) | |||||
| if( !TYPE_DESCRIPTOR_VERSION.complies( version ) ) | |||||
| { | { | ||||
| final String message = REZ.getString( "type-descriptor-version.error", version, TYPE_DESCRIPTOR_VERSION ); | final String message = REZ.getString( "type-descriptor-version.error", version, TYPE_DESCRIPTOR_VERSION ); | ||||
| throw new DeploymentException( message ); | throw new DeploymentException( message ); | ||||
| @@ -369,7 +369,7 @@ public class DefaultEmbeddor | |||||
| final String message = REZ.getString( "bad-type.error", component, clazz.getName() ); | final String message = REZ.getString( "bad-type.error", component, clazz.getName() ); | ||||
| throw new Exception( message ); | throw new Exception( message ); | ||||
| } | } | ||||
| if( !( object instanceof Component) ) | |||||
| if( !( object instanceof Component ) ) | |||||
| { | { | ||||
| final String message = REZ.getString( "bad-type.error", component, Component.class.getName() ); | final String message = REZ.getString( "bad-type.error", component, Component.class.getName() ); | ||||
| throw new Exception( message ); | throw new Exception( message ); | ||||
| @@ -128,7 +128,7 @@ public class DefaultServiceManager | |||||
| // Create the service | // Create the service | ||||
| final Object service = factory.createService(); | final Object service = factory.createService(); | ||||
| if( ! serviceType.isInstance( service ) ) | |||||
| if( !serviceType.isInstance( service ) ) | |||||
| { | { | ||||
| final String message = REZ.getString( "mismatched-service-type.error", serviceType.getName(), service.getClass().getName() ); | final String message = REZ.getString( "mismatched-service-type.error", serviceType.getName(), service.getClass().getName() ); | ||||
| throw new ServiceException( message ); | throw new ServiceException( message ); | ||||
| @@ -9,7 +9,6 @@ package org.apache.myrmidon.components.workspace; | |||||
| import org.apache.log.LogEvent; | import org.apache.log.LogEvent; | ||||
| import org.apache.log.LogTarget; | import org.apache.log.LogTarget; | ||||
| import org.apache.myrmidon.listeners.ProjectListener; | |||||
| /** | /** | ||||
| * Adapter between Avalon LogKit and Project listener interfaces. | * Adapter between Avalon LogKit and Project listener interfaces. | ||||
| @@ -7,11 +7,8 @@ | |||||
| */ | */ | ||||
| package org.apache.myrmidon.components.workspace; | package org.apache.myrmidon.components.workspace; | ||||
| import org.apache.myrmidon.listeners.ProjectListener; | |||||
| import org.apache.myrmidon.listeners.ProjectEvent; | |||||
| import org.apache.myrmidon.listeners.TargetEvent; | |||||
| import org.apache.myrmidon.listeners.TaskEvent; | |||||
| import org.apache.myrmidon.listeners.LogEvent; | import org.apache.myrmidon.listeners.LogEvent; | ||||
| import org.apache.myrmidon.listeners.ProjectListener; | |||||
| /** | /** | ||||
| * Support for the project listener event dispatching. | * Support for the project listener event dispatching. | ||||
| @@ -112,7 +109,8 @@ public class ProjectListenerSupport | |||||
| public void targetStarted( final String projectName, final String targetName ) | public void targetStarted( final String projectName, final String targetName ) | ||||
| { | { | ||||
| m_projectName = projectName; | m_projectName = projectName; | ||||
| m_targetName = targetName;; | |||||
| m_targetName = targetName; | |||||
| ; | |||||
| m_taskName = null; | m_taskName = null; | ||||
| for( int i = 0; i < m_listeners.length; i++ ) | for( int i = 0; i < m_listeners.length; i++ ) | ||||
| @@ -100,7 +100,7 @@ public class DefaultTypeFactory | |||||
| private String getClassName( final String name ) | private String getClassName( final String name ) | ||||
| { | { | ||||
| return (String)m_classNames.get( name ); | |||||
| return (String)m_classNames.get( name ); | |||||
| } | } | ||||
| protected ClassLoader getClassLoader() | protected ClassLoader getClassLoader() | ||||
| @@ -7,8 +7,8 @@ | |||||
| */ | */ | ||||
| package org.apache.myrmidon.listeners; | package org.apache.myrmidon.listeners; | ||||
| import org.apache.avalon.framework.ExceptionUtil; | |||||
| import java.io.PrintWriter; | import java.io.PrintWriter; | ||||
| import org.apache.avalon.framework.ExceptionUtil; | |||||
| /** | /** | ||||
| * Classic listener that emulates the default ant1.x listener. | * Classic listener that emulates the default ant1.x listener. | ||||
| @@ -45,7 +45,7 @@ public class ClassicProjectListener | |||||
| /** | /** | ||||
| * Notify listener of log message event. | * Notify listener of log message event. | ||||
| */ | */ | ||||
| public void log( final LogEvent event ) | |||||
| public void log( final LogEvent event ) | |||||
| { | { | ||||
| writeMessage( event ); | writeMessage( event ); | ||||
| writeThrowable( event ); | writeThrowable( event ); | ||||
| @@ -7,8 +7,6 @@ | |||||
| */ | */ | ||||
| package org.apache.myrmidon.listeners; | package org.apache.myrmidon.listeners; | ||||
| import org.apache.avalon.framework.ExceptionUtil; | |||||
| /** | /** | ||||
| * Default listener that emulates the Ant 1.x no banner listener. | * Default listener that emulates the Ant 1.x no banner listener. | ||||
| * | * | ||||
| @@ -7,9 +7,6 @@ | |||||
| */ | */ | ||||
| package org.apache.myrmidon.listeners; | package org.apache.myrmidon.listeners; | ||||
| import java.io.PrintStream; | |||||
| import java.io.PrintWriter; | |||||
| /** | /** | ||||
| * A project listener that emulated the Ant 1.x -emacs mode. | * A project listener that emulated the Ant 1.x -emacs mode. | ||||
| * | * | ||||
| @@ -7,8 +7,6 @@ | |||||
| */ | */ | ||||
| package org.apache.myrmidon.listeners; | package org.apache.myrmidon.listeners; | ||||
| import org.apache.myrmidon.interfaces.model.Project; | |||||
| /** | /** | ||||
| * A project level event. | * A project level event. | ||||
| * | * | ||||
| @@ -7,8 +7,6 @@ | |||||
| */ | */ | ||||
| package org.apache.myrmidon.listeners; | package org.apache.myrmidon.listeners; | ||||
| import org.apache.myrmidon.interfaces.model.Target; | |||||
| /** | /** | ||||
| * A target level event. | * A target level event. | ||||
| * | * | ||||