Skip to content

remove org.reflections:reflections, only test use it#16456

Merged
JackieTien97 merged 4 commits into
masterfrom
wx_remove_reflections
Sep 22, 2025
Merged

remove org.reflections:reflections, only test use it#16456
JackieTien97 merged 4 commits into
masterfrom
wx_remove_reflections

Conversation

@CritasWang

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the runtime dependency on org.reflections by moving it to test scope and refactoring production code to avoid classpath scanning.

  • Shift org.reflections:reflections to test scope across modules and remove it from runtime dependency lists.
  • Replace reflection-based discovery in production (MNodeFactoryLoader, SchemaRegionLoader) with explicit class registration; move classpath scanning into tests and change VisibilityTestUtils API accordingly.
  • Update CI workflows to use Oracle/Corretto JDK distributions.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pom.xml Marks reflections dependency as test-scoped at the root level.
iotdb-core/node-commons/pom.xml Marks reflections as test-scoped for node-commons.
iotdb-core/datanode/pom.xml Marks reflections as test-scoped and excludes javassist in datanode.
iotdb-core/confignode/pom.xml Adds reflections as test-scoped with javassist exclusion in confignode.
iotdb-core/node-commons/src/main/java/.../VisibilityTestUtils.java Changes public API to accept a Set of PipePlugin classes instead of scanning by package.
iotdb-core/*/src/test/java/.../PipePluginAnnotationTest.java Moves class discovery to tests via Reflections and passes discovered classes to VisibilityTestUtils.
iotdb-core/datanode/src/main/java/.../MNodeFactoryLoader.java Removes Reflections; introduces a static registry of factories and iterates over it.
iotdb-core/datanode/src/main/java/.../SchemaRegionLoader.java Removes Reflections; introduces a fixed set of schema region implementations.
dependencies.json Removes org.reflections from allowed runtime dependencies.
.github/workflows/* Switches setup-java distributions (Oracle/Corretto) across multiple workflows.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +90 to 93

for (Class<?> nodeFactory : nodeFactorySet) {
if (isGenericMatch(nodeFactory, nodeType) && isEnvMatch(nodeFactory, env)) {
try {

Copilot AI Sep 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nodeFactorySet is a mutable HashSet exposed via the public addNodeFactory method and iterated without synchronization; concurrent mutation can cause ConcurrentModificationException. Make nodeFactorySet final and immutable after construction (e.g., populate in the constructor and wrap with Collections.unmodifiableSet), or use a thread-safe set such as CopyOnWriteArraySet.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/pipe-it.yml
@codecov

codecov Bot commented Sep 22, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.69%. Comparing base (25427da) to head (f512bfd).

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #16456   +/-   ##
=========================================
  Coverage     38.69%   38.69%           
  Complexity      207      207           
=========================================
  Files          4934     4934           
  Lines        325576   325569    -7     
  Branches      41369    41368    -1     
=========================================
+ Hits         125978   125995   +17     
+ Misses       199598   199574   -24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@JackieTien97 JackieTien97 merged commit 7cd568c into master Sep 22, 2025
37 of 39 checks passed
@JackieTien97 JackieTien97 deleted the wx_remove_reflections branch September 22, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants