-
Bug
-
Resolution: Fixed
-
P2
-
7, 8, 9
-
b127
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8183652 | 8u161 | Unassigned | P2 | Resolved | Fixed | b01 |
JDK-8161987 | 8u152 | Zoltan Majo | P3 | Resolved | Fixed | b01 |
JDK-8192216 | emb-8u161 | Unassigned | P2 | Resolved | Fixed | b01 |
JDK-8161988 | 7u171 | Shafi Ahmad | P3 | Resolved | Fixed | b01 |
JDK-8161989 | 6-pool | Unassigned | P3 | Closed | Won't Fix |
- (1) if the field is declared in the current class (the class that declares the current method) and
- (2) if the putstatic instruction appears in the class or interface initializer method <clinit> of the current class.
Otherwise an IllegalAccessError must be thrown.
Similar, the putfield bytecode is allowed to modify a final field only
- (1) if the field is declared in the current class and
- (2) if the instruction appears in an instance initializer method <init> of the current class.
Otherwise an IllegalAccesError must be thrown.
Currently, HotSpot checks only condition (1) but not (2):
http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/file/07a5eceac654/src/share/vm/interpreter/linkResolver.cpp#l910
Methods that do not satisfy condition (2) violate the assumptions of the compilers. Compiling such methods results in different behavior of compiled and interpreted code (see a detailed example below).
- backported by
-
JDK-8183652 Compilers accept modification of final fields outside initializer methods
-
- Resolved
-
-
JDK-8192216 Compilers accept modification of final fields outside initializer methods
-
- Resolved
-
-
JDK-8161987 Compilers accept modification of final fields outside initializer methods
-
- Resolved
-
-
JDK-8161988 Compilers accept modification of final fields outside initializer methods
-
- Resolved
-
-
JDK-8161989 Compilers accept modification of final fields outside initializer methods
-
- Closed
-
- blocks
-
JDK-8159215 Tighten checks for final field updates
-
- Closed
-
- relates to
-
JDK-8159150 Constant folding final field accesses does not take class redefinition into account
-
- Open
-
-
JDK-8160551 assert(c == Bytecodes::_putfield) failed: must be putfield
-
- Closed
-
-
JDK-8160527 Check for final instance field updates can be omitted
-
- Resolved
-