RFR: JDK-8346465 : Add a check in setData() to restrict the update of Built-In ICC_Profiles [v5]
Harshitha Onkar
honkar at openjdk.org
Thu Feb 20 19:40:52 UTC 2025
On Thu, 20 Feb 2025 15:19:01 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> After adding a constructor which accepts a boolean parameter, the constructors `ICC_ProfileRGB(ProfileDeferralInfo pdi)` and `ICC_ProfileGray(ProfileDeferralInfo pdi)` — these two can be removed then.
>
>> Can't this field be final and be set in constructor of the class?
>> > Indeed, it _can be_, and I prefer this design. This way, the `isBuiltIn` field can't be changed after the object is constructed. I think it's a cleaner design.
>
> A cleaner diff between your latest commit and my commit on top: https://github.com/openjdk/jdk/compare/8da82c10b5be3b92655abef95fd5be0c8b6eaa00..6729625f39c0dc47cd2588906b1793611996ca10
>
> This link shouldn't become invalid after either of us removes the corresponding branches from our forks.
Both the approaches - setting isBuiltIn in constructor vs in the static block, were evaluated previously. Setting it via constructor meant that we could mark the profile as Built-In only when it was constructed using ProfileDeferralInfo and modifying all the constructors - ICC_Profile, ICC_ProfileRGB, ICC_ProfileGray whereas setting it in static block meant minimal changes to existing code.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23606#discussion_r1964230209
More information about the client-libs-dev
mailing list