aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-11-23 19:50:49 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-11-23 19:50:49 +0300
commitb0310f8f3e242ffc64c56e8fd95710b25b37dfff (patch)
treead985b6fdc7161ef4ef0fa39789a1f11acd904a6 /core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt
parentb9fa0e0741bfdfa76c3929e5343a2b19d96fc1ff (diff)
downloaddokka-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.kt4
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()