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 theequals()
and/orhashCode()
methods using user-specified fields, checking fornull
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 eitherequals()
orhashCode()
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
orglobal
accessor methods for fields (class or instance) as needed based on which are already present. A visibility ofglobal
can be specified for generated accessor methods only when generating within aglobal
containing class. Setters cannot, of course, be generated forfinal
fields.
- 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()
orhashCode()
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 ofequals()
andhashCode()
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.