RFR 8081634: Concurrent usage of a StringBuilder causes test intermittent failures

Jaroslav Bachorik jaroslav.bachorik at oracle.com
Wed Jun 17 18:54:17 UTC 2015


Please, review the following test change

Issue : https://bugs.openjdk.java.net/browse/JDK-8081634
Webrev: http://cr.openjdk.java.net/~jbachorik/8081634/webrev.00

This is an issue in the utility class providing the functionality to run 
the 'jcmd' command and parse its output. The jcmd command output is 
being captured in a separate thread and fed to a shared StringBuilder 
instance. StringBuilder not being synchronized this might lead to 
intermittent failures due to (mostly) the write visibility. The fix is 
to use StringBuffer which is the appropriate class for this kind of usage.

Thanks,

-JB-


More information about the serviceability-dev mailing list