If we fail spectacularly in checking localness, let's print out what class is having trouble, since the java libs don't actually do that.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5008 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Mike Thomas
2008-04-21 18:43:30 +00:00
parent 8311762471
commit 4a25cc3f46
+8
View File
@@ -423,11 +423,19 @@ public class Streamer
_target = target; _target = target;
// if this is a non-anonymous inner class, freak out because we cannot stream those // if this is a non-anonymous inner class, freak out because we cannot stream those
try {
if (_target.isLocalClass() || _target.isAnonymousClass() || if (_target.isLocalClass() || _target.isAnonymousClass() ||
(_target.isMemberClass() && !Modifier.isStatic(_target.getModifiers()))) { (_target.isMemberClass() && !Modifier.isStatic(_target.getModifiers()))) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Cannot stream non-static inner class: " + _target.getName()); "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 // 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 // we'll use to stream our elements