Add java28-features module: the JDK 28 JEP list so far, one example per JEP on 28-ea+26, behaviour changes against JDK 27
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7N4ZDbUtA3ofqAqRV
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
c0062ea398
commit
d4b8552957
@@ -0,0 +1,17 @@
|
||||
$ javac --enable-preview --release 28 src/StrictFields.java
|
||||
Note: src/StrictFields.java uses preview features of Java SE 28.
|
||||
Note: Recompile with -Xlint:preview for details.
|
||||
$ java --enable-preview -cp classes StrictFields classes
|
||||
StrictFields$Point x flags=0x0812 strictly-initialized=true
|
||||
StrictFields$Point y flags=0x0812 strictly-initialized=true
|
||||
StrictFields$Plain x flags=0x0812 strictly-initialized=true
|
||||
StrictFields$Plain y flags=0x0812 strictly-initialized=true
|
||||
|
||||
$ javac --enable-preview --release 28 broken/EarlyConstruction.java
|
||||
broken/EarlyConstruction.java:6: error: strict field id is not initialized before the supertype constructor has been called
|
||||
super();
|
||||
^
|
||||
Note: broken/EarlyConstruction.java uses preview features of Java SE 28.
|
||||
Note: Recompile with -Xlint:preview for details.
|
||||
1 error
|
||||
exit 1
|
||||
Reference in New Issue
Block a user