Differential D8912 Diff 32174 java/src/main/java/org/softwareheritage/graph/utils/ListOriginContributors.java
Changeset View
Changeset View
Standalone View
Standalone View
java/src/main/java/org/softwareheritage/graph/utils/ListOriginContributors.java
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | public static void main(String[] args) throws IOException, ClassNotFoundException { | ||||
/* Ancestor is not yet ready to be popped */ | /* Ancestor is not yet ready to be popped */ | ||||
pendingSuccessors.put(ancestorNodeId, pendingSuccessors.get(ancestorNodeId) - 1); | pendingSuccessors.put(ancestorNodeId, pendingSuccessors.get(ancestorNodeId) - 1); | ||||
nodeContributors = new HashSet<>(); | nodeContributors = new HashSet<>(); | ||||
} | } | ||||
} else { | } else { | ||||
nodeContributors = new HashSet<>(); | nodeContributors = new HashSet<>(); | ||||
} | } | ||||
Long personId; | |||||
if (nodeSWHID.getType() == SwhType.REV) { | if (nodeSWHID.getType() == SwhType.REV) { | ||||
nodeContributors.add(underlyingGraph.getAuthorId(nodeId)); | personId = underlyingGraph.getAuthorId(nodeId); | ||||
nodeContributors.add(underlyingGraph.getCommitterId(nodeId)); | if (personId != null) { | ||||
nodeContributors.add(personId); | |||||
} | |||||
personId = underlyingGraph.getCommitterId(nodeId); | |||||
if (personId != null) { | |||||
nodeContributors.add(personId); | |||||
} | |||||
} else if (nodeSWHID.getType() == SwhType.REL) { | } else if (nodeSWHID.getType() == SwhType.REL) { | ||||
nodeContributors.add(underlyingGraph.getAuthorId(nodeId)); | personId = underlyingGraph.getAuthorId(nodeId); | ||||
if (personId != null) { | |||||
nodeContributors.add(personId); | |||||
} | |||||
} | } | ||||
if (!reuseAncestorSet) { | if (!reuseAncestorSet) { | ||||
long computedAncestorCount = 0; | long computedAncestorCount = 0; | ||||
LazyLongIterator it = graph.successors(nodeId); | LazyLongIterator it = graph.successors(nodeId); | ||||
for (long ancestorNodeId; (ancestorNodeId = it.nextLong()) != -1;) { | for (long ancestorNodeId; (ancestorNodeId = it.nextLong()) != -1;) { | ||||
computedAncestorCount++; | computedAncestorCount++; | ||||
if (pendingSuccessors.get(ancestorNodeId) == 1) { | if (pendingSuccessors.get(ancestorNodeId) == 1) { | ||||
Show All 39 Lines |