1 |
/* ObjectOutputStream.java -- Class used to write serialized objects |
/* ObjectOutputStream.java -- Class used to write serialized objects |
2 |
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. |
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
551 |
throws SecurityException |
throws SecurityException |
552 |
{ |
{ |
553 |
if (enable) |
if (enable) |
554 |
if (getClass ().getClassLoader () != null) |
{ |
555 |
throw new SecurityException ("Untrusted ObjectOutputStream subclass attempted to enable object replacement"); |
SecurityManager sm = System.getSecurityManager (); |
556 |
|
if (sm != null) |
557 |
|
sm.checkPermission (new SerializablePermission ("enableSubstitution")); |
558 |
|
} |
559 |
|
|
560 |
boolean old_val = replacementEnabled; |
boolean old_val = replacementEnabled; |
561 |
replacementEnabled = enable; |
replacementEnabled = enable; |