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

Detect annotations during expand super types step #354

Merged
merged 2 commits into from Oct 16, 2021

Conversation

hejcz
Copy link
Contributor

@hejcz hejcz commented Oct 12, 2021

I believe it might be benecial to fill missing annotations when expanding supertypes. This step fills only SubTypes store leaving TypesAnnotated store untouched. In our project we have a huge classpath and want to limit scan phase as much as possible. We rely on getTypesAnnotatedWith though so we had our own fork just for this case.

Do you think it might become part of the library?

@hejcz hejcz changed the title Detect annotations during expandSuperType step Detect annotations during expand super types step Oct 12, 2021
@ronmamo
Copy link
Owner

ronmamo commented Oct 13, 2021

sounds good @hejcz
though it can be impl a bit more generically imho - so that signature can support something like
expandX(store, Scanners.SubTypes, ReflectionUtils.SuperTypes) and expandX(store, Scanners.TypesAnnotated, ReflectionUtils.AnnotationTypes) lmkyt

@hejcz
Copy link
Contributor Author

hejcz commented Oct 13, 2021

While the signatures you proposed look nice would the code be similar in these two cases?

  1. SubType - get all values from SubType store. For each get super type. If super type wasn't in SubType store recursively get it's supertype.
  2. TypesAnnotated - get all values and keys from SubType store (keys because they could be added in step 1). For each get annotations and add to TypeAnnotated store. No recursion.

They seem to be quite different.

@ronmamo
Copy link
Owner

ronmamo commented Oct 14, 2021

you're right, let me look it through.

@ronmamo ronmamo changed the base branch from master to ref-0.10.2 October 16, 2021 13:31
@ronmamo ronmamo merged commit ef68cbb into ronmamo:ref-0.10.2 Oct 16, 2021
ronmamo added a commit that referenced this pull request Oct 25, 2021
* fix npe on empty Resources store

* ReflectionUtils.Methods to use getDeclaredMethods

* add ReflectionUtils.Resources

* add JdkTests

* fragile/flaky

* fix scanner index for deprecated scanners :(

* deprecated scanners javadocs

* JdkTests cleanup

* Bump maven-javadoc-plugin from 3.1.1 to 3.3.1 (#352)

* Detect annotations during expand super types step (#354)

* Add subtypes to SubTypes store during expand super types step

* Detect annotations during expandSuperType step

Co-authored-by: Julian Rubin <julian.rubin@rtbhouse.com>

* npe fix

* ConfigurationBuilder.setParallel fluent

* readme

* arranged ReflectionsExpandSupertypesTest

* Correct the wrong match (#334)

* Correct the wrong matc

* Fetch upstream

Co-authored-by: ileler <ileler@qq.com>

* arranged VfsTest

* minors

Co-authored-by: ronma <ronma@>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Julian Rubin <rubin94@gmail.com>
Co-authored-by: Julian Rubin <julian.rubin@rtbhouse.com>
Co-authored-by: Kerwin Bryant <kerwin612@qq.com>
Co-authored-by: ileler <ileler@qq.com>
@ronmamo
Copy link
Owner

ronmamo commented Oct 25, 2021

merged into 0.10.2

thanks Julian @hejcz !
I've arranged the tests a bit, take a look ReflectionsExpandSupertypesTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants