import java.util.Map;
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 (fChildPacket == null) {
- if (other.fChildPacket != null) {
- return false;
- }
- } else {
- final Packet child = fChildPacket;
- if (child != null) {
- if (!child.equals(other.fChildPacket)) {
- return false;
- }
- } else {
- if (other.fChildPacket != null) {
- return false;
- }
- }
+ if(!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)) {
+ return false;
}
if (!Arrays.equals(fDestinationMacAddress, other.fDestinationMacAddress)) {
return false;
}
- if (fPayload == null) {
- if (other.fPayload != null) {
- return false;
- }
- } else {
- final ByteBuffer payload = fPayload;
- if (payload != null) {
- if (!payload.equals(other.fPayload)) {
- return false;
- }
- } else {
- if (other.fPayload != null) {
- return false;
- }
- }
+ if(!NonNullUtils.equalsNullable(fPayload, other.fPayload)) {
+ return false;
}
+
if (!Arrays.equals(fSourceMacAddress, other.fSourceMacAddress)) {
return false;
}
import java.util.Map;
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;
}
IPv4Packet other = (IPv4Packet) obj;
- final Packet child = fChildPacket;
- if (child != null) {
- if (!child.equals(other.fChildPacket)) {
- return false;
- }
- } else {
- if (other.fChildPacket != null) {
- return false;
- }
+ if (!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)) {
+ return false;
}
-
if (fDSCP != other.fDSCP) {
return false;
}
if (!Arrays.equals(fOptions, other.fOptions)) {
return false;
}
- final ByteBuffer payload = fPayload;
- if (payload != null) {
- if (!payload.equals(other.fPayload)) {
- return false;
- }
- } else {
- if (other.fPayload != null) {
- return false;
- }
+ if (!NonNullUtils.equalsNullable(fPayload, other.fPayload)) {
+ return false;
}
if (fReservedFlag != other.fReservedFlag) {
return false;
}
return true;
}
-
}
return false;
}
PcapPacket other = (PcapPacket) obj;
- final Packet child = fChildPacket;
- if (child != null) {
- if (!child.equals(other.fChildPacket)) {
- return false;
- }
- } else {
- if (other.fChildPacket != null) {
- return false;
- }
+ if(!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)){
+ return false;
}
-
if (fIncludedLength != other.fIncludedLength) {
return false;
}
if (fPacketIndex != other.fPacketIndex) {
return false;
}
- final ByteBuffer payload = fPayload;
- if (payload != null) {
- if (!payload.equals(other.fPayload)) {
- return false;
- }
- } else {
- if (other.fPayload != null) {
- return false;
- }
+ if(!NonNullUtils.equalsNullable(fPayload, other.fPayload)) {
+ return false;
}
-
if (fTimestamp != other.fTimestamp) {
return false;
}
import java.util.Map;
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;
}
- final Packet child = fChildPacket;
- if (child != null) {
- if (!child.equals(other.fChildPacket)) {
- return false;
- }
- } else {
- if (other.fChildPacket != null) {
- return false;
- }
+ if(!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)){
+ return false;
}
-
if (fDataOffset != other.fDataOffset) {
return false;
}
if (fPSHFlag != other.fPSHFlag) {
return false;
}
- final ByteBuffer fPayload2 = fPayload;
- if (fPayload2 != null) {
- if (!fPayload2.equals(other.fPayload)) {
- return false;
- }
- } else {
- if (other.fPayload != null) {
- return false;
- }
+ if(!NonNullUtils.equalsNullable(fPayload, other.fPayload)){
+ return false;
}
if (fRSTFlag != other.fRSTFlag) {
return false;
if (fChecksum != other.fChecksum) {
return false;
}
- final Packet child = fChildPacket;
- if (child != null) {
- if (!child.equals(other.fChildPacket)) {
- return false;
- }
- } else {
- if (other.fChildPacket != null) {
- return false;
- }
+ if(!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)){
+ return false;
}
if (fDestinationPort != other.fDestinationPort) {
return false;
}
- final ByteBuffer payload = fPayload;
- if (payload != null) {
- if (!payload.equals(other.fPayload)) {
- return false;
- }
- } else {
- if (other.fPayload != null) {
- return false;
- }
+ if(!NonNullUtils.equalsNullable(fPayload, other.fPayload)){
+ return false;
}
if (fSourcePort != other.fSourcePort) {
return false;
import java.util.Map;
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;
- final Packet child = fChildPacket;
- if (child != null) {
- if (!child.equals(other.fChildPacket)) {
- return false;
- }
- } else {
- if (other.fChildPacket != null) {
- return false;
- }
+ if(!NonNullUtils.equalsNullable(fChildPacket, other.fChildPacket)){
+ return false;
}
-
if (!fPayload.equals(other.fPayload)) {
return false;
}