Skip to content

Commit 62f25ad

Browse files
committed
Avoid class initialization when we evaluate ClassId
1 parent 9f4af0b commit 62f25ad

File tree

12 files changed

+9
-5
lines changed

12 files changed

+9
-5
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jakartaVersion=3.1.0
104104
jacoDbVersion=1.4.1
105105
# TODO left outdated here to avoid exceeding GitHub packages drive space,
106106
# TODO run `gradle publishToMavenLocal -Pversion={usvmVersion}` locally in usvm project and update {usvmVersion} locally
107-
usvmVersion=comp-231124-ev
107+
usvmVersion=2811-2
108108

109109
# use latest Java 8 compaitable Spring and Spring Boot versions
110110
springVersion=5.3.28

utbot-junit-contest/src/main/kotlin/org/utbot/contest/ContestEstimator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ fun main(args: Array<String>) {
425425
// very special case when you run your project directly from IntellijIDEA omitting command line arguments
426426
if (args.isEmpty()) {
427427
processedClassesThreshold = 9999 //change to change number of classes to run
428-
val timeLimit = 20 // increase if you want to debug something
428+
val timeLimit = 30 // increase if you want to debug something
429429
val fuzzingRatio = 0.1 // sets fuzzing ratio to total test generation
430430

431431
// Uncomment it for debug purposes:
@@ -446,7 +446,7 @@ fun main(args: Array<String>) {
446446

447447
// config for SBST 2022
448448
methodFilter = null
449-
projectFilter = listOf("fastjson-1.2.50", "guava-26.0", "seata-core-0.5.0", "spoon-core-7.0.0")
449+
projectFilter = listOf("seata-core-0.5.0")
450450
// TODO usvm-sbft-merge: add if here if we want merge contest it into main
451451
tools = listOf(Tool.USVM)
452452

utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/converter/ConverterUtils.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ val JcType?.classId: ClassId
6868
get() {
6969
if (this !is JcPrimitiveType) {
7070
return runCatching {
71-
this?.replaceToBoundIfGeneric()?.toJavaClass(utContext.classLoader)?.id ?: error("Can not construct classId for $this")
71+
this
72+
?.replaceToBoundIfGeneric()
73+
?.toJavaClass(utContext.classLoader, initialize = false)
74+
?.id
75+
?: error("Can not construct classId for $this")
7276
}.getOrElse { e ->
7377
throw IllegalStateException("JcType.classId failed on ${this?.typeName}", e)
7478
}
@@ -90,7 +94,7 @@ val JcType?.classId: ClassId
9094
}
9195

9296
val JcClassOrInterface.classId: ClassId
93-
get() = this.toJavaClass(utContext.classLoader).id
97+
get() = this.toJavaClass(utContext.classLoader, initialize = false).id
9498

9599
fun TypeName.findClassId(classpath: JcClasspath): ClassId =
96100
classpath.findTypeOrNull(this.typeName)?.classId
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)