maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject cvs commit: maven-scm/generic-scm-api/src/java/org/apache/maven/genericscm/util StreamPumper.java
Date Tue, 27 Jan 2004 10:56:52 GMT
evenisse    2004/01/27 02:56:52

  Modified:    generic-scm-api/src/java/org/apache/maven/genericscm/command
                        AbstractCommand.java
               generic-scm-api/src/java/org/apache/maven/genericscm/util
                        StreamPumper.java
  Log:
  Fix command execution when we have a long run.
  
  Revision  Changes    Path
  1.3       +7 -4      maven-scm/generic-scm-api/src/java/org/apache/maven/genericscm/command/AbstractCommand.java
  
  Index: AbstractCommand.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/generic-scm-api/src/java/org/apache/maven/genericscm/command/AbstractCommand.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractCommand.java	8 Dec 2003 18:08:17 -0000	1.2
  +++ AbstractCommand.java	27 Jan 2004 10:56:51 -0000	1.3
  @@ -106,10 +106,13 @@
   			new Thread(errorPumper).start();
   			StreamPumper inputPumper =
   				new StreamPumper(
  -					p.getErrorStream(),
  -					(PrintWriter) null,
  +					p.getInputStream(),
   					getConsumer());
  -			p.waitFor();
  +            
  +            errorPumper.start();
  +            inputPumper.start();
  +			int exitVal = p.waitFor();
  +            System.out.println("ExitValue: " + exitVal);        
   		}
   		catch (Exception e)
   		{
  
  
  
  1.2       +6 -3      maven-scm/generic-scm-api/src/java/org/apache/maven/genericscm/util/StreamPumper.java
  
  Index: StreamPumper.java
  ===================================================================
  RCS file: /home/cvs/maven-scm/generic-scm-api/src/java/org/apache/maven/genericscm/util/StreamPumper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StreamPumper.java	2 Dec 2003 20:12:44 -0000	1.1
  +++ StreamPumper.java	27 Jan 2004 10:56:52 -0000	1.2
  @@ -103,7 +103,7 @@
    * @author <a href="mailto:fvancea@maxiq.com">Florin Vancea</a>
    * @author <a href="mailto:pj@thoughtworks.com">Paul Julius</a>
    */
  -public class StreamPumper implements Runnable
  +public class StreamPumper extends Thread
   {
   
       private BufferedReader in;
  @@ -144,8 +144,11 @@
               while ( s != null )
               {
                   consumeLine( s );
  -                out.println( s );
  -                out.flush();
  +                if (out != null)
  +                {
  +                    out.println( s );
  +                    out.flush();
  +                }
   
                   s = in.readLine();
               }
  
  
  

Mime
View raw message