Changelog and Information of the jSparrow Eclipse Plugin
23030
page-template,page-template-blog-large-image-whole-post,page-template-blog-large-image-whole-post-php,page,page-id-23030,ajax_fade,page_not_loaded,,select-theme-ver-3.8.1,menu-animation-underline,popup-menu-fade,wpb-js-composer js-comp-ver-5.1.1,vc_responsive

Changelog

changelog of jSparrow

OUR RELEASE POLICY IS AS FOLLOWS:

Two major releases per year

  • 21st June – Midsummer Release
  • 21st December – Release of the longest night

Monthly Rule releases

If we developed new rules, they will be released on the 21st of each month

(if the 21st isn’t an Austrian working day- the release will be postponed one month)

Weekly Bugfix releases 

Bugfixes will be released each Tuesday

Hotfix Releases  

Hotfix Releases can be deployed any time (hopefully not necessary)

Release Notes 2.5.0

This release brings substantial performance improvements, one new rule an various small improvements.

Important notice

License keys have to be added again!

The way license information is stored changed. For this reason, all previously added license keys need to be added again.

The license key can be added as follows: preferences → jSparrow → License → “Update license key”.

We thank you for your understanding!

Changes

Performance improvements

Applying rules takes only half the time now!

Process improvements  to the rule engine led to an overall reduced time for applying all refactorings in the “Select Rules” wizard. Measurements show that running jSparrow on projects only takes a fraction of the time it previously took.

 

Remove Deprecated Date Constructs

Some java.util.Date constructors like new Date(int year, int month, int day)new Date(int year, int month, int date, int hrs, int min) and new Date(int year, int month, int date, int hrs, int min, int sec) are deprecated and the Calendar should be used instead.  This rule searches for deprecated calendar instances, introduces calendar instances and sets the time corresponding to the parameters in the deprecated constructor, and replaces the latter with an invocation of Calendar.getTime().  For instance, the following code:

// Deprecated Date Constructor
Date date = new Date(90, 1, 31);

will be replaced with:

// Calendar instead of deprecated constructor
Calendar calendar = Calendar.getInstance();
calendar.set(1990, 1, 31);
Date date = calendar.getTime();

Note that the date constructor is implicitly adding 1900 to the first argument (i.e. year), whereas Calendar.set is expecting the exact year value. Therefore, the rule takes care of preparing the parameters of the Calendar.set properly.

If the deprecated constructor is used in a field initialization, then an initializer block is introduced for creating the calendar and initalizing the field properly. See the before/after table.

Removal of the obsolete “Field Naming Convention Rule”

Since the introduction of the “Rename Fields Rule” (Context Menu → jSparrow → Rename Fields Rule), the “Field Naming Convention Rule” became obsolete. The “Rename Fields Rule” offers more options and has better performance.

Adjustment of the “Time Saved”

On the summary page the value of “Time Saved” now uses man-days, meaning eight-hour working days. Man-days are a more management-friendly unit than 24-hour working days and correspond better with current laws about working hours.

Minor UI improvements

  • Removal of the obsolete tag “logging”
    • This tag is obsolete in the “Select Rules” wizard, since all logging related refactorings are bundled in the “Logging Rule” wizard.
  • The “Add all” button is no longer enabled if only disabled rules are present
  • Removal of the word “Apply” in the context menu
  • Added a minimum width to the “Select Rules” wizard
  • Bugfix to avoid UI freezes when committing survey results
  • Bugfix that prevents a rare case where it was possible to select no profile

Release Notes 2.4.5

This release contains two changes.

Changes

  • Bugfix for ImmutableStaticFinalCollections-Rule
  • Bugfix for FieldRenaming-Rule

Detailed Information

Bugfix for ImmutableStaticFinalCollections-Rule

Diamond Operators in Java 7 are not valid within a method parameter because their type cannot be inferred there. This caused a compilation error, when the rule was applied to a Java 7 project. The fix causes the rule to ignore collections in a Java 7 project, which use a Diamond Operator in their initializer.

Bugfix for FieldRenaming-Rule

Solves an issue where the renaming of a field did not change the references to it in anonymous inner classes.

Release Notes 2.4.4

CHANGE

  • Updated the way demo licenses work.

DETAILED INFORMATION

Free licenses have been reworked to no longer require a connection to the licensing server. When using older versions of jSparrow this might start to see warnings. However, jSparrow functionality should not be adversely impacted.
Any warnings should be able to be removed by upgrading to the latest version of jSparrow. If you experience errors that persist after the upgrade please contact us at bugreport@jsparrow.eu.

Release Notes 2.4.3

BUGFIX

  • Further improvements on the comment preservation
  • Minor improvements on the rule execution counting
  • Duplicate profiles where possible if “x” was used to cancel the operation
    • Using the “x” to abort the operation now behaves as expected
  • jSparrow was executable on sub-elements of a class but was not executed because the types are not suitable for refactoring
    • The visual display of jSparrow was removed from sub-elements of a class

Release Notes 2.4.1

BUGFIXES

  • Fixed a bug where the number of times a rule was applied was displayed incorrectly.
  • Fixed an issue that prevented some rules from counting the number of times they were applied correctly.
  • Fixed a bug where changes made by the “Use Try-With-Resource” rule were not displayed under certain circumstances.
  • Fixed a bug where no license warning was displayed if a license was already in use by another user.

Release Notes 2.4.0

RENAME FIELDS RULE

This release adds a new semi-automatic rule called “Rename Fields Rule”.

This new rule can be used for finding and renaming the fields that do not comply with the Naming Conventions.

A configuration wizards provides different refactoring options. The user can select fields to be renamed based on the access modifier key (screenshot of the configuration wizard is given below). As soon as a field which doesn’t comply with the naming conventions is found, the rule will search for its references and compute a renaming. The search scope can be set by the user, either to the current project or to the workspace that eclipse is currently using.

