Details
-
Bug
-
Resolution: Fixed
-
P3
-
None
-
b32
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8237233 | 15 | Vicente Arturo Romero Zaldivar | P3 | Resolved | Fixed | b06 |
JDK-8237688 | 14.0.2 | Vicente Arturo Romero Zaldivar | P3 | Resolved | Fixed | master |
JDK-8238127 | 14.0.1 | Unassigned | P3 | Resolved | Fixed | b02 |
Description
test cases, provided by Tagir:
class X {
public static void main(String[] args) {
int x = 2;
record Y() {
void test() {
System.out.println(x);
}
}
new Y().test();
}
}
class X {
public static void main(String[] args) {
int x = 2;
record Y() {
static final int y = x;
}
new Y();
}
}
class X {
public static void main(String[] args) {
int x = 2;
record Y() {
void test() {
System.out.println(x);
}
}
new Y().test();
}
}
class X {
public static void main(String[] args) {
int x = 2;
record Y() {
static final int y = x;
}
new Y();
}
}
Attachments
Issue Links
- backported by
-
JDK-8237233 local records shouldn't capture any non-static state from any enclosing type
-
- Resolved
-
-
JDK-8237688 local records shouldn't capture any non-static state from any enclosing type
-
- Resolved
-
-
JDK-8238127 local records shouldn't capture any non-static state from any enclosing type
-
- Resolved
-
- csr for
-
JDK-8236189 local records shouldn't capture any non-static state from any enclosing type
-
- Closed
-
- is blocked by
-
JDK-8236679 Records: Local records shouldn't capture any non-static state from any enclosing type
-
- Closed
-