diff --git a/jacodb-api-common/src/main/kotlin/org/jacodb/api/common/cfg/CommonInst.kt b/jacodb-api-common/src/main/kotlin/org/jacodb/api/common/cfg/CommonInst.kt
index 5237519f1..458684399 100644
--- a/jacodb-api-common/src/main/kotlin/org/jacodb/api/common/cfg/CommonInst.kt
+++ b/jacodb-api-common/src/main/kotlin/org/jacodb/api/common/cfg/CommonInst.kt
@@ -20,9 +20,6 @@ import org.jacodb.api.common.CommonMethod
interface CommonInst {
val location: CommonInstLocation
-
- val method: CommonMethod
- get() = location.method
}
interface CommonInstLocation {
diff --git a/jacodb-api-common/src/main/kotlin/org/jacodb/api/common/cfg/InstList.kt b/jacodb-api-common/src/main/kotlin/org/jacodb/api/common/cfg/InstList.kt
deleted file mode 100644
index bd2943f4f..000000000
--- a/jacodb-api-common/src/main/kotlin/org/jacodb/api/common/cfg/InstList.kt
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2022 UnitTestBot contributors (utbot.org)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jacodb.api.common.cfg
-
-interface InstList : Iterable {
- val instructions: List
- val size: Int
- val indices: IntRange
- val lastIndex: Int
-
- operator fun get(index: Int): INST
- fun getOrNull(index: Int): INST?
-
- fun toMutableList(): MutableInstList
-}
-
-interface MutableInstList : InstList {
- fun insertBefore(inst: INST, vararg newInstructions: INST)
- fun insertBefore(inst: INST, newInstructions: Collection)
- fun insertAfter(inst: INST, vararg newInstructions: INST)
- fun insertAfter(inst: INST, newInstructions: Collection)
- fun remove(inst: INST): Boolean
- fun removeAll(inst: Collection): Boolean
-}
diff --git a/jacodb-api-jvm/src/main/kotlin/org/jacodb/api/jvm/cfg/JcInst.kt b/jacodb-api-jvm/src/main/kotlin/org/jacodb/api/jvm/cfg/JcInst.kt
index 4c813b3b7..dcafcf86b 100644
--- a/jacodb-api-jvm/src/main/kotlin/org/jacodb/api/jvm/cfg/JcInst.kt
+++ b/jacodb-api-jvm/src/main/kotlin/org/jacodb/api/jvm/cfg/JcInst.kt
@@ -55,8 +55,6 @@ interface JcInst : CommonInst {
override val location: JcInstLocation
val operands: List
- override val method: JcMethod
- get() = location.method
val lineNumber: Int
get() = location.lineNumber
diff --git a/jacodb-core/src/main/kotlin/org/jacodb/impl/cfg/JcBlockGraphImpl.kt b/jacodb-core/src/main/kotlin/org/jacodb/impl/cfg/JcBlockGraphImpl.kt
index ddc8b17e1..cd69d769c 100644
--- a/jacodb-core/src/main/kotlin/org/jacodb/impl/cfg/JcBlockGraphImpl.kt
+++ b/jacodb-core/src/main/kotlin/org/jacodb/impl/cfg/JcBlockGraphImpl.kt
@@ -109,8 +109,8 @@ class JcBlockGraphImpl(
(block.start.index..block.end.index).map { jcGraph.instructions[it] }
override fun block(inst: JcInst): JcBasicBlock {
- assert(inst.method == jcGraph.method) {
- "required method of instruction ${jcGraph.method} but got ${inst.method}"
+ assert(inst.location.method == jcGraph.method) {
+ "required method of instruction ${jcGraph.method} but got ${inst.location.method}"
}
for (basicBlock in entries) {
if (basicBlock.contains(inst)) {
diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/Stmt.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/Stmt.kt
index 834ac3eb6..4875db2e4 100644
--- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/Stmt.kt
+++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/model/Stmt.kt
@@ -25,9 +25,6 @@ import org.jacodb.api.common.cfg.CommonReturnInst
interface EtsStmt : CommonInst {
override val location: EtsStmtLocation
- override val method: EtsMethod
- get() = location.method
-
interface Visitor {
fun visit(stmt: EtsNopStmt): R
fun visit(stmt: EtsAssignStmt): R
diff --git a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/BlockCfgToDot.kt b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/BlockCfgToDot.kt
index 6f75b4b52..af05679f8 100644
--- a/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/BlockCfgToDot.kt
+++ b/jacodb-ets/src/main/kotlin/org/jacodb/ets/utils/BlockCfgToDot.kt
@@ -154,7 +154,7 @@ fun InterproceduralCfg.toHighlightedDotWithCalls(
val h = sanitize(stmt.hashCode())
val clusterName = "cluster_${h}_B${parentBlock}"
// method signature label
- val methodSig = cfg.entries.first().method.signature
+ val methodSig = cfg.entries.first().location.method.signature
// open subgraph
lines += " subgraph \"$clusterName\" {"
lines += " label=\"$methodSig\";"