Handle elements in two different classes with the same name annotated with the same annotation.
This commit is contained in:
+4
-4
@@ -37,18 +37,18 @@ class AnnotatedClassDescriptor(classFqName: String) : AnnotatedElementDescriptor
|
||||
}
|
||||
|
||||
class AnnotatedMethodDescriptor(classFqName: String, public val methodName: String) : AnnotatedElementDescriptor(classFqName) {
|
||||
override fun equals(other: Any?) = other is AnnotatedMethodDescriptor && methodName == other.methodName
|
||||
override fun equals(other: Any?) = other is AnnotatedMethodDescriptor && methodName == other.methodName && classFqName == other.classFqName
|
||||
|
||||
override fun hashCode() = methodName.hashCode()
|
||||
override fun hashCode() = 31 * classFqName.hashCode() + methodName.hashCode()
|
||||
}
|
||||
class AnnotatedConstructorDescriptor(classFqName: String) : AnnotatedElementDescriptor(classFqName) {
|
||||
// use referential equality
|
||||
}
|
||||
|
||||
class AnnotatedFieldDescriptor(classFqName: String, public val fieldName: String) : AnnotatedElementDescriptor(classFqName) {
|
||||
override fun equals(other: Any?) = other is AnnotatedFieldDescriptor && fieldName == other.fieldName
|
||||
override fun equals(other: Any?) = other is AnnotatedFieldDescriptor && fieldName == other.fieldName && classFqName == other.classFqName
|
||||
|
||||
override fun hashCode() = fieldName.hashCode()
|
||||
override fun hashCode() = 31 * classFqName.hashCode() + fieldName.hashCode()
|
||||
}
|
||||
|
||||
public abstract class AnnotationProcessorWrapper(
|
||||
|
||||
+2
@@ -5,3 +5,5 @@ a org.jetbrains.annotations.Nullable 1
|
||||
f 1 0/SomeClass annotatedVal
|
||||
m 1 0/SomeClass getAnnotatedVal
|
||||
f 0 0/SomeClass annotatedVar
|
||||
f 0 0/OtherClass annotatedVal
|
||||
f 0 0/OtherClass annotatedVar
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
javax.inject.Inject org.test.OtherClass annotatedVal
|
||||
javax.inject.Inject org.test.OtherClass annotatedVar
|
||||
javax.inject.Inject org.test.SomeClass annotatedVal
|
||||
javax.inject.Inject org.test.SomeClass annotatedVar
|
||||
org.jetbrains.annotations.Nullable org.test.SomeClass annotatedVal
|
||||
|
||||
+2
@@ -1,5 +1,7 @@
|
||||
a javax.inject.Inject 0
|
||||
p org.test 0
|
||||
m 0 0/SomeClass annotatedFunction
|
||||
m 0 0/OtherClass annotatedFunction
|
||||
a javax.inject.Named 1
|
||||
m 1 0/SomeClass$annotatedFunction$1 invoke
|
||||
m 1 0/OtherClass$annotatedFunction$1 invoke
|
||||
|
||||
+2
@@ -1,2 +1,4 @@
|
||||
javax.inject.Inject org.test.OtherClass annotatedFunction
|
||||
javax.inject.Inject org.test.SomeClass annotatedFunction
|
||||
javax.inject.Named org.test.OtherClass.annotatedFunction.1 invoke
|
||||
javax.inject.Named org.test.SomeClass.annotatedFunction.1 invoke
|
||||
Reference in New Issue
Block a user