Skip to content

Conversation

@arrow1991
Copy link
Contributor

@arrow1991 arrow1991 commented Oct 24, 2025

What's the purpose of this PR

Remove unused imports

Follow this checklist to help us incorporate your contribution quickly and easily:

  • [√] Read the Contributing Guide before making this pull request.
  • [√] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • [√] Write necessary unit tests to verify the code.
  • [√] Run mvn clean test to make sure this pull request doesn't break anything.
  • [√] Update the CHANGES log.

Summary by CodeRabbit

  • Chores
    • Removed unused imports across multiple modules to reduce technical debt and improve code quality and maintainability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 24, 2025

Walkthrough

This PR removes unused imports from eleven Java files across multiple modules (apollo-client, apollo-core, apollo-openapi, apollo-plugin) to reduce code clutter. All changes are import-level cleanup with no behavioral modifications to any class or method logic.

Changes

Cohort / File(s) Change Summary
Monitor/Internal Classes
apollo-client/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/NullApolloClientMetricsExporter.java
Removed unused import: AbstractApolloClientMetricsExporter
Monitor/Listener API Classes
apollo-client/src/main/java/com/ctrip/framework/apollo/monitor/internal/listener/impl/DefaultApolloClientBootstrapArgsApi.java, DefaultApolloClientExceptionApi.java, DefaultApolloClientNamespaceApi.java
Removed unused imports: Optional (all three), ApolloInjector (ExceptionApi), ConfigFile (NamespaceApi)
Monitor/Tracer Classes
apollo-client/src/main/java/com/ctrip/framework/apollo/monitor/internal/tracer/ApolloClientMonitorMessageProducer.java
Removed unused imports: LocalDate, Optional
Utility/YAML Classes
apollo-client/src/main/java/com/ctrip/framework/apollo/util/yaml/YamlParser.java
Removed unused imports: MappingNode, ParserException
Core Utility Classes
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/StringUtils.java, apollo-core/src/main/java/com/ctrip/framework/apollo/tracer/internals/cat/CatTransaction.java, apollo-core/src/main/java/com/ctrip/framework/foundation/internals/ServiceBootstrap.java
Removed unused imports: Collection, Iterator (StringUtils), Method (CatTransaction), Collections (ServiceBootstrap)
OpenAPI & Plugin Classes
apollo-openapi/src/main/java/com/ctrip/framework/apollo/openapi/client/extend/ApolloStandardHttpRequestRetryHandler.java, apollo-plugin/apollo-plugin-client-prometheus/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/PrometheusApolloClientMetricsExporter.java
Removed unused imports: Collections2, Lists, Collections, List, Objects, Optional (HttpRequestRetryHandler), DefaultApolloClientNamespaceApi, HashMap (PrometheusExporter)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

This is straightforward import cleanup across multiple files with no logic changes. Review effort is minimal since each file requires only verifying that removed imports are indeed unused.

Possibly related PRs

  • fix: monitor arg cause npe #86: Modifies the same monitor-related classes (DefaultApolloClientBootstrapArgsApi, DefaultApolloClientNamespaceApi, ApolloClientMonitorMessageProducer) with functional changes, contrasting with this PR's import cleanup.

Suggested reviewers

  • Anilople

Poem

🐰 Imports unused, now swept away,
Like clutter cleared on spring-clean day,
Eleven files, now trim and lean,
The cleanest codebase we've seen!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Remove unused imports" is directly aligned with the changeset, which consists entirely of removing unused import statements across eleven Java files in the Apollo client, core, and plugin modules. The title accurately and concisely describes the primary change without vagueness or misleading information. It is specific enough that a teammate scanning the history would immediately understand the purpose of the changes.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d8115d9 and 0e568d6.

📒 Files selected for processing (11)
  • apollo-client/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/NullApolloClientMetricsExporter.java (0 hunks)
  • apollo-client/src/main/java/com/ctrip/framework/apollo/monitor/internal/listener/impl/DefaultApolloClientBootstrapArgsApi.java (0 hunks)
  • apollo-client/src/main/java/com/ctrip/framework/apollo/monitor/internal/listener/impl/DefaultApolloClientExceptionApi.java (0 hunks)
  • apollo-client/src/main/java/com/ctrip/framework/apollo/monitor/internal/listener/impl/DefaultApolloClientNamespaceApi.java (0 hunks)
  • apollo-client/src/main/java/com/ctrip/framework/apollo/monitor/internal/tracer/ApolloClientMonitorMessageProducer.java (0 hunks)
  • apollo-client/src/main/java/com/ctrip/framework/apollo/util/yaml/YamlParser.java (0 hunks)
  • apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/StringUtils.java (0 hunks)
  • apollo-core/src/main/java/com/ctrip/framework/apollo/tracer/internals/cat/CatTransaction.java (0 hunks)
  • apollo-core/src/main/java/com/ctrip/framework/foundation/internals/ServiceBootstrap.java (0 hunks)
  • apollo-openapi/src/main/java/com/ctrip/framework/apollo/openapi/client/extend/ApolloStandardHttpRequestRetryHandler.java (0 hunks)
  • apollo-plugin/apollo-plugin-client-prometheus/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/PrometheusApolloClientMetricsExporter.java (0 hunks)
💤 Files with no reviewable changes (11)
  • apollo-client/src/main/java/com/ctrip/framework/apollo/monitor/internal/listener/impl/DefaultApolloClientNamespaceApi.java
  • apollo-client/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/NullApolloClientMetricsExporter.java
  • apollo-plugin/apollo-plugin-client-prometheus/src/main/java/com/ctrip/framework/apollo/monitor/internal/exporter/impl/PrometheusApolloClientMetricsExporter.java
  • apollo-core/src/main/java/com/ctrip/framework/apollo/tracer/internals/cat/CatTransaction.java
  • apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/StringUtils.java
  • apollo-openapi/src/main/java/com/ctrip/framework/apollo/openapi/client/extend/ApolloStandardHttpRequestRetryHandler.java
  • apollo-client/src/main/java/com/ctrip/framework/apollo/monitor/internal/tracer/ApolloClientMonitorMessageProducer.java
  • apollo-client/src/main/java/com/ctrip/framework/apollo/monitor/internal/listener/impl/DefaultApolloClientBootstrapArgsApi.java
  • apollo-client/src/main/java/com/ctrip/framework/apollo/monitor/internal/listener/impl/DefaultApolloClientExceptionApi.java
  • apollo-client/src/main/java/com/ctrip/framework/apollo/util/yaml/YamlParser.java
  • apollo-core/src/main/java/com/ctrip/framework/foundation/internals/ServiceBootstrap.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build (8)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hezhangjian hezhangjian merged commit 735d994 into apolloconfig:main Oct 24, 2025
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants