Skip to content

Removal of unused static import is not idempotent #1005

Closed
@NathanEckert

Description

@NathanEckert

Hi,

I found that the following file needs to have to formatter applied twice before reaching a stable state.

I am using version 1.18.1-all-deps

package com.example;

import static java.lang.Math.sqrt;


public class JavaFormatterExample {

  public static void unusedStaticImport() {
  }
}

After the first application:

package com.example;


public class JavaFormatterExample {

  public static void unusedStaticImport() {}
}

After the second application (one line deleted after the package declaration):

package com.example;

public class JavaFormatterExample {

  public static void unusedStaticImport() {}
}

Regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions