Skip to content

kotlin-as-java hides access modifiers #2492

@tripolkaandrey

Description

@tripolkaandrey

Describe the bug
I have a Java project where I am using Dokka. For the proper representation of the documentation for Java, I am using the kotlin-as-java plugin. The produced documentation does not have access modifiers for functions. I have found out that the problem is with the kotlin-as-java plugin. Access modifiers are present when the plugin is not applied.

Expected behaviour
Access modifiers should be displayed.

Screenshots
Dokka output with kotlin-as-java applied.
with kotlin-as-java

Dokka output when kotlin-as-java is not applied.
when `kotlin-as-java` not applied

To Reproduce

  1. Configure Dokka with the provided below configuration.
  2. Create a Java class and methods with different access modifiers.
  3. Run dokkaHtml.

Dokka configuration

dependencies {
  dokkaPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.6.20")
}

tasks.withType<DokkaTask>().configureEach {
    dokkaSourceSets.configureEach {
        documentedVisibilities.set(
            setOf(
                Visibility.PUBLIC,
                Visibility.PROTECTED,
            )
        )
    }
}

Installation

  • Operating system: macOS
  • Build tool: Gradle v7.4.2
  • Dokka version: 1.6.20

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issueA beginner-friendly issue for which some assistance is expectedplugin: kotlin-as-javaAn issue/PR related to Dokka's kotlin-as-java plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions