changeset 12288:e8ea2a3147f9

8081634: Concurrent usage of a StringBuilder causes test intermittent failures Reviewed-by: sla, sspitsyn
author jbachorik
date Mon, 22 Jun 2015 12:13:39 +0200
parents cb67de4f09d1
children 515aada65cf2
files test/sun/management/jmxremote/startstop/ManagementAgentJcmd.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/sun/management/jmxremote/startstop/ManagementAgentJcmd.java	Tue Jun 16 16:36:27 2015 +0300
+++ b/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(