RFR (M): JDK-8020614: [TESTBUG] OutputAnalyzer.shouldHaveExitValue() should print stdout/stderr output
David Holmes
david.holmes at oracle.com
Sun Jul 28 22:34:25 PDT 2013
Hi Mikhailo,
On 27/07/2013 12:04 AM, Mikhailo Seledtsov wrote:
>
> This change adds reporting functionality to the JTREG test library. If
> error occurs during test run, the diagnostic summary will be printed
> consisting of a standard output, standard error and an exit code. The
> command line will be printed all the time, regardless of error encounter.
>
> Webrev:
> http://cr.openjdk.java.net/~mseledtsov/8020614/webrev.00/
> <http://cr.openjdk.java.net/%7Emseledtsov/8020614/webrev.00/>
Style nit:
Using string concatenation with string references is really poor style
as you create numerous unnecessary Strings (potential JIT optimizations
aside). If you are concatenating Strings then use a StringBuilder instead:
118 List<String> args = runtime.getInputArguments();
119 String result = new String();
120 for (String arg : args)
121 result += (arg + " ");
122
123 return result;
becomes
List<String> args = runtime.getInputArguments();
StringBuilder result = new StringBuilder();
for (String arg : args)
result.apped(arg).append(' ');
return result.toString();
and similarly elsewhere.
Thanks,
David
> Bug:
> https://jbs.oracle.com/bugs/browse/JDK-8020614
>
> Thank you,
> Misha
More information about the hotspot-runtime-dev
mailing list