1 |
/* ReflectPermission.java - named permission for reflaction |
/* ReflectPermission.java - named permission for reflaction |
2 |
Copyright (C) 2000, 2001 Free Software Foundation |
Copyright (C) 2000, 2001 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
7 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
8 |
the Free Software Foundation; either version 2, or (at your option) |
the Free Software Foundation; either version 2, or (at your option) |
9 |
any later version. |
any later version. |
10 |
|
|
11 |
GNU Classpath is distributed in the hope that it will be useful, but |
GNU Classpath is distributed in the hope that it will be useful, but |
12 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
27 |
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 |
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 |
28 |
* "The Java Language Specification", ISBN 0-201-63451-1 |
* "The Java Language Specification", ISBN 0-201-63451-1 |
29 |
* plus online API docs for JDK 1.2 beta from http://www.javasoft.com. |
* plus online API docs for JDK 1.2 beta from http://www.javasoft.com. |
|
* Status: Believed complete and correct to version 1.2. |
|
30 |
*/ |
*/ |
31 |
|
|
32 |
package java.lang.reflect; |
package java.lang.reflect; |
35 |
|
|
36 |
/** |
/** |
37 |
* This class implements permissions for reflection. This is a named |
* This class implements permissions for reflection. This is a named |
38 |
* permission, and the only defined name is suppressAccessChecks. |
* permission, and the only defined name is suppressAccessChecks, which |
39 |
|
* allows suppression of normal Java objects when using reflection. |
40 |
|
* |
41 |
|
* <table> |
42 |
|
* <tr> |
43 |
|
* <th>Permission Target Name</th> |
44 |
|
* <th>What Permission Allows</th> |
45 |
|
* <th>Risk of Allowing Permission</th> |
46 |
|
* </tr> |
47 |
|
* <tr> |
48 |
|
* <td><code>suppressAccessChecks</code></td> |
49 |
|
* <td>Ability to access fields, invoke methods, and construct objects |
50 |
|
* via reflection, including non-public members in contexts where |
51 |
|
* such access is not legal at compile-time.</td> |
52 |
|
* <td>This is dangerous. It exposes possibly confidential information, |
53 |
|
* and malicious code could interfere with the internals of the Virtual |
54 |
|
* Machine by corrupting private data.</td> |
55 |
|
* </tr> |
56 |
|
* </table> |
57 |
* |
* |
58 |
* @author Tom Tromey <tromey@redhat.com> |
* @author Tom Tromey <tromey@redhat.com> |
59 |
* @date November 18, 2000 |
* @author Eric Blake <ebb9@email.byu.edu> |
60 |
|
* @since 1.2 |
61 |
|
* @status updated to 1.4 |
62 |
*/ |
*/ |
63 |
public final class ReflectPermission extends BasicPermission |
public final class ReflectPermission |
64 |
|
extends BasicPermission |
65 |
{ |
{ |
66 |
/** |
/** |
67 |
|
* Compatible with JDK 1.2. |
68 |
|
*/ |
69 |
|
private static final long serialVersionUID = 7412737110241507485L; |
70 |
|
|
71 |
|
/** |
72 |
* Construct a ReflectPermission with the given name. |
* Construct a ReflectPermission with the given name. |
73 |
|
* |
74 |
* @param name The permission name |
* @param name The permission name |
75 |
*/ |
*/ |
76 |
public ReflectPermission (String name) |
public ReflectPermission(String name) |
77 |
{ |
{ |
78 |
super (name); |
super(name); |
79 |
} |
} |
80 |
|
|
81 |
/** |
/** |
82 |
* Construct a ReflectPermission with the given name. |
* Construct a ReflectPermission with the given name. |
83 |
|
* |
84 |
* @param name The permission name |
* @param name The permission name |
85 |
* @param actions The actions; this is ignored and should be null. |
* @param actions The actions; this is ignored and should be null |
86 |
*/ |
*/ |
87 |
public ReflectPermission (String name, String actions) |
public ReflectPermission(String name, String actions) |
88 |
{ |
{ |
89 |
super (name, actions); |
super(name, actions); |
90 |
} |
} |
91 |
} |
} |