protostuff/protostuff

Illegal reflective access in io.protostuff.runtime.EnumIO

ChrisTrenkamp opened this issue · 0 comments

In relation to #239, 1.8.0-SNAPSHOT still has reflective access errors in io.protostuff.runtime.EnumIO:

WARNING: Illegal reflective access by io.protostuff.runtime.EnumIO to field java.util.EnumMap.keyType
WARNING: Illegal reflective access by io.protostuff.runtime.EnumIO to field java.util.EnumSet.elementType

try
{
keyTypeFromMap = EnumMap.class.getDeclaredField("keyType");
keyTypeFromMap.setAccessible(true);
valueTypeFromSet = EnumSet.class.getDeclaredField("elementType");
valueTypeFromSet.setAccessible(true);
success = true;
}
catch (Exception e)
{
// ignore
}

It looks like it attempts to access those fields, but ignores it if it can't. Can this be fixed the same way b6ad96f does it?