From 78fc41e586d4f8d58824f978c01f1c921ff21318 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 07:12:07 +0000 Subject: [PATCH] kafka-streams: capture the ambiguous null tombstone compile error Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01RjfyTgmERTWLqzafu34Cth --- kafka-streams/README.md | 1 + kafka-streams/output/07-ambiguous-null-tombstone.txt | 8 ++++++++ kafka-streams/scripts/compile-broken.sh | 9 +++++++++ kafka-streams/scripts/run-all.sh | 1 + kafka-streams/src/broken/AmbiguousNullTombstone.java | 11 +++++++++++ 5 files changed, 30 insertions(+) create mode 100644 kafka-streams/output/07-ambiguous-null-tombstone.txt create mode 100755 kafka-streams/scripts/compile-broken.sh create mode 100644 kafka-streams/src/broken/AmbiguousNullTombstone.java diff --git a/kafka-streams/README.md b/kafka-streams/README.md index 85a9219..1396ca7 100644 --- a/kafka-streams/README.md +++ b/kafka-streams/README.md @@ -39,5 +39,6 @@ Every file in `output/` is written by a test that also asserts it. | `04-blocklist-table-join.txt` | Join before blocking, after blocking, and after a tombstone | | `05-topology-description.txt` | `Topology.describe()` of the whole graph | | `06-spring-context.txt` | The Spring factory bean is wired and not running | +| `07-ambiguous-null-tombstone.txt` | The real `javac` error for `pipeInput("c5", null)`; source in `src/broken/`, regenerated by `scripts/compile-broken.sh` | The article carries the explanations; there is deliberately no `docs/` folder. diff --git a/kafka-streams/output/07-ambiguous-null-tombstone.txt b/kafka-streams/output/07-ambiguous-null-tombstone.txt new file mode 100644 index 0000000..f388b00 --- /dev/null +++ b/kafka-streams/output/07-ambiguous-null-tombstone.txt @@ -0,0 +1,8 @@ +src/broken/AmbiguousNullTombstone.java:9: error: reference to pipeInput is ambiguous + blocked.pipeInput("c5", null); + ^ + both method pipeInput(K,V) in TestInputTopic and method pipeInput(V,Instant) in TestInputTopic match + where K,V are type-variables: + K extends Object declared in class TestInputTopic + V extends Object declared in class TestInputTopic +1 error diff --git a/kafka-streams/scripts/compile-broken.sh b/kafka-streams/scripts/compile-broken.sh new file mode 100755 index 0000000..ee84d12 --- /dev/null +++ b/kafka-streams/scripts/compile-broken.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# Captures the real javac error for the null-tombstone mistake into output/07-ambiguous-null-tombstone.txt +set -uo pipefail +cd "$(dirname "$0")/.." +mvn -B -q dependency:build-classpath -Dmdep.outputFile=target/cp.txt >/dev/null +mkdir -p target/broken +javac -d target/broken -cp "$(cat target/cp.txt)" src/broken/AmbiguousNullTombstone.java 2>&1 \ + | grep -v '^Picked up' > output/07-ambiguous-null-tombstone.txt +cat output/07-ambiguous-null-tombstone.txt diff --git a/kafka-streams/scripts/run-all.sh b/kafka-streams/scripts/run-all.sh index 1b47ac3..3873f91 100755 --- a/kafka-streams/scripts/run-all.sh +++ b/kafka-streams/scripts/run-all.sh @@ -4,4 +4,5 @@ set -euo pipefail cd "$(dirname "$0")/.." rm -f output/*.txt mvn -B -q test +scripts/compile-broken.sh >/dev/null || true ls output diff --git a/kafka-streams/src/broken/AmbiguousNullTombstone.java b/kafka-streams/src/broken/AmbiguousNullTombstone.java new file mode 100644 index 0000000..d794e66 --- /dev/null +++ b/kafka-streams/src/broken/AmbiguousNullTombstone.java @@ -0,0 +1,11 @@ +import org.apache.kafka.streams.TestInputTopic; + +/** + * Deliberately does not compile; it lives outside src/main and src/test so the build ignores it. + * scripts/compile-broken.sh runs javac on it and captures the compiler's own message. + */ +public class AmbiguousNullTombstone { + static void tombstone(TestInputTopic blocked) { + blocked.pipeInput("c5", null); + } +}