git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269340 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -77,10 +77,10 @@ public class KaffeRmic extends DefaultRmicAdapter { | |||||
| PrintStream err = System.err; | PrintStream err = System.err; | ||||
| PrintStream out = System.out; | PrintStream out = System.out; | ||||
| // the project log | |||||
| PrintStream logstr = | |||||
| new PrintStream(new LogOutputStream(getRmic(), Project.MSG_WARN)); | |||||
| try { | try { | ||||
| // the project log | |||||
| PrintStream logstr = | |||||
| new PrintStream(new LogOutputStream(getRmic(), Project.MSG_WARN)); | |||||
| System.setOut(logstr); | System.setOut(logstr); | ||||
| System.setErr(logstr); | System.setErr(logstr); | ||||
| @@ -106,6 +106,7 @@ public class KaffeRmic extends DefaultRmicAdapter { | |||||
| } finally { | } finally { | ||||
| System.setErr(err); | System.setErr(err); | ||||
| System.setOut(out); | System.setOut(out); | ||||
| logstr.close(); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -74,11 +74,11 @@ public class SunRmic extends DefaultRmicAdapter { | |||||
| getRmic().log("Using SUN rmic compiler", Project.MSG_VERBOSE); | getRmic().log("Using SUN rmic compiler", Project.MSG_VERBOSE); | ||||
| Commandline cmd = setupRmicCommand(); | Commandline cmd = setupRmicCommand(); | ||||
| try { | |||||
| // Create an instance of the rmic, redirecting output to | |||||
| // the project log | |||||
| OutputStream logstr = new LogOutputStream(getRmic(), Project.MSG_WARN); | |||||
| // Create an instance of the rmic, redirecting output to | |||||
| // the project log | |||||
| LogOutputStream logstr = new LogOutputStream(getRmic(), Project.MSG_WARN); | |||||
| try { | |||||
| Class c = Class.forName("sun.rmi.rmic.Main"); | Class c = Class.forName("sun.rmi.rmic.Main"); | ||||
| Constructor cons = c.getConstructor(new Class[] | Constructor cons = c.getConstructor(new Class[] | ||||
| { OutputStream.class, String.class }); | { OutputStream.class, String.class }); | ||||
| @@ -100,6 +100,12 @@ public class SunRmic extends DefaultRmicAdapter { | |||||
| } else { | } else { | ||||
| throw new BuildException("Error starting SUN rmic: ", ex, getRmic().getLocation()); | throw new BuildException("Error starting SUN rmic: ", ex, getRmic().getLocation()); | ||||
| } | } | ||||
| } finally { | |||||
| try { | |||||
| logstr.close(); | |||||
| } catch (IOException e) { | |||||
| throw new BuildException(e); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -78,9 +78,9 @@ public class WLRmic extends DefaultRmicAdapter { | |||||
| PrintStream err = System.err; | PrintStream err = System.err; | ||||
| PrintStream out = System.out; | PrintStream out = System.out; | ||||
| PrintStream logstr = | |||||
| new PrintStream(new LogOutputStream(getRmic(), Project.MSG_WARN)); | |||||
| try { | try { | ||||
| PrintStream logstr = | |||||
| new PrintStream(new LogOutputStream(getRmic(), Project.MSG_WARN)); | |||||
| System.setOut(logstr); | System.setOut(logstr); | ||||
| System.setErr(logstr); | System.setErr(logstr); | ||||
| @@ -104,6 +104,7 @@ public class WLRmic extends DefaultRmicAdapter { | |||||
| } finally { | } finally { | ||||
| System.setErr(err); | System.setErr(err); | ||||
| System.setOut(out); | System.setOut(out); | ||||
| logstr.close(); | |||||
| } | } | ||||
| } | } | ||||