--- /dev/null
+class java/util/Objects
+equals
+ (Ljava/lang/Object;Ljava/lang/Object;)Z
+ (L0java/lang/Object;L0java/lang/Object;)Z
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;
* 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;
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;
}
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;
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;
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)) {
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;
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) {
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;
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;
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;
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;
}
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;
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;
}
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;
return false;
}
IPv4Packet other = (IPv4Packet) obj;
- if (!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)) {
+ if (!Objects.equals(fChildPacket, other.fChildPacket)) {
return false;
}
if (fDSCP != other.fDSCP) {
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) {
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;
}
/**
- * 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.
*/
@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;
return false;
}
PcapPacket other = (PcapPacket) obj;
- if(!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)){
+ if (!Objects.equals(fChildPacket, other.fChildPacket)) {
return false;
}
if (fIncludedLength != other.fIncludedLength) {
if (fPacketIndex != other.fPacketIndex) {
return false;
}
- if(!NonNullUtils.equalsNullable(fPayload, other.fPayload)) {
+ if (!Objects.equals(fPayload, other.fPayload)) {
return false;
}
if (fTimestamp != other.fTimestamp) {
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;
if (fChecksum != other.fChecksum) {
return false;
}
- if(!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)){
+ if(!Objects.equals(fChildPacket, other.fChildPacket)){
return false;
}
if (fDataOffset != other.fDataOffset) {
if (fPSHFlag != other.fPSHFlag) {
return false;
}
- if(!NonNullUtils.equalsNullable(fPayload, other.fPayload)){
+ if(!Objects.equals(fPayload, other.fPayload)){
return false;
}
if (fRSTFlag != other.fRSTFlag) {
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;
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) {
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;
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)) {
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;
return false;
}
final TmfExperimentLocation other = (TmfExperimentLocation) obj;
- if(!equalsNullable(fLocation, other.fLocation)){
+ if(!Objects.equals(fLocation, other.fLocation)){
return false;
}
return true;
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;
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;
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;
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;
}
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;
if (fNbLostEvents != other.fNbLostEvents) {
return false;
}
- if (!equalsNullable(fTimeRange, other.fTimeRange)) {
+ if (!Objects.equals(fTimeRange, other.fTimeRange)) {
return false;
}
return true;
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;
return false;
}
- if (!equalsNullable(fFunctionName, other.fFunctionName)) {
+ if (!Objects.equals(fFunctionName, other.fFunctionName)) {
return false;
}
if (fLineNumber != other.fLineNumber) {
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;
return false;
}
CustomEvent other = (CustomEvent) obj;
- if (!equalsNullable(fDefinition, other.fDefinition)) {
+ if (!Objects.equals(fDefinition, other.fDefinition)) {
return false;
}
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;
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;
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) {
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
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;
*******************************************************************************/
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.
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;