INRIA / INRIA/spoon

Remove/Add import statement in Java class file

Open
#4,644 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2k
Forks
392
Avg merge
11h 24m
Merged PRs (30d)
36

Description

I need to replace the import statement in java class due to package changes.

**Current:**
`import org.springframework.security.annotation.*;`

**Expected**
`import org.springframework.security.access.annotation.*;`

However, I don't find any spoon class/method to remove or add import statement.
one way to add import (which I already tried) is to use any class from new package so that spoon will import automatically but it does not remove old import and causes compilation error.

Help on how to remove and add import statement is appreciated!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.