#!/usr/bin/env bash # Captures real javap output pinning the Spring Batch 6.0 API facts this article relies on: # the ChunkOrientedStepBuilder that chunk(int) now returns, the two different ExecutionContext # classes, the package move of RepeatStatus, and CommandLineJobRunner's deprecation (NOT removal # -- an earlier draft trusted a migration-guide summary that said "removed" and this transcript # is what caught the error; see docs/09-corrections.md). # # ./scripts/capture-javap.sh # # Needs the spring-batch-core and spring-batch-infrastructure 6.0.5 jars in the local Maven repo # (a normal `mvn -B -o package` in this module already pulls them in). set -euo pipefail cd "$(dirname "$0")/.." CORE=$(find "$HOME/.m2" -name 'spring-batch-core-6.0.5.jar' | head -1) INFRA=$(find "$HOME/.m2" -name 'spring-batch-infrastructure-6.0.5.jar' | head -1) : "${CORE:?spring-batch-core-6.0.5.jar not found in ~/.m2 -- run mvn -B -o package first}" : "${INFRA:?spring-batch-infrastructure-6.0.5.jar not found in ~/.m2 -- run mvn -B -o package first}" WORK=$(mktemp -d) mkdir -p "$WORK/core" "$WORK/infra" unzip -o -q "$CORE" -d "$WORK/core" unzip -o -q "$INFRA" -d "$WORK/infra" mkdir -p docs/output { echo "# javap org.springframework.batch.core.step.builder.StepBuilder (spring-batch-core 6.0.5)" echo echo '$ javap -cp spring-batch-core-6.0.5.jar org.springframework.batch.core.step.builder.StepBuilder' javap -cp "$WORK/core" org.springframework.batch.core.step.builder.StepBuilder } > docs/output/03-stepbuilder-chunk-overloads.txt { echo "# javap: two ExecutionContext classes in two different packages" echo echo '$ javap -cp spring-batch-infrastructure-6.0.5.jar org.springframework.batch.infrastructure.item.ExecutionContext' javap -cp "$WORK/infra" org.springframework.batch.infrastructure.item.ExecutionContext echo echo '$ javap -cp spring-batch-core-6.0.5.jar org.springframework.batch.core.repository.persistence.ExecutionContext' javap -cp "$WORK/core" org.springframework.batch.core.repository.persistence.ExecutionContext } > docs/output/04-two-executioncontext-classes.txt { echo "# javap: CommandLineJobRunner is deprecated (forRemoval), not removed, in 6.0.5" echo echo '$ javap -verbose -cp spring-batch-core-6.0.5.jar org.springframework.batch.core.launch.support.CommandLineJobRunner | grep -A3 "^public class\|Deprecated"' javap -verbose -cp "$WORK/core" org.springframework.batch.core.launch.support.CommandLineJobRunner \ | grep -A3 '^public class\|Deprecated' | head -20 } > docs/output/09-commandlinejobrunner-deprecated-not-removed.txt rm -rf "$WORK" echo "wrote docs/output/03-stepbuilder-chunk-overloads.txt" echo "wrote docs/output/04-two-executioncontext-classes.txt" echo "wrote docs/output/09-commandlinejobrunner-deprecated-not-removed.txt"