Skip to content

Commit 17cce95

Browse files
committed
Apply several fixes
1 parent bf0bbc5 commit 17cce95

File tree

2 files changed

+5
-8
lines changed
  • utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/tree
  • utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api

2 files changed

+5
-8
lines changed

utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -610,17 +610,12 @@ val Type.classId: ClassId
610610
* [elementClassId] if this class id represents an array class, then this property
611611
* represents the class id of the array's elements. Otherwise, this property is null.
612612
*/
613-
open class ClassId(
613+
open class ClassId @JvmOverloads constructor(
614614
val name: String,
615615
val elementClassId: ClassId? = null,
616616
// Treat simple class ids as non-nullable
617617
open val isNullable: Boolean = false
618618
) {
619-
/**
620-
* This constructor is for calls from Java (e.g. `UtBotJavaApiTest`),
621-
* because we cannot skip default parameters in Java.
622-
*/
623-
constructor(name: String, elementClassId: ClassId?) : this(name, elementClassId, false)
624619

625620
open val canonicalName: String
626621
get() = jClass.canonicalName ?: error("ClassId $name does not have canonical name")
@@ -759,6 +754,7 @@ class BuiltinClassId(
759754
override val simpleName: String,
760755
// by default we assume that the class is not a member class
761756
override val simpleNameWithEnclosings: String = simpleName,
757+
override val isNullable: Boolean = false,
762758
override val isPublic: Boolean = true,
763759
override val isProtected: Boolean = false,
764760
override val isPrivate: Boolean = false,
@@ -778,7 +774,7 @@ class BuiltinClassId(
778774
-1, 0 -> ""
779775
else -> canonicalName.substring(0, index)
780776
},
781-
) : ClassId(name) {
777+
) : ClassId(name = name, isNullable = isNullable) {
782778
init {
783779
BUILTIN_CLASSES_BY_NAMES[name] = this
784780
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,11 +588,12 @@ class CgNotNullAssertion(val expression: CgExpression) : CgValue {
588588
name = expressionType.name,
589589
canonicalName = expressionType.canonicalName,
590590
simpleName = expressionType.simpleName,
591+
isNullable = false,
591592
)
592593
else -> ClassId(
593594
expressionType.name,
594595
expressionType.elementClassId,
595-
isNullable = false
596+
isNullable = false,
596597
)
597598
}
598599
}

0 commit comments

Comments
 (0)