jSparrow plug-in developed for Java refactoring
jSparrow is an IDE extension for refactoring Java code with a rule-based approach. A jSparrow rule is a definition of many small composed refactoring steps performed by the plug-in; one rule, when selected, can by itself refactor a very specific area within your system-wide code.
The jSparrow IDE extension adds 117 rules including 3 interactive rules: Standard output methods to Logger, Remove Unused Code, and Rename Fields to Java Conventions.
Additionally, 92 of the rules have markers; The jSparrow markers work like the quick fixes found in Sonarlint and JDTSpelling.
What is refactoring?
Refactoring is a process of system-wide code restructuring and reordering without affecting the system's external forms of action and behavior. In simpler terms, refactoring is improving software's code without affecting the software's user interfaces and experiences.
- Create working copies of selected Java files
- Analyse refactoring possibilities
- Apply the refactoring
- Compare working copies with original sources
- Persist wanted refactoring to original sources
Please visit our About jSparrow page to see the refactoring process of jSparrow in more detail.
Refactor JUnit Test Cases
JUnit is an open-source unit testing framework for Java. The goal of unit testing or unit test cases is to test individual units of software and validate expected performance. Since 2022 junit.org has released the next generation of JUnit: Junit 5. To help Java developers with the migration from JUnit 3 and JUnit 4 to JUnit 5, this plug-in includes ten JUnit refactoring rules:
The plug-in documentation shows Java and JUnit test case examples that get refactored.
Other jSparrow Tags
JUnit is a tag that we use for the JUnit refactor rules. Tags describe properties of jSparrow rules with the intent of grouping similar rules together and making them easier to find and search for. Below are all our current tags:
Minimum Java Versions
All jSparrow rules have a Minimum Java Version, which means that a rule with (for example) a Minimum Java version of 1.1 can be used on Java version 1.1 and all Java versions after 1.1.
Rules with tag: https://jsparrow.github.io/tags/#java-version-tags
Version tags quick-links: Java 1.1, Java 1.2, Java 1.3, Java 1.4, Java 5, Java 6, Java 7, Java 8, Java 9, Java 10, Java 11, Java 14, Java 15, and Java 16
Coding conventions for Java
Coding conventions for Java consist of a set of recommended code styles and best practices. Rules with the Coding Conventionstag will alter source code parts to follow guides, such as the Google Java Style Guide.
Rules with tag: https://jsparrow.github.io/tags/#coding-conventions
I/O operations provided by java.io or java.nio
The I/O operations tag marks rules that deal with I/O operations provided by java.io or java.nio.
Rules with tag: https://jsparrow.github.io/tags/#io-operations
Lambda expressions are anonymous and unnamed functions that enable you to treat functionality as a method argument or code as data. Lambda expressions are an integral part of the java.util.stream API. Whenever a rule has this tag, it means that either a lambda expression is introduced or manipulated.
Rules with tag: https://jsparrow.github.io/tags/#lambda
Logging frameworks ease and standardize the process of logging for the Java platform. In particular, they provide flexibility by avoiding explicit output to the console. The location where logs are written becomes independent of the code and can be customized at runtime. Rules marked with this tag either introduce logging or improve aspects of the same.
Rules with tag: https://jsparrow.github.io/tags/#logging
A loop is an instruction that repeats until a specified condition is reached. Examples would be for, while, or forEach loops. Respectively, rules with the Loop tag will interact with such loops.
Rules with tag: https://jsparrow.github.io/tags/#Loop
Old Java Language Constructs
jSparrow rules having the Old Language Constructs tag replace old constructs with more up-to-date alternatives.
Rules with tag: https://jsparrow.github.io/tags/#old-language-constructs
Performance improving rules
The Performance tag indicates that a code fragment is replaced by a more performant one.
Rules with tag: https://jsparrow.github.io/tags/#performance
Rules marked with the Readability tag improve the ease with which a human reader can comprehend the purpose, control flow, and operation of source code. It affects aspects of quality, including portability, usability, and most importantly maintainability.
Rules with tag: https://jsparrow.github.io/tags/#readability
Security issues refer to vulnerabilities that can be exploited by an attacker to perform unauthorized actions within a computer program. Rules marked with this tag replace vulnerable code fragments with secure alternatives.
Rules with tag: https://jsparrow.github.io/tags/#security
String manipulation is the process of creating, parsing, or changing String variables or literals. Typical operations on strings include a concatenation of values or the creation of a String output based on the input of another type. jSparrow rules having this tag will therefore be related to such String operations.
Rules with tag: https://jsparrow.github.io/tags/#string-manipulation
jSparrow rules having this tag encourage using best practices in the test code.
Rules with tag: https://jsparrow.github.io/tags/#testing
jSparrow rules having this tag encourage best practices on using the AssertJ library for writing fluent assertions in unit tests.
Rules with tag: https://jsparrow.github.io/tags/#assertj
jSparrow rules having this tag encourage best practices on using the Spring library for writing web applications.
Rules with tag: https://jsparrow.github.io/tags/#Spring
Rules with the Free tag are free to use.
Rules with tag: https://jsparrow.github.io/tags/#free
Get Started with jSparrow
We want to help developers optimize the way they can fix Java code and refactor Java code. To get started, we offer 20 free forever rules which you can acquire through our website: https://jsparrow.io/try-free/
Rules included to get started:
Latest version release
jSparrow Eclipse IDE plug-in latest version: 4.14.1
jSparrow Maven plug-in latest version: 3.20.0
Our release policy
We will release at least one new rule in March, June, September, and December.
Bugfixes will be released each Thursday.
Hotfix Releases can be deployed at any time when urgent.
Next jSparrow Release