On Wed, 7 May 2025 14:51:11 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
>> 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. yes it can: --add-opens javafx.graphics/com.sun.javafx.application.preferences=andy_test var platformPreferences = Platform.getPreferences(); var colorSchemeProperty = platformPreferences.colorSchemeProperty(); Method m = colorSchemeProperty.getClass().getMethod("updateEffectiveValue"); m.setAccessible(true); m.invoke(colorSchemeProperty); ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1655#discussion_r2077835948