8081634: Concurrent usage of a StringBuilder causes test intermittent failures
Reviewed-by: sla, sspitsyn
--- a/jdk/test/sun/management/jmxremote/startstop/ManagementAgentJcmd.java Tue Jun 16 16:36:27 2015 +0300
+++ b/jdk/test/sun/management/jmxremote/startstop/ManagementAgentJcmd.java Mon Jun 22 12:13:39 2015 +0200
@@ -196,7 +196,9 @@
l.addToolArg(cmd);
}
- StringBuilder output = new StringBuilder();
+ // this buffer will get filled in different threads
+ // -> must be the synchronized StringBuffer
+ StringBuffer output = new StringBuffer();
AtomicBoolean portUnavailable = new AtomicBoolean(false);
Process p = ProcessTools.startProcess(