About jSparrow

An Eclipse IDE plugin

About jSparrow

JSPARROW – YOUR JAVA REFACTORING PARTNER

jSparrow main purpose is to refactor code constructs through granular rules to solve the problems with Java code modernization. Currently, there are exactly 114 rules available and included in all packages.

jSparrow the bird with pirate hat

Browse Granular rules

See the table below to browse all rules.

All jSparrow’s refactoring rules

Included in Trial:

Included in every package

Browse rules by tags

Important to note that all jSparrow rules have a Minimum Java Version. This means, rules that can be used on Java version 1.1 can also be used on Java version 1.1, 5, 17, and up. To see a rule’s Minimum Java Version, please go to the rule’s referred documentation page.

jSparrow in-depth

Other development environments are:

Maven, GitHub

jSparrow is a plugin for Eclipse IDE, Maven, and GitHub. However, jSparrow for Maven and GitHub is currently only available through contacting us. You’ll work tightly with one of our inhouse-developers because of potential library restrictions.

Additionally, we are currently working on introducing jSparrow to Visual Studio Code. This page ‘About jSparrow’ will only include the technical specification of the jSparrow Eclipse IDE plugin.

jSparrow’s Pipeline consists of:

  • Prepare to refactor
  • Perform refactoring on working copy
  • Commit refactoring on “finish”

For each selected Java source file, a new state is created. Each state consists of the original file and a working copy that is subsequently analyzed with the refactoring rules. jSparrow then iterates over all the states, parses each working copy, and applies all the selected rules to it.

The working copies are then parsed and adjusted after each rule execution. Important: on this step, the original sources remain intact. As a final step, the developer can (un)select changes and, when ready, click on “finish” the computed refactorings are persisted on the original sources.

Some refactoring rules have requirements e.g. minimum Java version, thus jSparrow’s pipeline contains functionalities to discard or recompute the refactoring of certain rules on certain files.

jSparrow UI description

The UI provides an interactive refactoring process at each step of the pipeline.

The UI components of the jSparrow Eclipse Plugin include:
• The jSparrow dashboard, which automatically opens as a tab and is a way for us to communicate new releases and special offers
• jSparrow extension points i.e. in the context menu, in the toolbox, and in the Eclipse preference page.
• (On file, right click) The jSparrow Select Rules wizard serves for choosing the rules for refactoring, or for providing the configuration required for Field Renaming, Standard Logger, or Removing Unused Code rule.
• (After applying rules) The Preview wizard serves for reviewing, selecting, or deselecting the computed refactoring. The Preview wizards includes a diff view so that you can review the original and the refactored files.
• (In the code editor) jSparrow markers and its refactoring suggestions.
• The jSparrow Preference page and its subpages, i.e., Profiles, License, and Markers.
• Other dialog boxes, e.g., informational dialog boxes.

Rule Profiles possibilities include:

Categorizing Rules

jSparrow Eclipse Plug-in gives users the ability to group rules in profiles for easier application of desired rules. This was created to allow individual preferences and to support companies’ standards.

Rules can be grouped into profiles to ease the search when applying. To create a new profile with desired rules choose the Preferences option in the Window menu.

To create a new profile choose the Selected profile option and click on the New… button. The field “Name” is mandatory and has to be unique. On the left side, a list of all the possible rules is displayed. Select and add all rules you want to have in your new profile. At least one rule has to be added.
How to add Profiles

Markers description:

Quick-fixes

The jSparrow Markers make use of the JDT support for so-called Quick Fixes. Markers give the users ability to click on and choose an automatic fix to various problems. The jSparrow Markers work like the Quick Fixes of Sonarlint and JDTSpelling.

There are currently 92 jSparrow Markers available. Markers are not enabled on default; To activate a marker go to Eclipse’s preference page -> Markers and then select markers you want. Markes can only be activated with a Premium License.

How to de-activate Markers

Logging description:

Interactive Rule

The ‘System out to logging’ rule is an interactive Rule. It introduces the replacement of System.out statements (println, error, e.printstacktrace) with a logging statement. This rule requires the configuration of a logging environment (log4j, slf4j).

Interactive Rules can only be used with a Premium License.

Configurations

Remove Unused Code description:

Interactive Rule

The ‘Remove Unused Methods ‘ rule is an interactive Rule. This rule finds the type of declarations that are never used and removes them. Users can choose to remove types that are only used in test sources, together with their corresponding tests. Any annotation except for @Deprecated and @SuppressWarnings prevents the type declaration from being considered unused.

Interactive Rules can only be used with a Premium License.

Configurations

Technical FAQs

Get Started with your free trial

Captain jSparrow

Start free trial

No hidden payments – no card required