diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/genotyper/GenotypingEngine.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/genotyper/GenotypingEngine.java index 2635fea66..2d01a9a68 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/genotyper/GenotypingEngine.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/genotyper/GenotypingEngine.java @@ -106,7 +106,7 @@ public abstract class GenotypingEngine upstreamDeletionsLoc = new LinkedList<>(); + private final ThreadLocal< List > upstreamDeletionsLoc = ThreadLocal.withInitial(() -> new LinkedList()); protected final AFCalculator newAFCalculator; @@ -411,7 +411,7 @@ public abstract class GenotypingEngine 0) { final GenomeLoc genomeLoc = genomeLocParser.createGenomeLocOnContig(vc.getContig(), vc.getStart(), vc.getStart() + deletionSize); - upstreamDeletionsLoc.add(genomeLoc); + upstreamDeletionsLoc.get().add(genomeLoc); } } @@ -422,7 +422,7 @@ public abstract class GenotypingEngine it = upstreamDeletionsLoc.iterator(); it.hasNext(); ) { + for (Iterator it = upstreamDeletionsLoc.get().iterator(); it.hasNext(); ) { final GenomeLoc loc = it.next(); if (!loc.getContig().equals(vc.getContig())) { // past contig deletion. it.remove();