Skip to content

Remove reflection in AutoConfigurationChecker #getConfigurations#49058

Open
GaetanoCerciello wants to merge 1 commit intospring-projects:mainfrom
GaetanoCerciello:remove-reflection-auto-configuration
Open

Remove reflection in AutoConfigurationChecker #getConfigurations#49058
GaetanoCerciello wants to merge 1 commit intospring-projects:mainfrom
GaetanoCerciello:remove-reflection-auto-configuration

Conversation

@GaetanoCerciello
Copy link

Description

This pull request removes the use of reflection in AutoConfigurationChecker#getConfigurations() and replaces it with a direct approach using ArchUnit's public API.

Problem

The AutoConfigurations#getConfigurations() method was using reflection to access a private JavaClasses.of() factory method:

Method method = ReflectionUtils.findMethod(JavaClasses.class, "of", Iterable.class);
ReflectionUtils.makeAccessible(method);
return (JavaClasses) ReflectionUtils.invokeMethod(method, null, this.classes.values());

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 4, 2026
@philwebb philwebb requested a review from mhalbritter February 4, 2026 19:11
@mhalbritter mhalbritter self-assigned this Feb 5, 2026
@mhalbritter
Copy link
Contributor

Yes, this change makes sense and works, thanks! Please sign off your commit.

@mhalbritter mhalbritter added the status: waiting-for-feedback We need additional information before we can continue label Feb 5, 2026
@GaetanoCerciello GaetanoCerciello force-pushed the remove-reflection-auto-configuration branch from 25c383b to 16dd10a Compare February 5, 2026 09:03
Signed-off-by: producer <producer@MacBookPro.home>
Signed-off-by: Gaetano Cerciello <cerciello980@gmail.com>
@GaetanoCerciello GaetanoCerciello force-pushed the remove-reflection-auto-configuration branch from 16dd10a to 7fc299e Compare February 5, 2026 09:16
@GaetanoCerciello
Copy link
Author

@mhalbritter
Thank you for the review! I've added the sign-off to the commit as requested.

Changes made:

  • ✅ Added Signed-off-by to the commit message
  • ✅ Force-pushed the updated commit to the branch

The commit now includes the required sign-off and is ready for merge.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants