donaldp     01/12/22 14:59:40

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec
                        Execute.java
  Log:
  Removed some unused variables and moved private methods to the bottom of the 
file
  
  Revision  Changes    Path
  1.12      +30 -32    
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute.java
  
  Index: Execute.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Execute.java      2001/12/22 22:53:26     1.11
  +++ Execute.java      2001/12/22 22:59:40     1.12
  @@ -38,14 +38,12 @@
       /**
        * Used to destroy processes when the VM exits.
        */
  -    private static ProcessDestroyer c_processDestroyer = new 
ProcessDestroyer();
  +    private static final ProcessDestroyer c_processDestroyer = new 
ProcessDestroyer();
   
       private ExecMetaData m_metaData;
       private String[] m_command;
       private Properties m_environment;
  -    private int m_exitValue;
       private File m_workingDirectory = new File( "." );
  -    private Project m_project;
       private boolean m_newEnvironment;
   
       /**
  @@ -222,9 +220,9 @@
        *
        * @param newenv whether to propagate the process environment.
        */
  -    public void setNewenvironment( boolean newenv )
  +    public void setNewenvironment( boolean newEnvironment )
       {
  -        m_newEnvironment = newenv;
  +        m_newEnvironment = newEnvironment;
       }
   
       /**
  @@ -237,7 +235,7 @@
        */
       public void setVMLauncher( boolean useVMLauncher )
       {
  -        this.m_useVMLauncher = useVMLauncher;
  +        m_useVMLauncher = useVMLauncher;
       }
   
       /**
  @@ -251,29 +249,14 @@
       }
   
       /**
  -     * Returns the environment used to create a subprocess.
  +     * test for an untimely death of the process
        *
  -     * @return the environment used to create a subprocess
  +     * @return true iff a watchdog had to kill the process
  +     * @since 1.5
        */
  -    private String[] getEnvironment()
  -        throws TaskException
  +    public boolean killedProcess()
       {
  -        if( m_newEnvironment )
  -        {
  -            return Environment.toNativeFormat( m_environment );
  -        }
  -        else
  -        {
  -            try
  -            {
  -                Environment.addNativeEnvironment( m_environment );
  -                return Environment.toNativeFormat( m_environment );
  -            }
  -            catch( final IOException ioe )
  -            {
  -                throw new TaskException( ioe.getMessage(), ioe );
  -            }
  -        }
  +        return m_watchdog != null && m_watchdog.killedProcess();
       }
   
       /**
  @@ -287,7 +270,7 @@
       {
   
           final ExecMetaData metaData =
  -            new ExecMetaData( m_command, getEnvironment(),
  +            new ExecMetaData( m_command, getNativeEnvironment(),
                                 m_workingDirectory, false );
   
           final CommandLauncher launcher = getLauncher();
  @@ -351,13 +334,28 @@
       }
   
       /**
  -     * test for an untimely death of the process
  +     * Returns the environment used to create a subprocess.
        *
  -     * @return true iff a watchdog had to kill the process
  -     * @since 1.5
  +     * @return the environment used to create a subprocess
        */
  -    public boolean killedProcess()
  +    private String[] getNativeEnvironment()
  +        throws TaskException
       {
  -        return m_watchdog != null && m_watchdog.killedProcess();
  +        if( m_newEnvironment )
  +        {
  +            return Environment.toNativeFormat( m_environment );
  +        }
  +        else
  +        {
  +            try
  +            {
  +                Environment.addNativeEnvironment( m_environment );
  +                return Environment.toNativeFormat( m_environment );
  +            }
  +            catch( final IOException ioe )
  +            {
  +                throw new TaskException( ioe.getMessage(), ioe );
  +            }
  +        }
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to