J2K AnnotationDescriptor, refactor implementations

This commit is contained in:
Alexander Udalov
2017-07-04 14:14:36 +03:00
parent 7ec67505c5
commit 1d64b61a8f
6 changed files with 52 additions and 91 deletions
@@ -119,7 +119,7 @@ class UnusedSymbolInspection : AbstractKotlinInspection() {
// variation of IDEA's AnnotationUtil.checkAnnotatedUsingPatterns()
private fun checkAnnotatedUsingPatterns(annotated: Annotated, annotationPatterns: Collection<String>): Boolean {
val annotationsPresent = annotated.annotations
.map(AnnotationDescriptor::getType)
.map(AnnotationDescriptor::type)
.filterNot(KotlinType::isError)
.mapNotNull { it.constructor.declarationDescriptor?.let { descriptor ->
DescriptorUtils.getFqName(descriptor).asString()