File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
jacodb-approximations/src/main/kotlin/org/jacodb/approximation
jacodb-core/src/main/kotlin/org/jacodb/impl/storage Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -178,13 +178,13 @@ private class ApproximationIndexer(
178178 val approximationClassName = classNode.name.className.toApproximationName()
179179
180180 // Ensure that each approximation has one and only one
181- require(originalClassName !in originalToApproximation ) {
181+ require(originalToApproximation.getOrDefault( originalClassName, approximationClassName) == approximationClassName ) {
182182 " An error occurred during approximations indexing: you tried to add `$approximationClassName ` " +
183183 " as an approximation for `$originalClassName `, but the target class is already " +
184184 " associated with approximation `${originalToApproximation[originalClassName]} `. " +
185185 " Only bijection between classes is allowed."
186186 }
187- require(approximationClassName !in approximationToOriginal ) {
187+ require(approximationToOriginal.getOrDefault( approximationClassName, originalClassName) == originalClassName ) {
188188 " An error occurred during approximations indexing: you tried to add `$approximationClassName ` " +
189189 " as an approximation for `$originalClassName `, but this approximation is already used for " +
190190 " `${approximationToOriginal[approximationClassName]} `. " +
Original file line number Diff line number Diff line change @@ -87,10 +87,9 @@ class PersistentByteCodeLocation(
8787 }
8888 }
8989
90- override val jcLocation: JcByteCodeLocation ?
91- get() {
92- return cachedLocation ? : data.toJcLocation()
93- }
90+ override val jcLocation: JcByteCodeLocation ? by lazy(LazyThreadSafetyMode .PUBLICATION ) {
91+ cachedLocation ? : data.toJcLocation()
92+ }
9493
9594 override val path: String
9695 get() = data.path
@@ -138,4 +137,3 @@ class PersistentByteCodeLocation(
138137 }
139138 }
140139}
141-
You can’t perform that action at this time.
0 commit comments