aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBłażej Kardyś <bkardys@virtuslab.com>2020-03-20 03:35:03 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-03-20 09:29:36 +0100
commit7201bcfca3b426d741c10d4c05201cb03e9f5d3c (patch)
treea3e4ca9841daad1e81a88388cde3a52743081453
parent037a0f6e86648635011f23f367faad5ab8a95437 (diff)
downloaddokka-7201bcfca3b426d741c10d4c05201cb03e9f5d3c.tar.gz
dokka-7201bcfca3b426d741c10d4c05201cb03e9f5d3c.tar.bz2
dokka-7201bcfca3b426d741c10d4c05201cb03e9f5d3c.zip
Fixing incorrect java supertypes DRIs
-rw-r--r--plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt7
-rw-r--r--plugins/base/src/test/kotlin/model/JavaTest.kt4
2 files changed, 4 insertions, 7 deletions
diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
index 549e765f..35bbd05e 100644
--- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
+++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
@@ -100,7 +100,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator {
val superMethods = mutableListOf<PsiMethod>()
methods.forEach { superMethodsKeys.add(it.hash) }
fun addAncestors(element: PsiClass) {
- ancestorsSet.add(element.toDRI())
+ ancestorsSet.add(DRI.from(element))
element.interfaces.forEach(::addAncestors)
element.superClass?.let(::addAncestors)
}
@@ -290,7 +290,7 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator {
fun mapBounds(bounds: Array<JvmReferenceType>): List<Bound> =
if (bounds.isEmpty()) emptyList() else bounds.mapNotNull {
(it as? PsiClassType)?.let { classType ->
- Nullable(TypeConstructor(classType.resolve()!!.toDRI(), emptyList()))
+ Nullable(TypeConstructor(DRI.from(classType.resolve()!!), emptyList()))
}
}
return typeParameters.mapIndexed { index, type ->
@@ -304,9 +304,6 @@ object DefaultPsiToDocumentableTranslator : PsiToDocumentableTranslator {
}
}
- private fun PsiQualifiedNamedElement.toDRI() =
- DRI(qualifiedName.orEmpty().substringBeforeLast('.', ""), name)
-
private fun PsiMethod.getPropertyNameForFunction() =
getAnnotation(DescriptorUtils.JVM_NAME.asString())?.findAttributeValue("name")?.text
?: when {
diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt
index 9bbfc929..2545823b 100644
--- a/plugins/base/src/test/kotlin/model/JavaTest.kt
+++ b/plugins/base/src/test/kotlin/model/JavaTest.kt
@@ -407,8 +407,8 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") {
"""
) {
with((this / "java" / "InheritorLinks").cast<DClass>()) {
- val dri = (this / "Foo").assertNotNull("Foo dri").dri
- with((this / "Bar").cast<DClass>()) {
+ val dri = (this / "Bar").assertNotNull("Foo dri").dri
+ with((this / "Foo").cast<DClass>()) {
with(extra[InheritorsInfo].assertNotNull("InheritorsInfo")) {
with(value.map.values.flatten().distinct()) {
this counts 1