Back to Intellij Community

UsePropertyAccessSyntax

plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/UsePropertyAccessSyntax.html

2025.3-rc-2529 B
Original Source

Reports Java get and set method calls that can be replaced with the Kotlin synthetic properties.

Use property access syntax quick-fix can be used to amend the code automatically.

Example:

// Java:
  public class JavaClassWithGetter {
      private final String expr = "result";

      // ...

      public String getExpr() {
          return expr;
      }
  }
// Kotlin:
  fun test(j: JavaClassWithGetter) {
      // ...
      j.getExpr() // <== The quick-fix simplifies the expression to 'j.expr'
  }