Bulk Refactoring of Java Code

This page summarizes the projects mentioned and recommended in the original post on /r/java

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • JavaParser

    Java 1-17 Parser and Abstract Syntax Tree for Java with advanced analysis functionalities.

    Depending on the type of refactorings needed, you may be able to use something like Java parser to read the code, refractor it, and write it out again.

  • rewrite

    Automated mass refactoring of source code.

    Netflix have (had? Unsure if they still contribute) a similar tool - Rewrite - but I don't know if it has different functionality, or if it's strictly worse than Google's Error Prone.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • grammars-v4

    Grammars written for ANTLR v4; expectation that the grammars are free of actions.

    Well you could use an existing Java grammar and use Antlr4 to generate a parser for you. Then you have an abstract synax tree you can work with. Other than that; you don't really give much information as to what the problem is. If it's mainly formatting you don't even need that; just apply a formatter to all the code. If it's the actual logic that is the problem, it's going to be hard to write a tool that 'fixes' this.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts