Skip to content

Commit

Permalink
fix diffgraph usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxology committed Jul 30, 2024
1 parent 287fd5e commit 04aa8fb
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ abstract class ForkJoinParallelCpgPass[T <: AnyRef](
var nDiff = -1
var nDiffT = -1
try {
val diffGraph = Cpg.newDiffGraphBuilder
val diffGraph = new DiffGraphBuilder
nParts = runWithBuilder(diffGraph)
nanosBuilt = System.nanoTime()
nDiff = diffGraph.size()
Expand Down Expand Up @@ -257,7 +257,7 @@ abstract class NewStyleCpgPassBaseWithTimeout[T <: AnyRef](timeout: Long) extend
.collect(
new Supplier[DiffGraphBuilder] {
override def get(): DiffGraphBuilder =
Cpg.newDiffGraphBuilder
new DiffGraphBuilder
},
new BiConsumer[DiffGraphBuilder, AnyRef] {
override def accept(builder: DiffGraphBuilder, part: AnyRef): Unit =
Expand All @@ -273,11 +273,11 @@ abstract class NewStyleCpgPassBaseWithTimeout[T <: AnyRef](timeout: Long) extend
implicit val ec: scala.concurrent.ExecutionContext = scala.concurrent.ExecutionContext.global
val stopAt = System.currentTimeMillis() + timeout * 1000
var exitByTimeout = false
val diffGraphAccumulator = Cpg.newDiffGraphBuilder
val diffGraphAccumulator = new DiffGraphBuilder

val futures = parts.map { part =>
val future = Future {
val diffGraphBuilder = Cpg.newDiffGraphBuilder
val diffGraphBuilder = new DiffGraphBuilder
runOnPart(diffGraphBuilder, part.asInstanceOf[T])
diffGraphBuilder
}
Expand Down

0 comments on commit 04aa8fb

Please sign in to comment.