Community
Participate
Working Groups
Investigating why the BathCompilerTest series of tests printed to the console whereas the instance of batch compiler used specifically uses non default output streams, it appeared that the delegate compiler used by the batch compiler does post verbose information messages to the System.out stream (instead of posting them to the specified output file). In order to avoid polluting the console, a quick fix is attached that disables the batch compiler tests that use the -verbose option. A better fix would be to propagate the logger initialized by the batch compiler into the delegate compiler so that the latter could report verbose messages through the logger. The alternative path that would augment the responsibilities of the ICompilerRequestor to cope with real time informative messages seems less appropriate (real time error messages not being the main focus of a compilation result, the object that is passed back to the requestor.) A third approach would imitate more closely the behavior of a command line compiler and would consider redirecting System.out itself to a file. In that case, though, Main should be amended so that its constructors would no more take parameters for err and out output streams. (In other words, either we consider that Main should be able to take alternate streams parameters at construction time and it should then *always* use them, or we consider that Main *always* operates upon standard out and err, and BatchCompilerTest must provide for System.out and System.err redirection. While changing System.out itself is not an option, preventing it to write to the console might be one.) The first option seems to be the cleaner path (IMHO), assuming then that command line instances of the batch compiler would merely pass System.out and System.err down the chain.
Created attachment 22413 [details] Batch compiler quick fix (disable some tests) to avoid console pollution
Olivier - pls neutralize the offending tests for 3.1. Improving the compiler along the line of what Maxime suggested should be deferred post 3.1 as non critical.
Olivier, I'm currently running JDT/Core tests using Maxime's patch. I will release it as soon as tests finish...
Patch released in HEAD. I've verified that there's no longer compiler output in console...
fixed
Verified that there is no more output to System.out. Tests seem to be excluded. Verified in N20050609-0010.
Verified for 3.1 RC2 using build I20050610-0010