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:
@@ -422,6 +422,13 @@ public class Streamer
|
|||||||
// keep a handle on the class
|
// keep a handle on the class
|
||||||
_target = target;
|
_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
|
// 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
|
||||||
if (_target.isArray()) {
|
if (_target.isArray()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user