unknowntpo opened a new pull request, #22758:
URL: https://github.com/apache/kafka/pull/22758

   **Draft / proof-of-concept for KIP-1320.** Not intended for merge as-is — it 
validates the deprecation mechanism proposed in the KIP on a single small class.
   
   ### What this does
   
   `org.apache.kafka.common.utils.ByteBufferInputStream` was never public API, 
but it lives in a public package and is imported by third parties. This PoC:
   
   - moves the implementation to 
`org.apache.kafka.common.utils.internals.ByteBufferInputStream`;
   - turns the public class into a `@Deprecated(since = "4.4.0", forRemoval = 
true)` delegating shim (it extends the internal class, so there is no 
duplicated logic). External `new ByteBufferInputStream(...)` stays source- and 
binary-compatible and now emits a compile-time removal warning;
   - migrates the 5 main-source callers (4 in `common.compress`, 1 in Streams) 
to the internal class.
   
   ### Why the callers must migrate
   
   Kafka's main-source compilation uses `-Xlint:all -Werror`, so once a class 
is deprecated every internal use becomes a fatal error. The shim keeps 
*external* code working, but internal callers have to move to the 
non-deprecated `internals` class (or be suppressed). This PoC shows the full 
mechanism compiles cleanly.
   
   ### Verification
   
   - `:clients:compileJava :streams:compileJava` (with `-Werror`) — green
   - `checkstyleMain`, `spotlessCheck` — green
   - Reverting one caller back to the deprecated public class reproduces 
`error: warnings found and -Werror specified`, confirming the migration is 
required.
   
   ### Links
   
   - KIP-1320: https://cwiki.apache.org/confluence/display/KAFKA/KIP-1320
   - Discussion thread: 
https://lists.apache.org/thread/5hf11khclhngftp297hhvwc23j5bcx28
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to