RFR: 6521141: DebugGraphics NPE @ setFont();

Kevin Rushforth kcr at openjdk.org
Thu Jul 28 15:14:32 UTC 2022


On Thu, 28 Jul 2022 14:45:36 GMT, Tejesh R <tr at openjdk.org> wrote:

> > I guess exposing no-args public constructor was wrong and it should have been protected from beginning. Also, please add a testcase.
> 
> Yeah, its been used internally by other constructors after setting the `graphics` instances. Exposing it as public causes user to create it without `graphics` been set. I tried modifying it to protected and ran the test, but some html test fails.

Even if it hadn't failed the test, you cannot simply change a method, constructor, or field in a public (or protected) class in an exported package from public to protected, since that would be an incompatible API change (at least not without a very compelling reason and a lot of discussion, and even then, probably not).

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

PR: https://git.openjdk.org/jdk/pull/9673



More information about the client-libs-dev mailing list