Question

3
Replies
8544
Views
Close popover
Carlo Sogono (sogoc)
PEGA
Lead System Architect
Pegasystems Inc.
AU
sogoc Member since 2017 6 posts
PEGA
Posted: February 26, 2018
Last activity: February 27, 2018
Closed
Solved

String comparisons in Pega

Within data transforms, is there any difference in using @equals and == between string properties and/or string literals?

I understand that in Java, using == will compare the object reference even if the contents are identical. But in Pega (and correct me if I'm wrong) it will always compare contents and never the object reference.

I've had LSA/SSA's strongly believe that I should never use == to compare strings in data transforms, and others who believe it is perfectly fine.

Any thoughts on why I would use one over another? On looking at the Java code of @equals I can use it to avoid having to check whether the property has been set (null). It always returns false when one is null. Other than that, am I missing anything else when using == ?

Low-Code App Development Case Management
Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.