in sarif/src/main/java/com/jetbrains/qodana/sarif/baseline/ResultKey.java [57:75]
private boolean equalsLocation(Location location, Location oLocation) {
if (location == null || oLocation == null) return location == oLocation;
if (!equalsPhysicalLocation(location.getPhysicalLocation(), oLocation.getPhysicalLocation())) return false;
if (location.getPhysicalLocation() != null) return true;
Set<LogicalLocation> locations = location.getLogicalLocations();
Set<LogicalLocation> oLocations = oLocation.getLogicalLocations();
if (locations == null || oLocations == null) return locations == oLocations;
if (locations.size() != oLocations.size()) return false;
Iterator<LogicalLocation> iterator = locations.iterator();
Iterator<LogicalLocation> oIterator = oLocations.iterator();
while (iterator.hasNext()) {
LogicalLocation logicalLocation = iterator.next();
LogicalLocation oLogicalLocation = oIterator.next();
if (!equalsLogicalLocation(logicalLocation, oLogicalLocation)) return false;
}
return true;
}