Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make usage of ClassGraphFacade replacable with custom logic in ReflectionUtils #491

Closed
wants to merge 1 commit into from

Conversation

pokab
Copy link

@pokab pokab commented Mar 14, 2023

...by providing user injectable Function, while retaining ClassGraphFacade's lazy loading semantics.

Moves concrete subtype cache to ReflectionUtils.

Additionally:

  • All tests pass (as I have built a snapshot for myself).
  • I didn't create an issue. Should I?

…tionUtils

by providing user injectable Function, while retaining ClassGraphFacade's
lazy loading semantics.

Moves concrete subtype cache to ReflectionUtils.
@fmbenhassine
Copy link
Member

Thank you for your PR. However, why should we make classgraph replaceable? If I follow this reasoning, we should also find a way to make objenesis replaceable, and datafker replaceable as well.

If you want to customize the way to scan the classpath for concrete types, you can disable the scanClasspathForConcreteTypes parameter and provide a custom object factory. I see no need to add an indirection to make a dependency swappable. Do you agree?

@fmbenhassine
Copy link
Member

This will be resolved with #474.

Thank you for your contribution anyway.

@pokab
Copy link
Author

pokab commented Jan 20, 2024

My reason behind this change had to do with a requirement in our test stack, where we had to filter classes on the classpath. The solution in #474 (which is not yet merged) should provide the same possibility. Thank you.

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.

2 participants