if(oldOp != null) {
oldOp.tryCancel();
}
return oldOp;
}
<BUG>public void cancelAllBuilds() {
HashMap2<Location, ProjectBuildOperation> oldBuildOps;</BUG>
synchronized (buildOps_mutex) {
<BUG>oldBuildOps = buildOps.copy();
buildOps.clear();
}</BUG>
for (ProjectBuildOperation buildOp : oldBuildOps.values()) {

if(oldOp != null) {
oldOp.tryCancel();
}
return oldOp;
}
public Collection<ProjectBuildOperation> cancelAllBuilds() {
HashMap2<Location, ProjectBuildOperation> oldBuildOps;
synchronized (buildOps_mutex) {
oldBuildOps = buildOps;
buildOps = new HashMap2<>();
}
for (ProjectBuildOperation buildOp : oldBuildOps.values()) {
