RFR: 8244297: memory leak test utility [v5]

Ambarish Rapte arapte at openjdk.java.net
Thu Oct 8 07:59:48 UTC 2020


On Wed, 30 Sep 2020 11:46:24 GMT, Florian Kirmaier <fkirmaier at openjdk.org> wrote:

>> It's based on the discussion of my previous PR: https://github.com/openjdk/jfx/pull/71
>> 
>> I Added test utility class copied from JMemoryBuddy and used it to simplify 4 of the existing unit tests.
>> 
>> It's a direct copy of my project [JMemoryBuddy](https://github.com/Sandec/JMemoryBuddy) without any changes.
>> I'm also using it in most of the projects I'm involved with and in my experience, the tests with this Library are very
>> stable. I can't remember wrong test results. Sometimes the memory behaviour of some libraries itself is not stable but
>> the tests with JMemoryBuddy are basically always correct.
>
> Florian Kirmaier has updated the pull request incrementally with one additional commit since the last revision:
> 
>   JDK-8244297
>   Fixing some wrong imports

I have reviewed only in perspective of Java coding guidelines. I still have to review the functionality.
Most of the comments are minor like variable name change and typos. I would recommend you to please go through all of
the code to find and fix any other corrections related to Coding guidelines.

modules/javafx.base/src/test/java/test/util/memory/JMemoryBuddy.java line 299:

> 297:     }
> 298:
> 299: }

Please add an empty line at the end of file.

modules/javafx.base/src/test/java/test/util/memory/JMemoryBuddy.java line 95:

> 93:         int counter = stepsLeft;
> 94:
> 95:         if(weakReference.get() != null) {

It requires a space after `if`, `for`, `while` statements to adhere to Java Coding guidelines.

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

Changes requested by arapte (Reviewer).

PR: https://git.openjdk.java.net/jfx/pull/204


More information about the openjfx-dev mailing list