The new name is computed based on the existing field’ name and the configuration options that the user can provide on the rule wizard. On the default configuration, the existing field name is converted to camelCase. Furthermore the occurrences of underscores ‘_’ and dollar-signs ‘$’ are removed and the first letter which is following them (if any) is converted to uppercase. Note however, that the user has the possibility to choose in the configuration wizard whether or not to change the first letter after ‘_’/’$’ to uppercase.

Before the renaming is applied to the original sources, a preview wizard will show the changes related to the renaming of each field. Since a non-private field may be accessed in multiple classes,  a single renaming may affect more than one file. A tree-style view in the preview wizard will show the the changes to all of the affected files for each renaming. The user has the possibility to ignore a renaming by unchecking the corresponding element in the tree view.

Limitations

The renaming cannot be performed automatically if:

  • The newly computed name is not a valid java variable name.
  • The newly computed name clashes with an existing variable name within the same class.

BUGFIXES

  • Logging Rule:
    • Fixed a bug where tooltips for checkboxes would not show up at the right position.

Release Notes 2.3.1

BUGFIXES

  • Fixed a bug where controls on the Summary Page could be duplicated under certain circumstances.
  • Fixed a bug where alphabetical sorting of files in the Summary page was disabled.

Release Notes 2.3.0

STATISTICS

jSparrow now estimates the time it takes to fix issues. All rules in jSparrow get an individual estimation time to fix the corresponding issue. On each run of jSparrow, the time for each rule is multiplied by the number of occurrences of each corresponding rule, resulting in an estimation of saved time.

The statistics are added as follows:

  • (Updated) Preview Wizard: now additionally displays the following information for each rule individually:
    • (New) Issues Fixed: The number of issues fixed for the current rule in all selected classes
    • (New) Time Saved: The amount of time saved for the current rule in all selected classes
  • (Updated) Summary Page: now displays the following information for all rules:
    • (New) Run Duration: The time it took jSparrow to get and calculate all changes (i.e., the time between clicking “Finish” in the “Select Rules” Wizard and the appearance of the Preview Wizard).
    • (New) Issues Fixed: The overall number of fixed issues (i.e., how often rules were applied) for the current run of jSparrow.
    • (New) Time Saved: The total time saved by applying all rules displayed.
    • (New) Rules: A list of rules that were applied in the current run of jSparrow, including the number of times they were applied and the amount of time saved per rule.
    • Files and Diff View: The complete list of files where jSparrow found potential changes and a diff view that displays changes for each file.

LOGGING RULE

The Logging Rule has been updated in major ways to support more cases and provide greater customizability. The changes are focused on Exception logging.

  • (New) Logging Exceptions: A new grouping of Exception related logging options.
    • (Updated) “Replace printStackTrace by a logger statement with selected level”
      • Option to replace all occurrences of printStackStrace with the selected severity level
    • (New) “Insert a logger statement with the selected level for unlogged exceptions”
      • Option to add a logger statement to catch-clauses that do not log an Exception in any way
    • (New) “Always add the exceptions as a parameter in logger statements”
      • Option to always log an Exception if there is one present. For example, if only the message of an Exception is logged but not the Exception itself, the Exception will be added as additional argument to the log statement.
    • (New) “Always use this severity level for logging exceptions”
      • Option to always use the selected severity of “Logging Exceptions” when an Exception is logged, even though “System.out.orint” or “System.err.print” might specify a different severity level.
    • (New) Tooltips: Added examples for the checkboxes to illustrate the functionality

PROFILE SETTINGS

The profiles settings have been improved and jSparrow is now capable of importing and exporting rule profiles. Exported profiles are saved in YAML format.

  • (New) Import Profile(s)…
    • Adds the functionality to import YAML formatted jSparrow profiles
  • (New) Export Profile(s)…
    • Adds the functionality to export the selected profile(s) into a YAML formatted file

NEW RULE: USEPUTIFABSENT

This Java 8 rule updates the following old language construct and improves readability:

  • If map.put(..) is wrapped with a condition verifying the existence of an element one can use map.putIfAbsent(…) instead.

USABILITY IMPROVEMENTS

  • Various usability improvements
    • Option to switch between flat and recursive package resolving
    • Re-selecting the same profile has the intended behavior of resetting the selected profiles
    • Rule descriptions are now shown even on the right side of the Select Rules Wizard

BUGFIXES

  • Use Functional Interfaces:
    • Fixed a NullPointerException that could occur under very specific circumstances
    • Fixed an issue where a very specific case of an anonymous class containing wildcards in the body should not have been converted
  • Replace Nested Loops with flatMap:
    • Fixed an issue where more than two nested streams could not be converted to a flatMap
  • Use Multi-Catch:
    • Fixed an issue where catch clauses were shifted below more generic Exceptions
  • Replace Expression Lambda with Method Reference:
    • Fixed an issue where method references were incorrectly used for inner types
    • Fixed an issue where jSparrow would not distinguish between Integer.toString() and Integer.toString(Integer)
  • Remove Explicit Type Argument:
    • Fixed an issue where a Type Argument could not safely be inferred
  • Replace static final Collections with Collections.unmodifiable…():
    • Fixed an issue where unused imports where added
  • Use StringUtils Methods:
    • Fixed an issue where not all changes were added on the first run if a paramter of a method invocation was a method invocation that could also be transformed
  • Rule tags:
    • Fixed an issue where tags and “Remove disabled rules” would not work together

Release Notes 2.2.2

Bugfixes

  • Fixed a bug where Eclipse would report “Save Problems” when manually editing and saving files right after running jSparrow.