@@ -7,6 +7,7 @@ import org.slf4j.{Logger, LoggerFactory, MDC}
77import overflowdb .BatchedUpdate
88
99import java .util .function .{BiConsumer , Supplier }
10+ import scala .annotation .nowarn
1011import scala .concurrent .duration .DurationLong
1112import scala .util .{Failure , Success , Try }
1213
@@ -79,8 +80,11 @@ abstract class SimpleCpgPass(cpg: Cpg, outName: String = "", keyPool: Option[Key
7980 * methods. This may be better than using the constructor or GC, because e.g. SCPG chains of passes construct
8081 * passes eagerly, and releases them only when the entire chain has run.
8182 * */
82- abstract class ForkJoinParallelCpgPass [T <: AnyRef ](cpg : Cpg , outName : String = " " , keyPool : Option [KeyPool ] = None )
83- extends NewStyleCpgPassBase [T ] {
83+ abstract class ForkJoinParallelCpgPass [T <: AnyRef ](
84+ cpg : Cpg ,
85+ @ nowarn outName : String = " " ,
86+ keyPool : Option [KeyPool ] = None
87+ ) extends NewStyleCpgPassBase [T ] {
8488
8589 override def createApplySerializeAndStore (
8690 serializedCpg : SerializedCpg ,
@@ -98,28 +102,11 @@ abstract class ForkJoinParallelCpgPass[T <: AnyRef](cpg: Cpg, outName: String =
98102 nParts = runWithBuilder(diffGraph)
99103 nanosBuilt = System .nanoTime()
100104 nDiff = diffGraph.size()
101- val doSerialize = serializedCpg != null && ! serializedCpg.isEmpty
102- val withInverse = doSerialize && inverse
103- val listener =
104- if (withInverse) new BatchUpdateInverseListener else if (doSerialize) new BatchUpdateForwardListener else null
105105
106106 nDiffT = overflowdb.BatchedUpdate
107- .applyDiff(cpg.graph, diffGraph, keyPool.getOrElse(null ), listener )
107+ .applyDiff(cpg.graph, diffGraph, keyPool.getOrElse(null ), null )
108108 .transitiveModifications()
109109
110- if (withInverse) {
111- store(
112- listener.asInstanceOf [BatchUpdateInverseListener ].getSerialization(),
113- generateOutFileName(prefix, outName, 0 ),
114- serializedCpg
115- )
116- } else if (doSerialize) {
117- store(
118- listener.asInstanceOf [BatchUpdateForwardListener ].builder.build(),
119- generateOutFileName(prefix, outName, 0 ),
120- serializedCpg
121- )
122- }
123110 } catch {
124111 case exc : Exception =>
125112 baseLogger.error(s " Pass ${name} failed " , exc)
0 commit comments