@@ -11,7 +11,7 @@ class FileCompilerAction implements FileAction {
1111
1212 private final String destinationPath ;
1313 private final String [] classPaths ;
14- private CompilationListener errorHandler ;
14+ private CompilationListener compilationListner ;
1515 static final CompilationListener LOGGING_HANDLER = new CompilationFailureLogger ();
1616
1717 public FileCompilerAction (File destinationPath , CompilationListener errorHandler , String ...classPaths ){
@@ -20,7 +20,7 @@ public FileCompilerAction(File destinationPath, CompilationListener errorHandler
2020 }
2121 this .destinationPath = destinationPath .getAbsolutePath ();
2222 this .classPaths = classPaths ;
23- this .errorHandler = errorHandler == null ? LOGGING_HANDLER : errorHandler ;
23+ this .compilationListner = errorHandler == null ? LOGGING_HANDLER : errorHandler ;
2424 }
2525
2626 public void sourceToDestination (File src , File bin ) throws IOException {
@@ -40,13 +40,14 @@ public void sourceToDestination(File src, File bin) throws IOException {
4040 presenter .displayMessage ("compiling file: " + src .getAbsolutePath ());
4141 }
4242 if (p .waitFor () != 0 ) {
43- errorHandler .compilationFailed (src , command , p , null );
43+ compilationListner .compilationFailed (src , command , p . exitValue (), StreamUtils . convertStreamToString ( p . getErrorStream ()) , null );
4444 }else {
45- errorHandler .compilationSucceeded (src , command , p , null );
45+ compilationListner .compilationSucceeded (src , command , StreamUtils . convertStreamToString ( p . getInputStream ()) , null );
4646 }
4747 } catch (Exception x ) {
4848 x .printStackTrace ();
49- errorHandler .compilationFailed (src , command , p , x );
49+ compilationListner .compilationFailed (src , command ,
50+ p .exitValue (), StreamUtils .convertStreamToString (p .getErrorStream ()), x );
5051 }
5152 }
5253 }
0 commit comments