Skip to content

Inconsistency in visibility of protected properties #2536

@atyrin

Description

@atyrin

Let's have a code like:

public class JavaClsWithProperties {
    protected int protectedProperty = 0;
    private int protectedGetterAndProtectedSetter = 0;

    protected int getProtectedGetterAndProtectedSetter() {
        return protectedGetterAndProtectedSetter;
    }

    protected void setProtectedGetterAndProtectedSetter(int protectedGetterAndProtectedSetter) {
        this.protectedGetterAndProtectedSetter = protectedGetterAndProtectedSetter;
    }
}

and inheritor

open class InheritJavaClsProperties: JavaClsWithProperties(){
    protected val protectedX: Int = 0
}

What we see in generated documentation with default documentedVisibilities (Public API only):
For Java property with protected getter/setter is shown
image
For inheritor in Kotlin both properties are shown
image

Expected behaviour
My expectation is that all protected properties are hidden. But probably for an open class, they might be shown with the visibility modifier.

Installation

  • Dokka version: 1.7.0
  • Kotlin: 1.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions