@@ -19,7 +19,7 @@ import org.utbot.engine.overrides.UtOverrideMock
19
19
import org.utbot.engine.overrides.collections.AbstractCollection
20
20
import org.utbot.engine.overrides.collections.AssociativeArray
21
21
import org.utbot.engine.overrides.collections.Collection
22
- import org.utbot.engine.overrides.collections.List
22
+ import org.utbot.engine.overrides.collections.List as UtList
23
23
import org.utbot.engine.overrides.collections.RangeModifiableUnlimitedArray
24
24
import org.utbot.engine.overrides.collections.UtArrayList
25
25
import org.utbot.engine.overrides.collections.UtGenericAssociative
@@ -58,40 +58,40 @@ object SootUtils {
58
58
*
59
59
* @param jdkInfo specifies the JRE and the runtime library version used for analysing system classes and user's
60
60
* 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.
62
62
*/
63
63
fun runSoot (clazz : java.lang.Class <* >, forceReload : kotlin.Boolean , jdkInfo : JdkInfo ) {
64
64
val buildDir = FileUtil .locateClassPath(clazz) ? : FileUtil .isolateClassFiles(clazz)
65
65
val buildDirPath = buildDir.toPath()
66
66
67
- runSoot(buildDirPath, null , forceReload, jdkInfo)
67
+ runSoot(listOf ( buildDirPath) , null , forceReload, jdkInfo)
68
68
}
69
69
70
70
71
71
/* *
72
72
* @param jdkInfo specifies the JRE and the runtime library version used for analysing system classes and user's
73
73
* 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
75
75
* [previousClassPath] equals to [classPath].
76
76
*/
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 ) {
78
78
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
82
82
previousClassPath = classPath
83
83
}
84
84
}
85
85
}
86
86
87
- private var previousBuildDir : Path ? = null
87
+ private var previousBuildDirs : List < Path > ? = null
88
88
private var previousClassPath: String? = null
89
89
}
90
90
91
91
/* *
92
92
* Convert code to Jimple
93
93
*/
94
- private fun initSoot (buildDir : Path , classpath : String? , jdkInfo : JdkInfo ) {
94
+ private fun initSoot (buildDirs : List < Path > , classpath : String? , jdkInfo : JdkInfo ) {
95
95
G .reset()
96
96
val options = Options .v()
97
97
@@ -107,7 +107,7 @@ private fun initSoot(buildDir: Path, classpath: String?, jdkInfo: JdkInfo) {
107
107
+ if (! classpath.isNullOrEmpty()) File .pathSeparator + " $classpath " else " "
108
108
)
109
109
set_src_prec(Options .src_prec_only_class)
110
- set_process_dir(listOf ( " $buildDir " ) )
110
+ set_process_dir(buildDirs.map { " $it " } )
111
111
set_keep_line_number(true )
112
112
set_ignore_classpath_errors(true ) // gradle/build/resources/main does not exists, but it's not a problem
113
113
set_output_format(Options .output_format_jimple)
@@ -196,7 +196,7 @@ private val classesToLoad = arrayOf(
196
196
Stream ::class ,
197
197
Arrays ::class ,
198
198
Collection ::class ,
199
- List ::class ,
199
+ UtList ::class ,
200
200
UtStream ::class ,
201
201
UtStream .UtStreamIterator ::class
202
202
).map { it.java }.toTypedArray()
0 commit comments