Skip to content
Merged

Fixes #299

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ private class ApproximationIndexer(
val approximationClassName = classNode.name.className.toApproximationName()

// Ensure that each approximation has one and only one
require(originalClassName !in originalToApproximation) {
require(originalToApproximation.getOrDefault(originalClassName, approximationClassName) == approximationClassName) {
"An error occurred during approximations indexing: you tried to add `$approximationClassName` " +
"as an approximation for `$originalClassName`, but the target class is already " +
"associated with approximation `${originalToApproximation[originalClassName]}`. " +
"Only bijection between classes is allowed."
}
require(approximationClassName !in approximationToOriginal) {
require(approximationToOriginal.getOrDefault(approximationClassName, originalClassName) == originalClassName) {
"An error occurred during approximations indexing: you tried to add `$approximationClassName` " +
"as an approximation for `$originalClassName`, but this approximation is already used for " +
"`${approximationToOriginal[approximationClassName]}`. " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@ class PersistentByteCodeLocation(
}
}

override val jcLocation: JcByteCodeLocation?
get() {
return cachedLocation ?: data.toJcLocation()
}
override val jcLocation: JcByteCodeLocation? by lazy(LazyThreadSafetyMode.PUBLICATION) {
cachedLocation ?: data.toJcLocation()
}

override val path: String
get() = data.path
Expand Down Expand Up @@ -138,4 +137,3 @@ class PersistentByteCodeLocation(
}
}
}