8280642: ObjectInputStream.readObject should throw InvalidClassException instead of IllegalAccessError

Reviewed-by: naoto, mchung
This commit is contained in:
Roger Riggs 2022-02-01 20:13:14 +00:00
parent d95de5c7fe
commit fdd9ca74bd
2 changed files with 13 additions and 8 deletions

View file

@ -1995,6 +1995,10 @@ public class ObjectInputStream
}
} catch (ClassNotFoundException ex) {
resolveEx = ex;
} catch (IllegalAccessError aie) {
IOException ice = new InvalidClassException(aie.getMessage());
ice.initCause(aie);
throw ice;
} catch (OutOfMemoryError memerr) {
IOException ex = new InvalidObjectException("Proxy interface limit exceeded: " +
Arrays.toString(ifaces));