diff options
| author | Mark Wielaard <mark@klomp.org> | 2000-05-30 21:59:15 +0000 |
|---|---|---|
| committer | Mark Wielaard <mark@klomp.org> | 2000-05-30 21:59:15 +0000 |
| commit | acce0bf33cdb41166d80af64708e92f5594f944d (patch) | |
| tree | db77f60f8967553376af3efdf692c6afc68e3eec /java/security/ProtectionDomain.java | |
| parent | c8b592a04a94b3d343d8ede8ca39674d70f17d8e (diff) | |
| download | classpath-acce0bf33cdb41166d80af64708e92f5594f944d.tar.gz | |
constructor should make the PermissionCollection read only
Diffstat (limited to 'java/security/ProtectionDomain.java')
| -rw-r--r-- | java/security/ProtectionDomain.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/java/security/ProtectionDomain.java b/java/security/ProtectionDomain.java index 18acc6789..a0aaaa959 100644 --- a/java/security/ProtectionDomain.java +++ b/java/security/ProtectionDomain.java @@ -77,15 +77,23 @@ private PermissionCollection perms; /** * This method initializes a new instance of <code>ProtectionDomain</code> * representing the specified <code>CodeSource</code> and permission set. + * No permissions may be added to the <code>PermissionCollection</code> + * and this contructor will call the <code>setReadOnly</code> method on + * the specified permission set. * * @param code_source The <code>CodeSource</code> for this domain * @param perms The permission set for this domain + * + * @see java.security.PermissionCollection#setReadOnly() */ public ProtectionDomain(CodeSource code_source, PermissionCollection perms) { this.code_source = code_source; this.perms = perms; + if (perms != null) { + perms.setReadOnly(); + } } /*************************************************************************/ |
