RFR: JDK-8261095: Add test for clhsdb "symbol" command

Yasumasa Suenaga ysuenaga at openjdk.java.net
Tue Mar 9 02:19:07 UTC 2021


On Mon, 8 Mar 2021 23:47:26 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> JDK-8261095: Add test for clhsdb "symbol" command
>
> test/hotspot/jtreg/serviceability/sa/ClhsdbSymbol.java line 61:
> 
>> 59:             String classOutput = test.run(theApp.getPid(), cmds, expStrMap, null);
>> 60:             String threadAddress = null;
>> 61:             String[] parts = classOutput.split("\n");
> 
> I think you should be using the line.separator properly instead of "\n".
> `            String linesep = System.getProperty("line.separator");`

It might be more simple if you use [String::lines](https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/String.html#lines()) and stream API.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2863


More information about the serviceability-dev mailing list