author | mchung |
Thu, 04 Oct 2018 08:45:21 -0700 | |
changeset 52015 | 821bfc24d750 |
parent 47216 | 71c04702a3d5 |
child 57956 | e0b8b019d2f5 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
45124
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
25859
diff
changeset
|
2 |
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package java.lang.reflect; |
|
27 |
||
28 |
/** |
|
16923
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
29 |
* The Permission class for reflective operations. |
2 | 30 |
* <P> |
31 |
* The following table |
|
32 |
* provides a summary description of what the permission allows, |
|
33 |
* and discusses the risks of granting code the permission. |
|
34 |
* |
|
45124
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
25859
diff
changeset
|
35 |
* <table class="striped"> |
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
25859
diff
changeset
|
36 |
* <caption style="display:none">Table shows permission target name, what the permission allows, and associated risks</caption> |
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
25859
diff
changeset
|
37 |
* <thead> |
2 | 38 |
* <tr> |
45881
aaec0fbe17ae
8184208: update class="striped" tables for accessibility
jjg
parents:
45124
diff
changeset
|
39 |
* <th scope="col">Permission Target Name</th> |
aaec0fbe17ae
8184208: update class="striped" tables for accessibility
jjg
parents:
45124
diff
changeset
|
40 |
* <th scope="col">What the Permission Allows</th> |
aaec0fbe17ae
8184208: update class="striped" tables for accessibility
jjg
parents:
45124
diff
changeset
|
41 |
* <th scope="col">Risks of Allowing this Permission</th> |
2 | 42 |
* </tr> |
45124
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
25859
diff
changeset
|
43 |
* </thead> |
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
25859
diff
changeset
|
44 |
* <tbody> |
2 | 45 |
* |
46 |
* <tr> |
|
45881
aaec0fbe17ae
8184208: update class="striped" tables for accessibility
jjg
parents:
45124
diff
changeset
|
47 |
* <th scope="row">suppressAccessChecks</th> |
16923
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
48 |
* <td>ability to suppress the standard Java language access checks |
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
49 |
* on fields and methods in a class; allow access not only public members |
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
50 |
* but also allow access to default (package) access, protected, |
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
51 |
* and private members.</td> |
2 | 52 |
* <td>This is dangerous in that information (possibly confidential) and |
16923
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
53 |
* methods normally unavailable would be accessible to malicious code.</td> |
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
54 |
* </tr> |
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
55 |
* <tr> |
45881
aaec0fbe17ae
8184208: update class="striped" tables for accessibility
jjg
parents:
45124
diff
changeset
|
56 |
* <th scope="row">newProxyInPackage.{package name}</th> |
16923
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
57 |
* <td>ability to create a proxy instance in the specified package of which |
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
58 |
* the non-public interface that the proxy class implements.</td> |
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
59 |
* <td>This gives code access to classes in packages to which it normally |
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
60 |
* does not have access and the dynamic proxy class is in the system |
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
61 |
* protection domain. Malicious code may use these classes to |
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
62 |
* help in its attempt to compromise security in the system.</td> |
2 | 63 |
* </tr> |
64 |
* |
|
45124
144479e89cdb
8179592: Update tables in java.base to be HTML 5-friendly.
jjg
parents:
25859
diff
changeset
|
65 |
* </tbody> |
2 | 66 |
* </table> |
67 |
* |
|
68 |
* @see java.security.Permission |
|
69 |
* @see java.security.BasicPermission |
|
70 |
* @see AccessibleObject |
|
71 |
* @see Field#get |
|
72 |
* @see Field#set |
|
73 |
* @see Method#invoke |
|
74 |
* @see Constructor#newInstance |
|
16923
50bfa0defec2
8004260: dynamic proxy class should have the same Java language access as the proxy interfaces
mchung
parents:
5506
diff
changeset
|
75 |
* @see Proxy#newProxyInstance |
2 | 76 |
* |
77 |
* @since 1.2 |
|
78 |
*/ |
|
79 |
public final |
|
80 |
class ReflectPermission extends java.security.BasicPermission { |
|
81 |
||
82 |
private static final long serialVersionUID = 7412737110241507485L; |
|
83 |
||
84 |
/** |
|
85 |
* Constructs a ReflectPermission with the specified name. |
|
86 |
* |
|
87 |
* @param name the name of the ReflectPermission |
|
88 |
* |
|
89 |
* @throws NullPointerException if {@code name} is {@code null}. |
|
90 |
* @throws IllegalArgumentException if {@code name} is empty. |
|
91 |
*/ |
|
92 |
public ReflectPermission(String name) { |
|
93 |
super(name); |
|
94 |
} |
|
95 |
||
96 |
/** |
|
97 |
* Constructs a ReflectPermission with the specified name and actions. |
|
98 |
* The actions should be null; they are ignored. |
|
99 |
* |
|
100 |
* @param name the name of the ReflectPermission |
|
101 |
* |
|
102 |
* @param actions should be null |
|
103 |
* |
|
104 |
* @throws NullPointerException if {@code name} is {@code null}. |
|
105 |
* @throws IllegalArgumentException if {@code name} is empty. |
|
106 |
*/ |
|
107 |
public ReflectPermission(String name, String actions) { |
|
108 |
super(name, actions); |
|
109 |
} |
|
110 |
||
111 |
} |