SE Radio 625: Jonathan Schneider on Automated Refactoring with OpenRewrite

Topics covered
Popular Clips
Episode Highlights
Language Support
OpenRewrite's language support is a game-changer for developers working across different programming languages. highlights the tool's ability to handle languages like Java, C#, Groovy, and Kotlin, allowing developers to write recipes in their native language without needing to switch to Java 1. This flexibility is achieved through a technology called remoting, which enables recipes written in one language to operate on another's syntax tree 1. Schneider emphasizes the importance of type attribution for ensuring refactoring correctness, as it allows OpenRewrite to make stylistically consistent changes across diverse codebases 2.
Recipes written in Java can benefit C# developers and vice versa. And that's a world I'm really excited about.
---
This cross-language capability is crucial for seamless framework migrations and security fixes, making OpenRewrite a versatile tool for modern software development 3.
AI Integration
AI integration in OpenRewrite enhances its refactoring capabilities by providing targeted code modifications. Schneider explains that AI tools are used to identify areas for improvement and match them with existing recipes, ensuring precise changes without the risk of breaking code 4. This approach contrasts with probabilistic AI systems, which may introduce errors requiring extensive human review. OpenRewrite's AI-driven process is akin to a lean manufacturing system, offering low variability and high predictability in code alterations 5.
A recipe, which is a computer, gets an AI to do targeted changes in code.
---
By leveraging AI, OpenRewrite can efficiently manage large codebases, making it an invaluable tool for developers dealing with extensive software projects 4.
Multi-Repo Management
OpenRewrite excels in managing and refactoring across multiple repositories, a critical feature for modern software development. Schneider describes how the tool's commercial counterpart allows for mass pull request issuance and impact analysis across numerous repositories, providing a comprehensive view of code changes 6. This capability is essential for developers working in environments where code spans multiple repositories and organizations. The use of Maven and Gradle plugins facilitates the execution of recipes, enabling developers to make consistent changes across their projects 7.
We're really trying to build these experiences that grapple with the fact that we don't work on one repository; we work on many repositories.
---
By storing syntax trees as artifacts, OpenRewrite ensures quick and efficient refactoring processes, making it a powerful tool for large-scale code management 6.
Related Episodes


SE-Radio-Episode-267-Jürgen-Höller-on-Reactive-Spring-and-Spring-5.0
Answers 383 questions

Episode 55: Refactoring Pt. 2
Answers 383 questions

Episode 46: Refactoring Pt. 1
Answers 383 questions

SE Radio 638: Nick Tune and Jean-Georges Perrin on Architecture Modernization
Answers 383 questions

SE Radio 567: Dave Cross on GitHub Actions
Answers 383 questions

SE Radio 628: Hans Dockter on Developer Productivity
Answers 383 questions
SE Radio 633: Itamar Friedman on Automated Testing with Generative AI
Answers 383 questions

SE Radio 594: Sean Moriarity on Deep Learning with Elixir and Axon
Answers 383 questions
SE-Radio-Episode-249:-Vaughn-Vernon-on-Reactive-Programming-with-the-Actor-Model
Answers 383 questions

SE Radio 615: Kent Beck on "Tidy First?"
Answers 383 questions

SE-Radio-Episode-259:-John-Purrier-on-OpenStack
Answers 383 questions

SE-Radio Episode 242: Dave Thomas on Innovating Legacy Systems
Answers 383 questions

SE-Radio Episode 324: Marc Hoffmann on Code Test Coverage Analysis and Tools
Answers 383 questions

SE Radio 585: Adam Frank on Continuous Delivery vs Continuous Deployment
Answers 383 questions














