Skip to content

NoJodaTime - add unused import when static imports used #665

@philippe-granet

Description

@philippe-granet

What version of OpenRewrite are you using?

I am using

  • OpenRewrite latest
  • Maven plugin latest
  • rewrite-migrate-java latest

How are you running OpenRewrite?

I am using the Maven plugin, and my project is a single module project.

<plugin>
  <groupId>org.openrewrite.maven</groupId>
  <artifactId>rewrite-maven-plugin</artifactId>
  <version>LATEST</version>
  <configuration>
    ... 
  </configuration>
</plugin>

What is the smallest, simplest way to reproduce the problem?

When I have theses imports:

import static java.time.Instant.ofEpochMilli;
import static java.time.ZoneId.systemDefault;

What did you expect to see?

No code modifications after running NoJodaTime recipe

What did you see instead?

import java.time.Instant;
import java.time.ZoneId;
import static java.time.Instant.ofEpochMilli;
import static java.time.ZoneId.systemDefault;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions