Skip to content

.setAccessible fails on non-open classes as of 9-ea+148 #4

@tobias

Description

@tobias

As of 9-ea+148, you can no longer .setAccessible on private/protected methods if the class isn't in a package that has been opened to the application's module. The workaround is to use the --add-opens option:

java --add-opens java.base/java.net=ALL-UNNAMED ...

See #AwkwardStrongEncapsulation for more details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions