}
public static boolean flowEquals(Flow statsFlow, Flow storedFlow) {
- if (statsFlow.getClass() != storedFlow.getClass()) {
+ if (statsFlow == null || storedFlow == null) {
return false;
}
if (statsFlow.getContainerName()== null) {
} else if(!statsFlow.getContainerName().equals(storedFlow.getContainerName())) {
return false;
}
- if (statsFlow.getMatch()== null) {
- if (storedFlow.getMatch() != null) {
+ if (storedFlow.getPriority() == null) {
+ if (statsFlow.getPriority() != null && statsFlow.getPriority()!= 0x8000) {
return false;
}
- } //else if(!statsFlow.getMatch().equals(storedFlow.getMatch())) {
- else if(!matchEquals(statsFlow.getMatch(), storedFlow.getMatch())) {
+ } else if(!statsFlow.getPriority().equals(storedFlow.getPriority())) {
return false;
}
- if (storedFlow.getPriority() == null) {
- if (statsFlow.getPriority() != null && statsFlow.getPriority()!= 0x8000) {
+ if (statsFlow.getMatch()== null) {
+ if (storedFlow.getMatch() != null) {
return false;
}
- } else if(!statsFlow.getPriority().equals(storedFlow.getPriority())) {
+ } else if(!matchEquals(statsFlow.getMatch(), storedFlow.getMatch())) {
return false;
}
if (statsFlow.getTableId() == null) {
if (statsFlow == storedFlow) {
return true;
}
- if (storedFlow.getClass() != statsFlow.getClass()) {
- return false;
- }
+ if (storedFlow == null && statsFlow != null) return false;
+ if (statsFlow == null && storedFlow != null) return false;
if (storedFlow.getEthernetMatch() == null) {
if (statsFlow.getEthernetMatch() != null) {
return false;