You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by pa...@apache.org on 2002/07/19 20:57:44 UTC
cvs commit: jakarta-commons-sandbox/daemon/src/java/org/apache/commons/launcher LaunchCommand.java ParentListener.java
patrickl 2002/07/19 11:57:44
Modified: daemon/src/java/org/apache/commons/launcher
LaunchCommand.java ParentListener.java
Log:
Fix regression bug introduced in previous commit.
Revision Changes Path
1.2 +2 -2 jakarta-commons-sandbox/daemon/src/java/org/apache/commons/launcher/LaunchCommand.java
Index: LaunchCommand.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/daemon/src/java/org/apache/commons/launcher/LaunchCommand.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LaunchCommand.java 19 Jul 2002 08:05:11 -0000 1.1
+++ LaunchCommand.java 19 Jul 2002 18:57:44 -0000 1.2
@@ -444,9 +444,9 @@
/**
* Set the list of nested sysproperty elements.
*
- * @param props a map of {@link String} objects
+ * @param sysProperties a map of {@link String} objects
*/
- public void setSysproperties(HashMap props) {
+ public void setSysproperties(HashMap sysProperties) {
this.sysProperties = sysProperties;
1.2 +8 -5 jakarta-commons-sandbox/daemon/src/java/org/apache/commons/launcher/ParentListener.java
Index: ParentListener.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/daemon/src/java/org/apache/commons/launcher/ParentListener.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ParentListener.java 10 Jul 2002 05:27:52 -0000 1.1
+++ ParentListener.java 19 Jul 2002 18:57:44 -0000 1.2
@@ -58,6 +58,7 @@
package org.apache.commons.launcher;
import java.io.File;
+import java.io.InputStream;
import java.io.IOException;
/**
@@ -140,22 +141,24 @@
} else {
+ // Cache System.in in case the application redirects
+ InputStream is = System.in;
int bytesAvailable = 0;
int bytesRead = 0;
byte[] buf = new byte[1024];
try {
while (true) {
- synchronized (System.in) {
+ synchronized (is) {
// Mark the stream position so that other threads can
// reread the strea
- System.in.mark(buf.length);
+ is.mark(buf.length);
// Read one more byte than has already been read to
// force the stream to wait for input
- bytesAvailable = System.in.available();
+ bytesAvailable = is.available();
if (bytesAvailable < buf.length) {
- bytesRead = System.in.read(buf, 0, bytesAvailable + 1);
+ bytesRead = is.read(buf, 0, bytesAvailable + 1);
// Reset so that we "unread" the bytes that we read
- System.in.reset();
+ is.reset();
if (bytesRead == -1)
break;
} else {
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>