-
Bug
-
Resolution: Fixed
-
P3
-
hs25
-
b36
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8016402 | 8 | Harold Seigel | P3 | Closed | Fixed | b94 |
Prevent avoidance of stricter access checks by removing the RelaxAccessControlCheck option for bytecode versions >=52.
This option was initially added in JDK 6 as part of the fix for bug 4293149. Bug 4293149 requested stricter access checking in certain cases, when accessing another class or class's field, where both classes have the same protection domain and class loader.
The bug was fixed and the stricter access checking was made the default. And, the RelaxAccessControlCheck option was added as a way for users to avoid the new stricter access checking. This workaround was needed for old bytecodes (< 49) because they did not contain synthetic accessors needed to properly access private fields.
There were a lot of user complaints when the JDK was released with the stricter access checks because existing applications no longer worked. Users wanted their applications to work without having to add the RelaxAccessControlCheck option.
Bug 6383849 was filed to fix the user complaints. The fix for bug 6383849 made relaxed access checking the default for old class files (< 49), but the now redundant RelaxAccessControlCheck option was left in, allowing users with newer class file format versions to also avoid the stricter access checks.
RelaxAccessControlCheck needs to be removed in JDK 8 for bytecodes >= 52. This would prevent future avoidance of the stricter access checks but not cause problems for applications that use RelaxAccessControlCheck with bytecodes older than 51.
I-Low L-Med W-Yes
This option was initially added in JDK 6 as part of the fix for bug 4293149. Bug 4293149 requested stricter access checking in certain cases, when accessing another class or class's field, where both classes have the same protection domain and class loader.
The bug was fixed and the stricter access checking was made the default. And, the RelaxAccessControlCheck option was added as a way for users to avoid the new stricter access checking. This workaround was needed for old bytecodes (< 49) because they did not contain synthetic accessors needed to properly access private fields.
There were a lot of user complaints when the JDK was released with the stricter access checks because existing applications no longer worked. Users wanted their applications to work without having to add the RelaxAccessControlCheck option.
Bug 6383849 was filed to fix the user complaints. The fix for bug 6383849 made relaxed access checking the default for old class files (< 49), but the now redundant RelaxAccessControlCheck option was left in, allowing users with newer class file format versions to also avoid the stricter access checks.
RelaxAccessControlCheck needs to be removed in JDK 8 for bytecodes >= 52. This would prevent future avoidance of the stricter access checks but not cause problems for applications that use RelaxAccessControlCheck with bytecodes older than 51.
I-Low L-Med W-Yes
- backported by
-
JDK-8016402 Remove RelaxAccessControlCheck for JDK 8 bytecodes
-
- Closed
-
- relates to
-
JDK-6383849 Relax access checks by default for older classfiles
-
- Closed
-