Skip to content

Proposal: Cleanup unused imports across the project #1173

Open
@Asbeiru

Description

Background

While working with the codebase, I used IntelliJ IDEA's "Inspect Code" tool to analyze the project. The analysis revealed several unused import statements in the codebase. These imports are not used in the corresponding files and can be safely removed to improve code readability and maintainability.

Affected Files and Imports

The following files contain unused import statements:

  1. AbstractClientService.java

    • Line 48: import com.alipay.sofa.jraft.util.Utils;
  2. AtomicStateMachine.java

    • Line 50: import com.alipay.sofa.jraft.util.Utils;
  3. BoltRpcServer.java

    • Line 25: import com.alipay.remoting.config.switches.GlobalSwitch;
  4. ClosureQueueTest.java

    • Line 23: import com.alipay.sofa.jraft.util.ThreadPoolsFactory;
    • Line 24: import com.codahale.metrics.MetricRegistry;
  5. IteratorTest.java

    • Line 24: import org.junit.After;
  6. ReadOnlyServiceImpl.java

    • Line 32: import com.alipay.sofa.jraft.entity.EnumOutter;
  7. ThreadPoolsFactoryTest.java

    • Line 24: import org.junit.Before;
  8. UtilsTest.java

    • Line 20: import java.util.concurrent.CountDownLatch;
    • Line 25: import com.alipay.sofa.jraft.Closure;
    • Line 26: import com.alipay.sofa.jraft.Status;
    • Line 27: import com.alipay.sofa.jraft.error.RaftError;
    • Line 30: import static org.junit.Assert.assertFalse;
    • Line 32: import static org.junit.Assert.assertTrue;

Proposal

I propose the following steps:

  1. Remove the unused import statements listed above.
  2. Verify the changes by:
    • Running mvn clean compile.
    • Running mvn clean test to validate the changes.

Expected Benefits

  • Improved code readability and maintainability.
  • Cleaner project structure with reduced unnecessary dependencies.

Note

If this proposal is acceptable, I will create a Pull Request to implement these changes.

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