Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
lehvolk committed Oct 9, 2023
1 parent 7184d3f commit c703b86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package org.jacodb.impl.cfg
import org.jacodb.api.*
import org.jacodb.api.cfg.*
import org.jacodb.api.ext.*
import org.jacodb.impl.cfg.util.LAMBDA_METAFACTORY_CLASS
import org.jacodb.impl.cfg.util.UNINIT_THIS
import org.jacodb.impl.cfg.util.typeName
import org.jacodb.impl.cfg.util.lambdaMetaFactory
import org.jacodb.impl.cfg.util.lambdaMetaFactoryMethodName

/** This class stores state and is NOT THREAD SAFE. Use it carefully */
class JcInstListBuilder(val method: JcMethod,val instList: JcInstList<JcRawInst>) : JcRawInstVisitor<JcInst?>, JcRawExprVisitor<JcExpr> {
Expand Down Expand Up @@ -261,9 +261,6 @@ class JcInstListBuilder(val method: JcMethod,val instList: JcInstList<JcRawInst>
override fun visitJcRawInstanceOfExpr(expr: JcRawInstanceOfExpr): JcExpr =
JcInstanceOfExpr(classpath.boolean, expr.operand.accept(this) as JcValue, expr.targetType.asType())

private val lambdaMetaFactory: TypeName by lazy { LAMBDA_METAFACTORY_CLASS.typeName() }
private val lambdaMetaFactoryMethodName: String = "metafactory"

override fun visitJcRawDynamicCallExpr(expr: JcRawDynamicCallExpr): JcExpr {
if (expr.bsm.declaringClass == lambdaMetaFactory && expr.bsm.name == lambdaMetaFactoryMethodName) {
val lambdaExpr = tryResolveJcLambdaExpr(expr)
Expand Down
3 changes: 3 additions & 0 deletions jacodb-core/src/main/kotlin/org/jacodb/impl/cfg/util/types.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,6 @@ internal fun TypeName.baseElementType(): TypeName {
} while (next != null)
return current!!
}

val lambdaMetaFactory: TypeName = LAMBDA_METAFACTORY_CLASS.typeName()
val lambdaMetaFactoryMethodName: String = "metafactory"

0 comments on commit c703b86

Please sign in to comment.