On Wed, 7 May 2025 14:44:02 GMT, Kevin Rushforth <k...@openjdk.org> wrote:

>> let me try again:
>> 
>> `Platform.getPreferences()` returns an instance of `PlatformPreferences`
>> `PlatformPreferences.colorSchemeProperty()` returns a `ColorSchemeProperty` 
>> with a public `updateEffectiveValue()`
>> 
>> the app can use reflection to invoke a public method, though admittedly in a 
>> convoluted way.
>
> No, an application would not be able to do that. A getter whose 
> implementation happens to return a subtype in a non-exported package does not 
> allow the caller of that getter to access any methods in the non-exported 
> class (even public ones). If it did, then you could never return a type that 
> implements an interface, since all interface methods are public.
> 
> @mstr2 is right. There is no problem here that I can see.

Having said that, if the methods in question are not needed outside the 
package, consider making them package scope.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1655#discussion_r2077824708

Reply via email to