Astra: a Java tool for analysing and refactoring Java source code

Overview

Astra logo

License Build Status

What is Astra?

Astra is a Java tool for analysing and refactoring Java source code.

For example:

  • "References to type A should instead reference type B"
  • "Callers of method A should add an additional argument B"
  • "Find classes which are annotated with A"

Astra has been developed and tested at Alfa to improve the velocity at which large scale refactors may be performed.

How do I use Astra?

  • First, please see the Wiki!
  • Astra can be run as part of a Java application, using astra-core as a dependency and using the refactors it provides. For an illustration of how to do this, please see the README in astra-core. The code can be found in astra-example.
  • For cases needing a more bespoke approach, astra-core also provides an SPI for writing your own custom ASTOperations. See the astra-core README for further details.
  • For very simple cases, there is also a command line interface which exposes a small subset of Astra's refactoring operations. Please see astra-cli for more information.

Why would I use Astra?

A simple and common use case is renaming a method, and updating all the callers of that method so that they use the new name. Your IDE is often the best tool for the job, but sometimes this isn't possible. There may be so many modules that manually selecting and opening them is a real pain, or the overall size of the modules may mean that your IDE struggles to open them all at once. This means that sometimes it's easier to just add a new method, deprecate the old one, and leave all the existing callers. The same issues apply to many other refactors, such as renaming a type.

Astra can be used to make changes like these easily, and on a massive scale.

How does Astra work?

Please see How does Astra work? in the Wiki.

Technologies

  • Java 8
  • Eclipse JDT
  • JUnit
  • log4j

License

Astra is released under the Apache 2.0 License. Contributions are also made under this license, as per the GitHub terms of service.

Issues
Owner
Alfa
Alfa is the premier supplier of software and consultancy services to the asset finance industry.
Alfa
A tool to help eliminate NullPointerExceptions (NPEs) in your Java code with low build-time overhead

NullAway: Fast Annotation-Based Null Checking for Java NullAway is a tool to help eliminate NullPointerExceptions (NPEs) in your Java code. To use Nul

Uber Open Source 2.9k Mar 12, 2021
Your Software. Your Structures. Your Rules.

jQAssistant Master Repository We splitted jQAssistant in multiple single repositories to be able to build a better and more flexible build an release

null 151 Mar 11, 2021
:coffee: SonarSource Static Analyzer for Java Code Quality and Security

Code Quality and Security for Java This SonarSource project is a code analyzer for Java projects. Information about the analysis of Java features is a

SonarSource 744 Mar 11, 2021
Inria 1.1k Mar 12, 2021
A static analyzer for Java, C, C++, and Objective-C

Infer Infer is a static analysis tool for Java, C++, Objective-C, and C. Infer is written in OCaml. Installation Read our Getting Started page for det

Facebook 12.1k Mar 12, 2021
Catch common Java mistakes as compile-time errors

Error Prone Error Prone is a static analysis tool for Java that catches common programming mistakes at compile-time. public class ShortSet { public

Google 5.5k Mar 12, 2021
Sourcetrail - free and open-source interactive source explorer

Sourcetrail Sourcetrail is a free and open-source cross-platform source explorer that helps you get productive on unfamiliar source code. Windows: Lin

Coati Software 10.9k Mar 14, 2021
SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.

SpotBugs is the spiritual successor of FindBugs, carrying on from the point where it left off with support of its community. SpotBugs is licensed unde

null 2.2k Mar 12, 2021
⚡️Lightning-fast linter for .env files. Written in Rust 🦀

⚡️ Lightning-fast linter for .env files. Written in Rust ?? Dotenv-linter can check / fix / compare .env files for problems that may cause the applica

null 798 Mar 13, 2021
OpenGrok is a fast and usable source code search and cross reference engine, written in Java

Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved. OpenGrok - a wicked fast source browser OpenGrok - a wicked fast source br

Oracle 3.2k Mar 15, 2021
An extensible multilanguage static code analyzer.

PMD About PMD is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and

PMD 3.3k Mar 12, 2021
Continuous Inspection

SonarQube Continuous Inspection SonarQube provides the capability to not only show health of an application but also to highlight issues newly introdu

SonarSource 5.6k Mar 12, 2021