Skip to content

[improve][test] Fix rawtypes compile warnings in test code#25430

Open
merlimat wants to merge 4 commits intoapache:masterfrom
merlimat:fix-test-warnings-3
Open

[improve][test] Fix rawtypes compile warnings in test code#25430
merlimat wants to merge 4 commits intoapache:masterfrom
merlimat:fix-test-warnings-3

Conversation

@merlimat
Copy link
Copy Markdown
Contributor

Motivation

Fix rawtypes compiler warnings in test code by adding proper generic type parameters to raw types.

This is part of a series to clean up test compile warnings (following production code cleanup in #25414-#25422).

Changes

  • Add proper type parameters: ClassClass<?>, ProducerProducer<?>, ConsumerConsumer<?>, MessageMessage<?>, SchemaSchema<?>, ListList<?>, etc.
  • Use diamond operator <> where type can be inferred
  • Add @SuppressWarnings("rawtypes") at method level only where fixing raw types would cascade into unchecked/type-erasure compile errors (e.g., TestNG DataProvider methods returning Object[][])

Affects ~99 files across all modules.

Verifying this change

  • ./gradlew compileTestJava passes cleanly
  • rawtypes warning count drops significantly

Does this pull request potentially affect one of the following areas?

  • Test code only

Documentation

  • doc-not-needed — test-only changes

Add proper generic type parameters to raw types across test code:
- ArrayList/HashSet/HashMap → diamond operator <>
- Class → Class<?>
- Producer/Consumer/Message/Schema → proper type params
- ProducerBuilder/ConsumerBuilder/ReaderBuilder → <?>
- Record/PulsarSink/MessageImpl → proper type params
- CompletableFuture/Answer/BiConsumer → proper type params
- Use method-level @SuppressWarnings("rawtypes") only where
  fixing would cascade into compile errors
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs ready-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants