Support class extraction provided by annotation #1039
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've found a bug in method
KSAnnotation.getAnnotationsByType
when trying to access class field of annotation.For example, we have custom class and custom annotation that takes this class as a parameter declared in module
owner-api
:And processor which simply logs code owners is declared in module
owners-processor
:Annotation usage will be pretty straight-forward and declared in our
app
module:If we'll try to build module with
PieceOfCode
and process it via OwnerProcessor - we will get build error:That happens because classloader from module
owners-processor
can't access classes fromowners-api
and simply ignores them.We can fix this behavior if we'll supply
Class.forName
method with classLoader from annotation, which is located in the same module as the parameter.