You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/07/16 21:44:55 UTC

[commons-scxml] branch master updated: Use Objects.equals()

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-scxml.git


The following commit(s) were added to refs/heads/master by this push:
     new b30f0b0  Use Objects.equals()
b30f0b0 is described below

commit b30f0b09e7598108fa2d37559fbaa5f2bf395c9c
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jul 16 17:44:51 2023 -0400

    Use Objects.equals()
---
 src/main/java/org/apache/commons/scxml2/TriggerEvent.java | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/commons/scxml2/TriggerEvent.java b/src/main/java/org/apache/commons/scxml2/TriggerEvent.java
index 8177114..620a4af 100644
--- a/src/main/java/org/apache/commons/scxml2/TriggerEvent.java
+++ b/src/main/java/org/apache/commons/scxml2/TriggerEvent.java
@@ -17,6 +17,7 @@
 package org.apache.commons.scxml2;
 
 import java.io.Serializable;
+import java.util.Objects;
 
 /**
  * A class representing an event. Specific event types have been
@@ -154,10 +155,6 @@ public class TriggerEvent implements Serializable {
         return data;
     }
 
-    private static boolean equals(final Object a, final Object b) {
-        return (a == null && b == null) || (a != null && a.equals(b));
-    }
-
     /**
      * Define an equals operator for TriggerEvent.
      *
@@ -168,11 +165,11 @@ public class TriggerEvent implements Serializable {
         if (obj instanceof TriggerEvent) {
             final TriggerEvent te2 = (TriggerEvent) obj;
             if (type == te2.type && name.equals(te2.name) &&
-                    equals(sendId, te2.sendId) &&
-                    equals(origin, te2.origin) &&
-                    equals(originType, te2.originType) &&
-                    equals(invokeId, te2.invokeId) &&
-                    equals(data, te2.data)) {
+                    Objects.equals(sendId, te2.sendId) &&
+                    Objects.equals(origin, te2.origin) &&
+                    Objects.equals(originType, te2.originType) &&
+                    Objects.equals(invokeId, te2.invokeId) &&
+                    Objects.equals(data, te2.data)) {
                 return true;
             }
         }