On Tue, 1 Aug 2023 04:31:23 GMT, Tejesh R <[email protected]> wrote: >> test/jdk/javax/swing/JTableHeader/TableHeaderBorderPositionTest.java line >> 127: >> >>> 125: e.printStackTrace(); >>> 126: } >>> 127: } >> >> In fact, it looks better with `saveImage` method. > > Since we are saving only once, I don't think separate method is required.
It is not required but it separates the duties: the `test` method *verifies* the rendering, it calls `saveImage` to save the image. Such a design is in the spirit of OOP. As bonus, it allows one to save the image easily before it is verified or even after each paint is performed, which I used for my own testing. Thus, it has its benefits. I'm not insisting, even though I think it's a better design. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14766#discussion_r1280436422
