2.2.8.0 release notes

 2.2.8.0

  • Issue 25 (partial) - Implemented several code generation capabilities for Apex:
    • equals() / hashCode() - Generates overrides of the equals() and/or hashCode() methods using user-specified fields, checking for null for those not specified as non-nullable. The enclosing Apex class must have at least one member variable (field or property) to be used for comparison. If either equals() or hashCode() already exists, only the missing method is generated. If both methods already exist, the user is prompted to remove and regenerate them using a new specification.
      NOTE: The implementations of these methods are based on the canonical implementations from the Java ecosystem, adjusting for limitations and differences in Apex as necessary. I'm certainly open to other options for implementing them as long as they meet general contract of the implemented methods, are generic in nature, and do not force dependencies on anything but the standard Apex type library. Let me know if you're familiar with better implementations of these two methods that meet the aforementioned criteria.
    • Getter / Setter - Generates public or global accessor methods for fields (class or instance) as needed based on which are already present. A visibility of global can be specified for generated accessor methods only when generating within a global containing class. Setters cannot, of course, be generated for final fields.
    This is the first in a series of Apex code generation improvements. I plan to add code generation for constructors next, then perhaps generation of test classes and empty stub test methods for testable methods found in the original production class. For the latter, though, I may wait to see how the upcoming Einstein GPT feature pans out with regard to automatic test class/method generation.
  • Issue 2414 - Fixed an issue where the inserted code completion for a local custom field on a namespaced packaged custom object's ChangeEvent variant would incorrectly include the namespace prefix.
  • Added an Apex code inspection that verifies that when one of equals() or hashCode() is implemented within an Apex class, the other is as well. If not, a warning is reported with a quick fix to generate the missing method. This is important to ensure that the general contract of equals() and hashCode() is met, though note that it does not verify that these two method implementations have internal logic consistency.
  • Added support for expression type evaluation in the Apex editor using Ctrl + Shift + P.