protostuff/protostuff

Strongly Encapsulate JDK Internals PolymorphicThrowableSchema

snsyzf opened this issue · 1 comments

Java 17 Strongly Encapsulate JDK Internals, the code not working

public abstract class PolymorphicThrowableSchema extends PolymorphicSchema
{

static final java.lang.reflect.Field __cause;

static
{
    java.lang.reflect.Field cause;
    try
    {
        cause = Throwable.class.getDeclaredField("cause");
        cause.setAccessible(true);
    }
    catch (Exception e)
    {
        cause = null;
    }
    __cause = cause;
}

}

dyu commented

@snsyzf thanks for reporting. Can you try testing against 1.8.0-SNAPSHOT and see if you still get problems?