Skip to content

Commit 954ea04

Browse files
committed
Refactor data provider method construction
This idea of this refactoring is the same as in the previous commit. Instead of collecting statements into some lists we now collect them right into the currentBlock.
1 parent 2b3c85c commit 954ea04

File tree

5 files changed

+155
-157
lines changed

5 files changed

+155
-157
lines changed

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/context/CgContext.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ internal interface CgContextOwner {
9999
val collectedExceptions: MutableSet<ClassId>
100100

101101
// annotations required by the current method being built
102-
val collectedTestMethodAnnotations: MutableSet<CgAnnotation>
102+
val collectedMethodAnnotations: MutableSet<CgAnnotation>
103103

104104
// imports required by the test class being built
105105
val collectedImports: MutableSet<Import>
@@ -259,7 +259,7 @@ internal interface CgContextOwner {
259259
}
260260

261261
fun addAnnotation(annotation: CgAnnotation) {
262-
if (collectedTestMethodAnnotations.add(annotation)) {
262+
if (collectedMethodAnnotations.add(annotation)) {
263263
importIfNeeded(annotation.classId) // TODO: check how JUnit annotations are loaded
264264
}
265265
}
@@ -391,7 +391,7 @@ internal data class CgContext(
391391
override val collectedTestClassInterfaces: MutableSet<ClassId> = mutableSetOf(),
392392
override val collectedTestClassAnnotations: MutableSet<CgAnnotation> = mutableSetOf(),
393393
override val collectedExceptions: MutableSet<ClassId> = mutableSetOf(),
394-
override val collectedTestMethodAnnotations: MutableSet<CgAnnotation> = mutableSetOf(),
394+
override val collectedMethodAnnotations: MutableSet<CgAnnotation> = mutableSetOf(),
395395
override val collectedImports: MutableSet<Import> = mutableSetOf(),
396396
override val importedStaticMethods: MutableSet<MethodId> = mutableSetOf(),
397397
override val importedClasses: MutableSet<ClassId> = mutableSetOf(),

0 commit comments

Comments
 (0)