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:
@@ -1,9 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
# Compiles the deliberately broken source and captures the compiler's own message.
|
||||
# Compiles each deliberately broken source and captures the compiler's own message.
|
||||
cd "$(dirname "$0")/.."
|
||||
OUT=$(mktemp -d)
|
||||
{
|
||||
echo '$ javac src/broken/FinalFieldClone.java'
|
||||
javac -d "$OUT" src/broken/FinalFieldClone.java 2>&1 | grep -v '^Picked up JAVA_TOOL_OPTIONS' || true
|
||||
} > output/02-final-field-clone.txt
|
||||
cat output/02-final-field-clone.txt
|
||||
capture() { # <source file name> <output name>
|
||||
{
|
||||
echo "\$ javac src/broken/$1"
|
||||
javac -d "$OUT" "src/broken/$1" 2>&1 | grep -v '^Picked up JAVA_TOOL_OPTIONS' || true
|
||||
} > "output/$2.txt"
|
||||
cat "output/$2.txt"
|
||||
}
|
||||
capture FinalFieldClone.java 02-final-field-clone
|
||||
capture ForgotToOverride.java 16-forgot-override
|
||||
capture WithExpression.java 17-with-expression
|
||||
rm -rf "$OUT"
|
||||
|
||||
@@ -13,6 +13,10 @@ run RecordCopyDemo 06-records
|
||||
run DefensiveCopyDemo 07-defensive
|
||||
run CollectionCopyDemo 08-collections
|
||||
run CopyOfIdentityDemo 11-copyof-identity
|
||||
run GraphCopyDemo 12-graph-copy
|
||||
run SerializationRulesDemo 13-serialization-rules
|
||||
run RecordArrayDemo 14-record-arrays
|
||||
run DefensiveCloneDemo 15-defensive-clone
|
||||
mvn -B test 2>&1 | grep -E 'Tests run|BUILD|ERROR|FAIL' | grep -v 'Picked up' > output/09-tests.txt
|
||||
run CopyCostDemo 10-cost
|
||||
echo "regenerated:"; ls output
|
||||
|
||||
Reference in New Issue
Block a user