Skip to content

Support running on Java 17 #692

@nielsbasjes

Description

@nielsbasjes

Describe the bug
When I try to run an application that uses this library on Java 17 I get exceptions over the fact that in a lot of places this library uses .setAccessible(true);

You'll see exceptions like:

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private long[] java.util.BitSet.words accessible: module java.base does not "opens java.util" to unnamed module @3c679bde

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.Object[] java.util.Arrays$ArrayList.a accessible: module java.base does not "opens java.util" to unnamed module @3c679bde

To Reproduce
In Java just do one of these:
new ArraysAsListSerializer();
or
new BitSetSerializer();
or
new PriorityQueueSerializer();
or
... one of the many other classes that call .setAccessible(...) ...

Expected behavior
No errors and exceptions.

Environment
Java 17

Additional context
I ran into this when trying to make Apache Flink run on Java 17.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions