diff --git a/src/java/com/threerings/io/Streamer.java b/src/java/com/threerings/io/Streamer.java index c362e138f..0a3975d49 100644 --- a/src/java/com/threerings/io/Streamer.java +++ b/src/java/com/threerings/io/Streamer.java @@ -423,12 +423,20 @@ public class Streamer _target = target; // if this is a non-anonymous inner class, freak out because we cannot stream those - if (_target.isLocalClass() || _target.isAnonymousClass() || - (_target.isMemberClass() && !Modifier.isStatic(_target.getModifiers()))) { - throw new IllegalArgumentException( - "Cannot stream non-static inner class: " + _target.getName()); + try { + if (_target.isLocalClass() || _target.isAnonymousClass() || + (_target.isMemberClass() && !Modifier.isStatic(_target.getModifiers()))) { + throw new IllegalArgumentException( + "Cannot stream non-static inner class: " + _target.getName()); + } + } catch (InternalError ie) { + // The checks on the class's localness are capable of throwing these. If we do, let's + // give better errors than the ones the JVM is willing to give. + log.warning("Internal error in checking localness of class: " + + "[class=" + _target.getName() + "]"); + throw ie; } - + // if our target class is an array, we want to get a handle on a streamer delegate that // we'll use to stream our elements if (_target.isArray()) {