Disallow streaming of non-static inner classes to avoid the inevitable

freakoutery as we try to stream the instance's implicit reference to its
containing class.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5001 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-04-17 02:48:04 +00:00
parent 784b087ed0
commit f017673964
+7
View File
@@ -422,6 +422,13 @@ public class Streamer
// keep a handle on the class
_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());
}
// 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()) {