diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2018-11-23 19:50:49 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2018-11-23 19:50:49 +0300 |
commit | b0310f8f3e242ffc64c56e8fd95710b25b37dfff (patch) | |
tree | ad985b6fdc7161ef4ef0fa39789a1f11acd904a6 /core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt | |
parent | b9fa0e0741bfdfa76c3929e5343a2b19d96fc1ff (diff) | |
download | dokka-b0310f8f3e242ffc64c56e8fd95710b25b37dfff.tar.gz dokka-b0310f8f3e242ffc64c56e8fd95710b25b37dfff.tar.bz2 dokka-b0310f8f3e242ffc64c56e8fd95710b25b37dfff.zip |
Fix constant values for Java
Diffstat (limited to 'core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt')
-rw-r--r-- | core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt index 332afffb..f0b3a56b 100644 --- a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt +++ b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt @@ -220,11 +220,11 @@ class JavaPsiDocumentationBuilder : JavaDocumentationBuilder { private fun DocumentationNode.appendConstantValueIfAny(field: PsiField) { val modifierList = field.modifierList ?: return val initializer = field.initializer ?: return - if (field.type is PsiPrimitiveType && - modifierList.hasExplicitModifier(PsiModifier.FINAL) && + if (modifierList.hasExplicitModifier(PsiModifier.FINAL) && modifierList.hasExplicitModifier(PsiModifier.STATIC)) { val value = JavaConstantExpressionEvaluator.computeConstantExpression(initializer, false) val text = when(value) { + null -> return // No value found is String -> "\"" + StringUtil.escapeStringCharacters(value) + "\"" else -> value.toString() |