2.2.8.1 release notes

 2.2.8.1

  • Issue 25 (phase 2) - Implemented several additional code generation capabilities for Apex:
    • Constructor - Generates constructors based on base class constructors and/or local member variables (fields and properties) as appropriate and as selected by the user. Note that the Implement / Override code generation feature now also includes base class constructors when appropriate in addition to methods and interface methods.
    • Add constructor parameters - Added a code intention for member variables that are not already initialized in constructors to add them as constructor parameters that are used to initialize the respective member variables. The user is prompted as to which fields should be added to which constructors, and the Change Signature refactoring is then used to apply all changes, allowing the user an opportunity to tailor the resulting signature changes as desired, and to ensure that signature changes are properly reflected across all existing usages.
    • toString() - Generates an implementation of the toString() method for a user-selected subset of fields, optionally allowing for base class chaining as appropriate. This is perhaps less useful than most of the other Apex code generation features as the default toString() implementation in Apex is already quite good., though the custom override allows the user to constrain the output to a subset of information if desired. Like equals() and hashCode()toString() can be regenerated at any time.
    • equals() / hashCode() - Improved the previous release's implementation to include base class chaining as appropriate and retention of the virtual modifier if present when regenerating these method implementations to avoid breaking valid existing override relationships. The implementation of equals() also now uses the strict equality operator (===) in its initial check for exact reference equality to avoid potential re-entrant behavior due to the way that the standard equality operator (==) works in Apex.
    I also improved the locations at which generated methods are inserted into the existing class so that constructors are inserted after member variables but before methods; getters and setters are inserted after member variables and constructors; equals()hashCode(), and toString() are inserted in that order at the end of the class body, etc.
  • Issue 2417 - Fixed an issue with the SOQL Query tool window's COUNT() dry run test for queries against custom metadata types with sub-selects against other custom MDTs.
  • The Apex rename refactoring now automatically renames getters and setters of renamed fields as well as constructor and setter parameters with the same name.
  • Addressed a gap in the Apex Control flow analysis code inspection where a derived class with no constructors that extends a base class with accessible constructors but no accessible default/no-arg constructor would not be reported as invalid.
  • Updated the Apex Control flow analysis code inspection to perform final immutability checks on properties as well as fields. Due to the lack of support for declaration-time initializers for properties, this check allows for lazy initialization of a property's value in its get read accessor.
  • Fixed an issue with how IC2 finds the current Apex class' equals()hashCode(), and toString() methods to ensure that static methods with the same signature aren't found incorrectly.
  • The PMD Salesforce inspection now properly considers the Apex 'equals()' and 'hashCode()' not paired inspection to be the local equivalent of the PMD Apex OverrideBothEqualsAndHashcode rule, thereby ignoring the latter when the former is enabled in the project's inspection profile and the inspection's Ignore redundant rules option is enabled.
  • Quite a few other improvements and fixes related to the above changes.