undefect. CWE-407 — 63 sites patched across 27 ecosystems
Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com Patches, unit tests, benchmarks, whitepaper, and outreach briefs. Public domain — no copyright claimed. Use freely.
This commit is contained in:
commit
0a580b313d
70422 changed files with 17213626 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8334258
|
||||
* @summary Disallow early assignment if FLEXIBLE_CONSTRUCTORS preview feature is not enabled
|
||||
* @compile/fail/ref=EarlyAssignmentNoPreview1.out --release 24 -XDrawDiagnostics EarlyAssignmentNoPreview1.java
|
||||
*/
|
||||
public class EarlyAssignmentNoPreview1 {
|
||||
|
||||
Runnable r;
|
||||
|
||||
public EarlyAssignmentNoPreview1() {
|
||||
this(r = () -> System.out.println("hello"));
|
||||
}
|
||||
|
||||
public EarlyAssignmentNoPreview1(Runnable r) {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new EarlyAssignmentNoPreview1();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue