objectmapper-jsonmapper: Jackson 2.23.0 vs 3.3.0 side by side (ObjectMapper/JsonMapper guide rewrite)

Seven runnable programs P01-P07 plus five compile-failure files, JDK 25, no docs/ folder.
Output in objectmapper-jsonmapper/output/ is regenerated by scripts/run-all.sh.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b75Ao6imWN5bj7FHVw
This commit is contained in:
2026-11-17 00:53:38 +05:30
co-authored by Claude Sonnet 5.5
parent 1d0cd8b36e
commit f5ed5d1605
26 changed files with 857 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Compiles each file in src/broken/ against Jackson 3 and records the compiler's own message.
# Output keeps each "error:" line with its source line and caret, and the error count (javac lists every candidate overload).
# These files are deliberately NOT part of the Maven build (they live outside src/main).
set -uo pipefail
cd "$(dirname "$0")/.."
CP="target/classes:$(cat target/cp.txt)"
OUT=output/Broken-compile-errors.txt
: > "$OUT"
for f in src/broken/*.java; do
echo "=== $(basename "$f") ===" >> "$OUT"
tmp=$(mktemp -d)
javac -Xlint:none -d "$tmp" -cp "$CP" "$f" 2>&1 | grep -vE "Picked up|^Note:" | sed "s#^src/broken/##" | awk '/error:/{c=3} c>0{print; c--} /^[0-9]+ errors?$/{print}' >> "$OUT"
rm -rf "$tmp"
echo >> "$OUT"
done
echo "wrote $OUT ($(wc -l < "$OUT") lines)"
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Regenerates every file in output/. Run from the module directory: ./scripts/run-all.sh
# Needs JDK 25 and Maven. Timing lines in P07 are indicative and drift between runs.
set -euo pipefail
cd "$(dirname "$0")/.."
mvn -B -q compile 2>&1 | grep -vE "Picked up|WARNING" || true
mvn -B -q dependency:build-classpath -Dmdep.outputFile=target/cp.txt >/dev/null 2>&1
CP="target/classes:$(cat target/cp.txt)"
mkdir -p output
for c in P01TwoMappersSideBySide P02ImmutableMapper P03ReadWriteCookbook P04ConfigRecipes \
P05JavaTime P06Exceptions P07SharedMapperThreads; do
java -cp "$CP" "com.ankurm.objectmapper.$c" 2>&1 | grep -vE "Picked up|^WARNING" > "output/$c.txt"
echo "ran $c ($(wc -l < output/$c.txt) lines)"
done
./scripts/broken.sh