Skip to content

Commit 5a748b5

Browse files
authored
Fix usages feature: filter callers by location (#315)
1 parent 7c75c31 commit 5a748b5

File tree

1 file changed

+3
-1
lines changed
  • jacodb-core/src/main/kotlin/org/jacodb/impl/features

1 file changed

+3
-1
lines changed

jacodb-core/src/main/kotlin/org/jacodb/impl/features/Usages.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import org.jacodb.impl.storage.defaultBatchSize
3434
import org.jacodb.impl.storage.dslContext
3535
import org.jacodb.impl.storage.eqOrNull
3636
import org.jacodb.impl.storage.ers.filterDeleted
37+
import org.jacodb.impl.storage.ers.filterLocations
3738
import org.jacodb.impl.storage.ers.toClassSource
3839
import org.jacodb.impl.storage.execute
3940
import org.jacodb.impl.storage.executeQueries
@@ -279,11 +280,12 @@ object Usages : JcFeature<UsageFeatureRequest, UsageFeatureResponse> {
279280
val locationId = callee.getCompressed<Long>("locationId")!!
280281
callee.getLinks("calls").map { it to locationId }
281282
}
282-
.map { (call, _) ->
283+
.map { (call, callerLocationId) ->
283284
val callerId = call.getCompressedBlob<Long>("callerId")!!
284285
val caller = symbolInterner.findSymbolName(callerId)!!
285286
val clazz = txn.find("Class", "nameId", callerId.compressed)
286287
.filterDeleted()
288+
.filterLocations(callerLocationId)
287289
.first()
288290
val classId = clazz.id.instanceId
289291
UsageFeatureResponse(

0 commit comments

Comments
 (0)