copying: fold in graph copying (shared nodes, cycles, identity-map fix), serialization rules (constructors, record canonical constructor, ObjectInputFilter), record array components, clone() as a defensive copy, two more compile-error exhibits; 24 tests
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4BL3cEPHQTk2McE7C
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
/** A "wither" expression on a record (JEP 468, derived record creation). Not part of JDK 25. */
|
||||
public class WithExpression {
|
||||
|
||||
record Point(int x, int y) {}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Point p = new Point(1, 2);
|
||||
Point q = p with { x = 10; };
|
||||
System.out.println(q);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user