RFR: 8377427: Reduce substring allocations in Color.web(String, double) [v10]

Michael Strauß mstrauss at openjdk.org
Thu Feb 19 19:21:08 UTC 2026


On Thu, 19 Feb 2026 19:12:38 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> It seems unusual to point to tests from production code. In any case, we've now locked down the table, and any change will fail the test.
>
> yeah, I wasn't sure myself.  one one hand, you are right - it is unusual, on the other, there is absolutely no link to the code that generates the table (which is important for code review purposes).
> 
> even worse, the test accesses the field via reflection.  I know we don't have an annotation to signify the fact that the name is important, but I feel like a comment pointing to the test and access via reflection might be warranted.

The link is right there in the comment. I think I'm going to stop you here: changing the name of the field, or the contents of the array will cause the unit test to fail. That's what unit tests are meant to do, there's no reason to include links from production code to unit tests.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2069#discussion_r2829715794


More information about the openjfx-dev mailing list