RFR: 8253641: Missing newline in the printout of certain JFR events [v2]

Michael Bien github.com+114367+mbien at openjdk.java.net
Tue Oct 20 14:21:26 UTC 2020


On Tue, 20 Oct 2020 14:08:08 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

>> Michael Bien has refreshed the contents of this pull request, and previous commits have been removed. The incremental
>> views will show differences compared to the previous content of the PR. The pull request contains two new commits since
>> the last revision:
>>  - small refactoring: merged two if blocks in PrettyWriter::printClassLoader.
>>  - bugfix: Missing newline in PrettyWriter::printClassLoader if classloader is null.
>
> src/jdk.jfr/share/classes/jdk/jfr/internal/tool/PrettyWriter.java line 449:
> 
>> 447:             print("null");
>> 448:         }
>> 449:         println(postFix);
> 
> Categorical postFix now possible by changing 445 from println(")"); to print(")");?

yes exactly. I think this is how this method was supposed to work. I compared it with similar methods like printClass().

If there is a postFix, its always printed, and it adds a new line in this case. The new line was conditional before
(which caused the bug in the first place).

> src/jdk.jfr/share/classes/jdk/jfr/internal/tool/PrettyWriter.java line 446:
> 
>> 444:             print(String.valueOf(cl.getId()));
>> 445:             print(")");
>> 446:         }else{
> 
> please add spaces: } else {

oh sorry about that, I forgot it this time - old habit. Will fix it.

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

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


More information about the hotspot-jfr-dev mailing list