Skip to content

Commit 5290278

Browse files
committed
Remove unused Cg node
1 parent 76a4ec0 commit 5290278

File tree

4 files changed

+1
-60
lines changed

4 files changed

+1
-60
lines changed

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/tree/Builders.kt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -113,31 +113,6 @@ class CgTestMethodBuilder : CgMethodBuilder<CgTestMethod> {
113113

114114
fun buildTestMethod(init: CgTestMethodBuilder.() -> Unit) = CgTestMethodBuilder().apply(init).build()
115115

116-
class CgCustomMethodBuilder : CgMethodBuilder<CgCustomMethod> {
117-
override lateinit var name: String
118-
override lateinit var returnType: ClassId
119-
override lateinit var parameters: List<CgParameterDeclaration>
120-
override lateinit var statements: List<CgStatement>
121-
override val exceptions: MutableSet<ClassId> = mutableSetOf()
122-
override val annotations: MutableList<CgAnnotation> = mutableListOf()
123-
override var documentation: CgDocumentationComment = CgDocumentationComment(emptyList())
124-
var isStatic: Boolean = false
125-
126-
override fun build() = CgCustomMethod(
127-
name,
128-
returnType,
129-
parameters,
130-
statements,
131-
exceptions,
132-
annotations,
133-
isStatic,
134-
documentation
135-
)
136-
}
137-
138-
@Suppress("unused")
139-
fun buildCustomMethod(init: CgCustomMethodBuilder.() -> Unit) = CgCustomMethodBuilder().apply(init).build()
140-
141116
class CgErrorTestMethodBuilder : CgMethodBuilder<CgErrorTestMethod> {
142117
override lateinit var name: String
143118
override val returnType: ClassId = voidClassId

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/tree/CgElement.kt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ interface CgElement {
4848
is CgAuxiliaryClass -> visit(element)
4949
is CgUtilMethod -> visit(element)
5050
is CgTestMethod -> visit(element)
51-
is CgCustomMethod -> visit(element)
5251
is CgErrorTestMethod -> visit(element)
5352
is CgParameterizedTestDataProviderMethod -> visit(element)
5453
is CgCommentedAnnotation -> visit(element)
@@ -295,30 +294,6 @@ class CgTestMethod(
295294
override val requiredFields: List<CgParameterDeclaration> = emptyList(),
296295
) : CgMethod(false)
297296

298-
/**
299-
* This class represents any custom method that we may want to create in the test class.
300-
* It may be some auxilliary method that by some reason has to be inside the test class.
301-
*
302-
* Note that before there was a class CgUtilMethod (now removed) that represented util methods,
303-
* but now all util methods have been moved into a separate library
304-
* in order to make the test class cleaner.
305-
*
306-
* So, use [CgCustomMethod] only if this method absolutely has to be in the test class.
307-
* If it doesn't, consider adding your method to util methods library instead.
308-
* This library sources can be found in the module `utbot-codegen-utils`.
309-
*/
310-
class CgCustomMethod(
311-
override val name: String,
312-
override val returnType: ClassId,
313-
override val parameters: List<CgParameterDeclaration>,
314-
override val statements: List<CgStatement>,
315-
override val exceptions: Set<ClassId>,
316-
override val annotations: List<CgAnnotation>,
317-
isStatic: Boolean,
318-
override val documentation: CgDocumentationComment = CgDocumentationComment(emptyList()),
319-
override val requiredFields: List<CgParameterDeclaration> = emptyList(),
320-
) : CgMethod(isStatic)
321-
322297
class CgErrorTestMethod(
323298
override val name: String,
324299
override val statements: List<CgStatement>,

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/visitor/CgAbstractRenderer.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import org.utbot.framework.codegen.model.tree.CgCommentedAnnotation
2222
import org.utbot.framework.codegen.model.tree.CgComparison
2323
import org.utbot.framework.codegen.model.tree.CgContinueStatement
2424
import org.utbot.framework.codegen.model.tree.CgCustomTagStatement
25-
import org.utbot.framework.codegen.model.tree.CgCustomMethod
2625
import org.utbot.framework.codegen.model.tree.CgDeclaration
2726
import org.utbot.framework.codegen.model.tree.CgDecrement
2827
import org.utbot.framework.codegen.model.tree.CgDoWhileLoop
@@ -230,7 +229,7 @@ internal abstract class CgAbstractRenderer(
230229
}
231230

232231
override fun visit(element: CgAuxiliaryClass) {
233-
context.outerMostTestClass
232+
context.generatedClass
234233
.auxiliaryClassById(element.id, context)
235234
.split("\n")
236235
.forEach { line -> println(line) }
@@ -259,12 +258,6 @@ internal abstract class CgAbstractRenderer(
259258
visit(element as CgMethod)
260259
}
261260

262-
override fun visit(element: CgCustomMethod) {
263-
renderMethodDocumentation(element)
264-
// for (annotation in element.annotations)
265-
// TODO
266-
}
267-
268261
override fun visit(element: CgErrorTestMethod) {
269262
renderMethodDocumentation(element)
270263
renderMethodSignature(element)

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/visitor/CgVisitor.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import org.utbot.framework.codegen.model.tree.CgCommentedAnnotation
1919
import org.utbot.framework.codegen.model.tree.CgComparison
2020
import org.utbot.framework.codegen.model.tree.CgConstructorCall
2121
import org.utbot.framework.codegen.model.tree.CgContinueStatement
22-
import org.utbot.framework.codegen.model.tree.CgCustomMethod
2322
import org.utbot.framework.codegen.model.tree.CgDeclaration
2423
import org.utbot.framework.codegen.model.tree.CgDecrement
2524
import org.utbot.framework.codegen.model.tree.CgDoWhileLoop
@@ -118,7 +117,6 @@ interface CgVisitor<R> {
118117
// Methods
119118
fun visit(element: CgMethod): R
120119
fun visit(element: CgTestMethod): R
121-
fun visit(element: CgCustomMethod): R
122120
fun visit(element: CgErrorTestMethod): R
123121
fun visit(element: CgParameterizedTestDataProviderMethod): R
124122

0 commit comments

Comments
 (0)