@@ -19,7 +19,7 @@ import org.utbot.engine.overrides.UtOverrideMock
1919import org.utbot.engine.overrides.collections.AbstractCollection
2020import org.utbot.engine.overrides.collections.AssociativeArray
2121import org.utbot.engine.overrides.collections.Collection
22- import org.utbot.engine.overrides.collections.List
22+ import org.utbot.engine.overrides.collections.List as UtList
2323import org.utbot.engine.overrides.collections.RangeModifiableUnlimitedArray
2424import org.utbot.engine.overrides.collections.UtArrayList
2525import org.utbot.engine.overrides.collections.UtGenericAssociative
@@ -58,40 +58,40 @@ object SootUtils {
5858 *
5959 * @param jdkInfo specifies the JRE and the runtime library version used for analysing system classes and user's
6060 * code.
61- * @param forceReload forces to reinitialize Soot even if the [previousBuildDir ] equals to the class buildDir.
61+ * @param forceReload forces to reinitialize Soot even if the [previousBuildDirs ] equals to the class buildDir.
6262 */
6363 fun runSoot (clazz : java.lang.Class <* >, forceReload : kotlin.Boolean , jdkInfo : JdkInfo ) {
6464 val buildDir = FileUtil .locateClassPath(clazz) ? : FileUtil .isolateClassFiles(clazz)
6565 val buildDirPath = buildDir.toPath()
6666
67- runSoot(buildDirPath, null , forceReload, jdkInfo)
67+ runSoot(listOf ( buildDirPath) , null , forceReload, jdkInfo)
6868 }
6969
7070
7171 /* *
7272 * @param jdkInfo specifies the JRE and the runtime library version used for analysing system classes and user's
7373 * code.
74- * @param forceReload forces to reinitialize Soot even if the [previousBuildDir ] equals to [buildDirPath ] and
74+ * @param forceReload forces to reinitialize Soot even if the [previousBuildDirs ] equals to [buildDirPaths ] and
7575 * [previousClassPath] equals to [classPath].
7676 */
77- fun runSoot (buildDirPath : Path , classPath : String? , forceReload : kotlin.Boolean , jdkInfo : JdkInfo ) {
77+ fun runSoot (buildDirPaths : List < Path > , classPath : String? , forceReload : kotlin.Boolean , jdkInfo : JdkInfo ) {
7878 synchronized(this ) {
79- if (buildDirPath != previousBuildDir || classPath != previousClassPath || forceReload) {
80- initSoot(buildDirPath , classPath, jdkInfo)
81- previousBuildDir = buildDirPath
79+ if (buildDirPaths != previousBuildDirs || classPath != previousClassPath || forceReload) {
80+ initSoot(buildDirPaths , classPath, jdkInfo)
81+ previousBuildDirs = buildDirPaths
8282 previousClassPath = classPath
8383 }
8484 }
8585 }
8686
87- private var previousBuildDir : Path ? = null
87+ private var previousBuildDirs : List < Path > ? = null
8888 private var previousClassPath: String? = null
8989}
9090
9191/* *
9292 * Convert code to Jimple
9393 */
94- private fun initSoot (buildDir : Path , classpath : String? , jdkInfo : JdkInfo ) {
94+ private fun initSoot (buildDirs : List < Path > , classpath : String? , jdkInfo : JdkInfo ) {
9595 G .reset()
9696 val options = Options .v()
9797
@@ -107,7 +107,7 @@ private fun initSoot(buildDir: Path, classpath: String?, jdkInfo: JdkInfo) {
107107 + if (! classpath.isNullOrEmpty()) File .pathSeparator + " $classpath " else " "
108108 )
109109 set_src_prec(Options .src_prec_only_class)
110- set_process_dir(listOf ( " $buildDir " ) )
110+ set_process_dir(buildDirs.map { " $it " } )
111111 set_keep_line_number(true )
112112 set_ignore_classpath_errors(true ) // gradle/build/resources/main does not exists, but it's not a problem
113113 set_output_format(Options .output_format_jimple)
@@ -196,7 +196,7 @@ private val classesToLoad = arrayOf(
196196 Stream ::class ,
197197 Arrays ::class ,
198198 Collection ::class ,
199- List ::class ,
199+ UtList ::class ,
200200 UtStream ::class ,
201201 UtStream .UtStreamIterator ::class
202202).map { it.java }.toTypedArray()
0 commit comments