aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Java/JavaDocumentationBuilder.kt3
-rw-r--r--test/data/java/memberWithModifiers.java2
-rw-r--r--test/src/model/JavaTest.kt5
3 files changed, 9 insertions, 1 deletions
diff --git a/src/Java/JavaDocumentationBuilder.kt b/src/Java/JavaDocumentationBuilder.kt
index 8408d25a..5f0798dd 100644
--- a/src/Java/JavaDocumentationBuilder.kt
+++ b/src/Java/JavaDocumentationBuilder.kt
@@ -154,6 +154,9 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions)
append(modifierNode, DocumentationReference.Kind.Detail)
}
}
+ if ((element is PsiClass || element is PsiMethod) && !element.hasModifierProperty(PsiModifier.FINAL)) {
+ append(DocumentationNode("open", Content.Empty, Kind.Modifier), DocumentationReference.Kind.Detail)
+ }
}
fun DocumentationNode.appendType(psiType: PsiType?, kind: DocumentationNode.Kind = DocumentationNode.Kind.Type) {
diff --git a/test/data/java/memberWithModifiers.java b/test/data/java/memberWithModifiers.java
index 2b14b2e1..7c236224 100644
--- a/test/data/java/memberWithModifiers.java
+++ b/test/data/java/memberWithModifiers.java
@@ -9,4 +9,6 @@ abstract class Test {
protected final void fn(String name, int value) {
}
+
+ protected void openFn() {}
} \ No newline at end of file
diff --git a/test/src/model/JavaTest.kt b/test/src/model/JavaTest.kt
index 2e055d65..df8d8eae 100644
--- a/test/src/model/JavaTest.kt
+++ b/test/src/model/JavaTest.kt
@@ -46,9 +46,12 @@ public class JavaTest {
Test fun memberWithModifiers() {
verifyPackageMember("test/data/java/memberWithModifiers.java") { cls ->
assertEquals("abstract", cls.details[0].name)
- with(cls.members.single()) {
+ with(cls.members.single { it.name == "fn" }) {
assertEquals("protected", details[0].name)
}
+ with(cls.members.single { it.name == "openFn" }) {
+ assertEquals("open", details[1].name)
+ }
}
}