aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-03-02 14:35:47 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-03-02 14:35:47 +0100
commit7170d6337fc25b34adbb904432a116a0cca41cad (patch)
treed357daa5706a2c24dbb2ac66645ee3d5574b99bf /src/Kotlin
parentcad221f454adceb12d74fc563788b3d8247e44f6 (diff)
downloaddokka-7170d6337fc25b34adbb904432a116a0cca41cad.tar.gz
dokka-7170d6337fc25b34adbb904432a116a0cca41cad.tar.bz2
dokka-7170d6337fc25b34adbb904432a116a0cca41cad.zip
fix some warnings
Diffstat (limited to 'src/Kotlin')
-rw-r--r--src/Kotlin/DocumentationBuilder.kt9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index 3b7f25d6..e09d35bd 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -3,7 +3,6 @@ package org.jetbrains.dokka
import com.intellij.openapi.util.text.StringUtil
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.dokka.DocumentationNode.Kind
-import org.jetbrains.eval4j.FieldDescription
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotated
@@ -207,7 +206,7 @@ class DocumentationBuilder(val session: ResolveSession,
}
private fun ignoreSupertype(superType: JetType): Boolean {
- val superClass = superType.getConstructor()?.getDeclarationDescriptor() as? ClassDescriptor
+ val superClass = superType.getConstructor().getDeclarationDescriptor() as? ClassDescriptor
if (superClass != null) {
val fqName = DescriptorUtils.getFqNameSafe(superClass).asString()
return fqName == "kotlin.Annotation" || fqName == "kotlin.Enum" || fqName == "kotlin.Any"
@@ -282,9 +281,7 @@ class DocumentationBuilder(val session: ResolveSession,
fun DocumentationNode.appendInPageChildren(descriptors: Iterable<DeclarationDescriptor>, kind: DocumentationReference.Kind) {
descriptors.forEach { descriptor ->
val node = appendChild(descriptor, kind)
- if (node != null) {
- node.addReferenceTo(this, DocumentationReference.Kind.TopLevelPage)
- }
+ node?.addReferenceTo(this, DocumentationReference.Kind.TopLevelPage)
}
}
@@ -520,7 +517,7 @@ class DocumentationBuilder(val session: ResolveSession,
fun AnnotationDescriptor.build(): DocumentationNode? {
val annotationClass = getType().getConstructor().getDeclarationDescriptor()
- if (ErrorUtils.isError(annotationClass)) {
+ if (annotationClass == null || ErrorUtils.isError(annotationClass)) {
return null
}
val node = DocumentationNode(annotationClass.getName().asString(), Content.Empty, DocumentationNode.Kind.Annotation)