common: Deprecate NonNullUtils#equalsNullable
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Fri, 8 Jul 2016 01:18:58 +0000 (21:18 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Fri, 8 Jul 2016 22:50:48 +0000 (18:50 -0400)
java.util.Objects#equals does the same thing and provides
some advantages:

1- It is tested/supported by Oracle
2- It is almost binary compatible upon inspecting the code
3- It is more likely that the compiler will receive
   optimizations for their libs than some that are
   _almost_ binary equivalent.
4- It is industry standard, people can understand the code
   better.

Change-Id: Ica0371deee5876f4cbf42f2b6b521d07a8010067
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/76919
Reviewed-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Tested-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-by: Hudson CI
21 files changed:
common/org.eclipse.tracecompass.common.core/annotations/java/util/Objects.eea [new file with mode: 0644]
common/org.eclipse.tracecompass.common.core/src/org/eclipse/tracecompass/common/core/NonNullUtils.java
ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/VariantDeclaration.java
ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/EventDeclaration.java
ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/internal/tmf/ctf/core/trace/iterator/CtfIterator.java
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/ethernet2/EthernetIIPacket.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/ipv4/IPv4Packet.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/pcap/PcapPacket.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/tcp/TCPPacket.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/udp/UDPPacket.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/unknown/UnknownPacket.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/trace/experiment/TmfExperimentLocation.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/TmfEvent.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/TmfEventField.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/TmfLostEvent.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/lookup/TmfCallsite.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomEvent.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomTxtTraceContext.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/project/model/TraceValidationHelper.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/util/Pair.java

diff --git a/common/org.eclipse.tracecompass.common.core/annotations/java/util/Objects.eea b/common/org.eclipse.tracecompass.common.core/annotations/java/util/Objects.eea
new file mode 100644 (file)
index 0000000..0280040
--- /dev/null
@@ -0,0 +1,4 @@
+class java/util/Objects
+equals
+ (Ljava/lang/Object;Ljava/lang/Object;)Z
+ (L0java/lang/Object;L0java/lang/Object;)Z
index 3a46d9aad0eae3530ebeb1f5a81a020f9a79a370..e594ea31901a4f6aa679ee89e053a796ef4314e5 100644 (file)
@@ -13,6 +13,7 @@
 package org.eclipse.tracecompass.common.core;
 
 import java.util.Arrays;
+import java.util.Objects;
 import java.util.stream.Stream;
 
 import org.eclipse.jdt.annotation.NonNull;
@@ -55,7 +56,9 @@ public final class NonNullUtils {
      *            the second object to compare
      * @return true if o1.equals(o2) or o1 == o2
      * @since 1.0
+     * @deprecated use {@link Objects#equals(Object)} instead
      */
+    @Deprecated
     public static boolean equalsNullable(final @Nullable Object o1, final @Nullable Object o2) {
         if (o1 == o2) {
             return true;
index 4b5262335524242f0d538a6a447f48e53639c77e..06f75449bcace22bbdee45d184631bc596b489be 100644 (file)
 
 package org.eclipse.tracecompass.ctf.core.event.types;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.equalsNullable;
-
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Objects;
 
 import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
@@ -201,14 +200,14 @@ public class VariantDeclaration extends Declaration {
         }
         VariantDeclaration other = (VariantDeclaration) obj;
 
-        if (!equalsNullable(fDeclarationToPopulate, other.fDeclarationToPopulate)) {
+        if (!Objects.equals(fDeclarationToPopulate, other.fDeclarationToPopulate)) {
             return false;
         }
         // do not check the order of the fields
-        if (!equalsNullable(fFields, other.fFields)) {
+        if (!Objects.equals(fFields, other.fFields)) {
             return false;
         }
-        if (!equalsNullable(fTag, other.fTag)) {
+        if (!Objects.equals(fTag, other.fTag)) {
             return false;
         }
         return true;
index a48ec1028f45c20f03e4731cb22a156284a9c4b7..59940ec57dced748554c7abc14ae71e76d179317 100644 (file)
@@ -14,11 +14,11 @@ package org.eclipse.tracecompass.internal.ctf.core.event;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.CTFStrings;
 import org.eclipse.tracecompass.ctf.core.event.IEventDeclaration;
@@ -422,16 +422,16 @@ public class EventDeclaration implements IEventDeclaration {
         if (fId != (other.fId)) {
             return false;
         }
-        if (!NonNullUtils.equalsNullable(fContext, other.fContext)) {
+        if (!Objects.equals(fContext, other.fContext)) {
             return false;
         }
-        if (!NonNullUtils.equalsNullable(fFields, other.fFields)) {
+        if (!Objects.equals(fFields, other.fFields)) {
             return false;
         }
-        if (!NonNullUtils.equalsNullable(fName, other.fName)) {
+        if (!Objects.equals(fName, other.fName)) {
             return false;
         }
-        if (!NonNullUtils.equalsNullable(fStream, other.fStream)) {
+        if (!Objects.equals(fStream, other.fStream)) {
             return false;
         }
         if (!fCustomAttributes.equals(other.fCustomAttributes)) {
index 733c6d0687b2a2f1a81a2e4522a6c6331a23bb9f..fb04bfadc607478fbae02f8fbde813df2c23fa3c 100644 (file)
@@ -14,7 +14,8 @@
 package org.eclipse.tracecompass.internal.tmf.ctf.core.trace.iterator;
 
 import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-import static org.eclipse.tracecompass.common.core.NonNullUtils.equalsNullable;
+
+import java.util.Objects;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.ctf.core.CTFException;
@@ -350,10 +351,10 @@ public class CtfIterator extends CTFTraceReader
             return false;
         }
         CtfIterator other = (CtfIterator) obj;
-        if (!equalsNullable(fTrace, other.fTrace)) {
+        if (!Objects.equals(fTrace, other.fTrace)) {
             return false;
         }
-        if (!equalsNullable(fCurLocation, other.fCurLocation)) {
+        if (!Objects.equals(fCurLocation, other.fCurLocation)) {
             return false;
         }
         if (fCurRank != other.fCurRank) {
index 2d18b6f226cf4fa4438807caede66ed197380419..9dc50c220e7997e706fba6134c61cf0a4cc9e69a 100644 (file)
@@ -21,6 +21,7 @@ import java.math.BigInteger;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 import java.util.regex.Matcher;
 
 import javax.xml.XMLConstants;
@@ -35,8 +36,6 @@ import org.eclipse.core.runtime.Platform;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.osgi.util.NLS;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
-import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
 import org.eclipse.tracecompass.internal.lttng2.control.core.model.IBaseEventInfo;
 import org.eclipse.tracecompass.internal.lttng2.control.core.model.IChannelInfo;
 import org.eclipse.tracecompass.internal.lttng2.control.core.model.IDomainInfo;
@@ -47,6 +46,7 @@ import org.eclipse.tracecompass.internal.lttng2.control.core.model.ISessionInfo;
 import org.eclipse.tracecompass.internal.lttng2.control.core.model.ISnapshotInfo;
 import org.eclipse.tracecompass.internal.lttng2.control.core.model.IUstProviderInfo;
 import org.eclipse.tracecompass.internal.lttng2.control.core.model.LogLevelType;
+import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceDomainType;
 import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEnablement;
 import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceEventType;
 import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceLogLevel;
@@ -1005,7 +1005,7 @@ public class LTTngControlServiceMI extends LTTngControlService {
     private static @Nullable Node getFirstOf(NodeList nodeList, String tagName) {
         Node node = null;
         for (int i = 0; i < nodeList.getLength(); i++) {
-            if (NonNullUtils.equalsNullable(nodeList.item(i).getNodeName(), tagName)) {
+            if (Objects.equals(nodeList.item(i).getNodeName(), tagName)) {
                 node = nodeList.item(i);
                 break;
             }
index 1a11da071a1e49355a08e23a27c249b637b533fe..a08d27f18ec64e39bf156f661c94ae5c528b65ba 100644 (file)
@@ -18,9 +18,9 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import java.util.Arrays;
 import java.util.Map;
+import java.util.Objects;
 
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.pcap.core.packet.BadPacketException;
 import org.eclipse.tracecompass.internal.pcap.core.packet.Packet;
 import org.eclipse.tracecompass.internal.pcap.core.protocol.PcapProtocol;
@@ -261,13 +261,13 @@ public class EthernetIIPacket extends Packet {
             return false;
         }
         EthernetIIPacket other = (EthernetIIPacket) obj;
-        if(!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)) {
+        if(!Objects.equals(fChildPacket, other.fChildPacket)) {
             return false;
         }
         if (!Arrays.equals(fDestinationMacAddress, other.fDestinationMacAddress)) {
             return false;
         }
-        if(!NonNullUtils.equalsNullable(fPayload, other.fPayload)) {
+        if(!Objects.equals(fPayload, other.fPayload)) {
             return false;
         }
 
index e83d34049d98d42a47a32800a9bb632a2dc1f715..e8eee6deb9a8623458d40b284fa27efa1b136e54 100644 (file)
@@ -22,6 +22,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import java.util.Arrays;
 import java.util.Map;
+import java.util.Objects;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
@@ -565,7 +566,7 @@ public class IPv4Packet extends Packet {
             return false;
         }
         IPv4Packet other = (IPv4Packet) obj;
-        if (!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)) {
+        if (!Objects.equals(fChildPacket, other.fChildPacket)) {
             return false;
         }
         if (fDSCP != other.fDSCP) {
@@ -601,7 +602,7 @@ public class IPv4Packet extends Packet {
         if (!Arrays.equals(fOptions, other.fOptions)) {
             return false;
         }
-        if (!NonNullUtils.equalsNullable(fPayload, other.fPayload)) {
+        if (!Objects.equals(fPayload, other.fPayload)) {
             return false;
         }
         if (fReservedFlag != other.fReservedFlag) {
index 56d5ee3361df64ee5d4eced24d29f61b913fc9e5..ac03c6e80ae92179b73edc2d1ef708392e3b84a2 100644 (file)
@@ -15,9 +15,9 @@ package org.eclipse.tracecompass.internal.pcap.core.protocol.pcap;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import java.util.Map;
+import java.util.Objects;
 
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.pcap.core.packet.BadPacketException;
 import org.eclipse.tracecompass.internal.pcap.core.packet.Packet;
 import org.eclipse.tracecompass.internal.pcap.core.protocol.PcapProtocol;
@@ -144,8 +144,8 @@ public class PcapPacket extends Packet {
     }
 
     /**
-     * Getter method that returns the timestamp of this packet, in microseconds/nanoseconds
-     * relative to epoch.
+     * Getter method that returns the timestamp of this packet, in
+     * microseconds/nanoseconds relative to epoch.
      *
      * @return The timestamp of the packet.
      */
@@ -193,9 +193,9 @@ public class PcapPacket extends Packet {
     @Override
     public String toString() {
         // TODO Decide if first capture is 0 or 1. Right now, it is 0.
-        String string = getProtocol().getName() + " " + fPacketIndex +  //$NON-NLS-1$
+        String string = getProtocol().getName() + " " + fPacketIndex + //$NON-NLS-1$
                 ": " + fOriginalLength + " bytes on wire, " + //$NON-NLS-1$ //$NON-NLS-2$
-                fIncludedLength + " bytes captured.\nArrival time: " +  //$NON-NLS-1$
+                fIncludedLength + " bytes captured.\nArrival time: " + //$NON-NLS-1$
                 ConversionHelper.toGMTTime(fTimestamp, getTimestampScale()) + "\n"; //$NON-NLS-1$
 
         final Packet child = fChildPacket;
@@ -322,7 +322,7 @@ public class PcapPacket extends Packet {
             return false;
         }
         PcapPacket other = (PcapPacket) obj;
-        if(!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)){
+        if (!Objects.equals(fChildPacket, other.fChildPacket)) {
             return false;
         }
         if (fIncludedLength != other.fIncludedLength) {
@@ -334,7 +334,7 @@ public class PcapPacket extends Packet {
         if (fPacketIndex != other.fPacketIndex) {
             return false;
         }
-        if(!NonNullUtils.equalsNullable(fPayload, other.fPayload)) {
+        if (!Objects.equals(fPayload, other.fPayload)) {
             return false;
         }
         if (fTimestamp != other.fTimestamp) {
index 5259ec13f172e2a99268bad90a8c5b53efd6ee71..0f5ff14d4320e428f62669539851ab06f3d6e3d4 100644 (file)
@@ -16,6 +16,7 @@ import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import java.util.Arrays;
 import java.util.Map;
+import java.util.Objects;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
@@ -620,7 +621,7 @@ public class TCPPacket extends Packet {
         if (fChecksum != other.fChecksum) {
             return false;
         }
-        if(!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)){
+        if(!Objects.equals(fChildPacket, other.fChildPacket)){
             return false;
         }
         if (fDataOffset != other.fDataOffset) {
@@ -644,7 +645,7 @@ public class TCPPacket extends Packet {
         if (fPSHFlag != other.fPSHFlag) {
             return false;
         }
-        if(!NonNullUtils.equalsNullable(fPayload, other.fPayload)){
+        if(!Objects.equals(fPayload, other.fPayload)){
             return false;
         }
         if (fRSTFlag != other.fRSTFlag) {
index 8503ba2ee2ba572bea50b27422b1addbd4f52876..000d4ae96bf356cab25d15fc9d7aab447f9842ff 100644 (file)
@@ -15,10 +15,10 @@ package org.eclipse.tracecompass.internal.pcap.core.protocol.udp;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import java.util.Map;
+import java.util.Objects;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.pcap.core.packet.BadPacketException;
 import org.eclipse.tracecompass.internal.pcap.core.packet.Packet;
 import org.eclipse.tracecompass.internal.pcap.core.protocol.PcapProtocol;
@@ -266,13 +266,13 @@ public class UDPPacket extends Packet {
         if (fChecksum != other.fChecksum) {
             return false;
         }
-        if(!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)){
+        if(!Objects.equals(fChildPacket, other.fChildPacket)){
             return false;
         }
         if (fDestinationPort != other.fDestinationPort) {
             return false;
         }
-        if(!NonNullUtils.equalsNullable(fPayload, other.fPayload)){
+        if(!Objects.equals(fPayload, other.fPayload)){
             return false;
         }
         if (fSourcePort != other.fSourcePort) {
index ac181a95b48d788f604627352f682a36a84f4dc5..81c57966848a66807b716cfca2f0aa883e8f32c1 100644 (file)
@@ -17,10 +17,10 @@ import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
 import java.io.UnsupportedEncodingException;
 import java.nio.ByteBuffer;
 import java.util.Map;
+import java.util.Objects;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.pcap.core.packet.Packet;
 import org.eclipse.tracecompass.internal.pcap.core.protocol.PcapProtocol;
 import org.eclipse.tracecompass.internal.pcap.core.trace.PcapFile;
@@ -192,7 +192,7 @@ public class UnknownPacket extends Packet {
             return false;
         }
         UnknownPacket other = (UnknownPacket) obj;
-        if (!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)) {
+        if (!Objects.equals(fChildPacket, other.fChildPacket)) {
             return false;
         }
         if (!fPayload.equals(other.fPayload)) {
index 108e11b5056a2554608849b434633f69b224b7de..79aa5493b416c28ffd162863f78df6789ab1e5a6 100644 (file)
@@ -14,9 +14,8 @@
 
 package org.eclipse.tracecompass.internal.tmf.core.trace.experiment;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.equalsNullable;
-
 import java.nio.ByteBuffer;
+import java.util.Objects;
 
 import org.eclipse.tracecompass.tmf.core.trace.location.ITmfLocation;
 
@@ -95,7 +94,7 @@ public final class TmfExperimentLocation implements ITmfLocation {
             return false;
         }
         final TmfExperimentLocation other = (TmfExperimentLocation) obj;
-        if(!equalsNullable(fLocation, other.fLocation)){
+        if(!Objects.equals(fLocation, other.fLocation)){
             return false;
         }
         return true;
index dcbd1ff7e68224c957ba3aa528c56a8082d2d664..15d859d7b4d2b4327b94e693b7d8c4eb534e2484 100644 (file)
 
 package org.eclipse.tracecompass.tmf.core.event;
 
+import java.util.Objects;
+
 import org.eclipse.core.runtime.PlatformObject;
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfContext;
@@ -194,10 +195,10 @@ public class TmfEvent extends PlatformObject implements ITmfEvent {
         if (!getTimestamp().equals(other.getTimestamp())) {
             return false;
         }
-        if (!NonNullUtils.equalsNullable(getType(), other.getType())) {
+        if (!Objects.equals(getType(), other.getType())) {
             return false;
         }
-        if (!NonNullUtils.equalsNullable(getContent(), other.getContent())) {
+        if (!Objects.equals(getContent(), other.getContent())) {
             return false;
         }
         return true;
index 1ad95b3a6bf40721c3735ec35c158fd5571d391c..ef2176170cb195c569f3891225cdd9b783b1bd4b 100644 (file)
@@ -20,10 +20,10 @@ import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Map;
+import java.util.Objects;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.common.core.ObjectUtils;
 
 import com.google.common.base.Joiner;
@@ -184,7 +184,7 @@ public class TmfEventField implements ITmfEventField {
         final TmfEventField other = (TmfEventField) obj;
 
         /* Check that the field names are the same. */
-        if (!NonNullUtils.equalsNullable(getName(), other.getName())) {
+        if (!Objects.equals(getName(), other.getName())) {
             return false;
         }
 
index ba56dd0548ee284063ffb6cc8266303b59905e9e..0689ea57e67e59b26d9142551db2d9933afdfe31 100644 (file)
@@ -13,7 +13,7 @@
 
 package org.eclipse.tracecompass.tmf.core.event;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.equalsNullable;
+import java.util.Objects;
 
 import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
@@ -106,7 +106,7 @@ public class TmfLostEvent extends TmfEvent implements ITmfLostEvent {
         if (fNbLostEvents != other.fNbLostEvents) {
             return false;
         }
-        if (!equalsNullable(fTimeRange, other.fTimeRange)) {
+        if (!Objects.equals(fTimeRange, other.fTimeRange)) {
             return false;
         }
         return true;
index 9e61bb38d63705e1a985b66e51ee6d4e50b62a87..8e81eaa82d589997d2f980362f7eaa96157ec02f 100644 (file)
@@ -12,7 +12,7 @@
 
 package org.eclipse.tracecompass.tmf.core.event.lookup;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.equalsNullable;
+import java.util.Objects;
 
 import org.eclipse.jdt.annotation.NonNull;
 
@@ -126,7 +126,7 @@ public class TmfCallsite implements ITmfCallsite {
             return false;
         }
 
-        if (!equalsNullable(fFunctionName, other.fFunctionName)) {
+        if (!Objects.equals(fFunctionName, other.fFunctionName)) {
             return false;
         }
         if (fLineNumber != other.fLineNumber) {
index f1bae00e172734ea2d8923b6015c230b7255f246..e0e41ef6a2aca8e2a065b3b1cc8ba369723c5123 100644 (file)
 
 package org.eclipse.tracecompass.tmf.core.parsers.custom;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.equalsNullable;
-
 import java.text.ParseException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
@@ -286,7 +285,7 @@ public class CustomEvent extends TmfEvent {
             return false;
         }
         CustomEvent other = (CustomEvent) obj;
-        if (!equalsNullable(fDefinition, other.fDefinition)) {
+        if (!Objects.equals(fDefinition, other.fDefinition)) {
             return false;
         }
 
@@ -294,11 +293,11 @@ public class CustomEvent extends TmfEvent {
             return false;
         }
 
-        if (!equalsNullable(customEventContent, other.customEventContent)) {
+        if (!Objects.equals(customEventContent, other.customEventContent)) {
             return false;
         }
 
-        if (!equalsNullable(customEventType, other.customEventType)) {
+        if (!Objects.equals(customEventType, other.customEventType)) {
             return false;
         }
         return true;
index a83dabd13378aeb6b57d24e26dd9c53498577619..47524e7c95e101e968a1edd173c48342a42df789 100644 (file)
@@ -12,8 +12,7 @@
 
 package org.eclipse.tracecompass.tmf.core.parsers.custom;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.equalsNullable;
-
+import java.util.Objects;
 import java.util.regex.Matcher;
 
 import org.eclipse.tracecompass.tmf.core.parsers.custom.CustomTxtTraceDefinition.InputLine;
@@ -74,13 +73,13 @@ public class CustomTxtTraceContext extends TmfContext {
             return false;
         }
         CustomTxtTraceContext other = (CustomTxtTraceContext) obj;
-        if (!equalsNullable(firstLine, other.firstLine)) {
+        if (!Objects.equals(firstLine, other.firstLine)) {
             return false;
         }
-        if (!equalsNullable(firstLineMatcher, other.firstLineMatcher)) {
+        if (!Objects.equals(firstLineMatcher, other.firstLineMatcher)) {
             return false;
         }
-        if (!equalsNullable(inputLine, other.inputLine)) {
+        if (!Objects.equals(inputLine, other.inputLine)) {
             return false;
         }
         if (nextLineLocation != other.nextLineLocation) {
index 4edebf0297ddbf7c73c8d32434e3accf9a53aed5..dc9efae8720087ec9eea6f53790eb0a1ccfc9f80 100644 (file)
@@ -12,7 +12,7 @@
 
 package org.eclipse.tracecompass.tmf.core.project.model;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.equalsNullable;
+import java.util.Objects;
 
 /**
  * Trace import helper class
@@ -72,10 +72,10 @@ public class TraceValidationHelper implements Comparable<TraceValidationHelper>
             return false;
         }
         TraceValidationHelper other = (TraceValidationHelper) obj;
-        if (!equalsNullable(fTraceToScan, other.fTraceToScan)) {
+        if (!Objects.equals(fTraceToScan, other.fTraceToScan)) {
             return false;
         }
-        if(!equalsNullable(fTraceType, other.fTraceType)){
+        if(!Objects.equals(fTraceType, other.fTraceType)){
             return false;
         }
         return true;
index a27e152c660780e31f482fa0eb077188ca0d62d2..330c42bec4d9d347ab6a0bf05fa577273aa577d0 100644 (file)
@@ -14,8 +14,9 @@
  *******************************************************************************/
 package org.eclipse.tracecompass.tmf.core.util;
 
+import java.util.Objects;
+
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 
 /**
  * Pair utility class, encapsulates a pair of objects.
@@ -95,10 +96,10 @@ public class Pair<A, B> {
             return false;
         }
         Pair<?, ?> other = (Pair<?, ?>) obj;
-        if (!NonNullUtils.equalsNullable(other.fFirst, fFirst)) {
+        if (!Objects.equals(other.fFirst, fFirst)) {
             return false;
         }
-        if (!NonNullUtils.equalsNullable(other.fSecond, fSecond)) {
+        if (!Objects.equals(other.fSecond, fSecond)) {
             return false;
         }
         return true;
This page took 0.044446 seconds and 5 git commands to generate.