Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Cleanup unused imports across the project #1173

Open
Asbeiru opened this issue Jan 16, 2025 · 0 comments · May be fixed by #1174
Open

Proposal: Cleanup unused imports across the project #1173

Asbeiru opened this issue Jan 16, 2025 · 0 comments · May be fixed by #1174

Comments

@Asbeiru
Copy link
Contributor

Asbeiru commented Jan 16, 2025

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.

@Asbeiru Asbeiru linked a pull request Jan 16, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant