File tree 3 files changed +44
-6
lines changed
utbot-framework/src/main/kotlin/org/utbot/engine
utbot-framework-test/src/test/kotlin/org/utbot/examples/mixed
utbot-sample/src/main/java/org/utbot/examples/mixed
3 files changed +44
-6
lines changed Original file line number Diff line number Diff line change
1
+ package org.utbot.examples.mixed
2
+
3
+ import org.junit.jupiter.api.Test
4
+ import org.utbot.framework.plugin.api.CodegenLanguage
5
+ import org.utbot.testcheckers.eq
6
+ import org.utbot.testing.DoNotCalculate
7
+ import org.utbot.testing.UtValueTestCaseChecker
8
+
9
+ internal class SerializableExampleTest : UtValueTestCaseChecker (testClass = SerializableExample : :class) {
10
+
11
+ @Test
12
+ fun testExample () {
13
+ check(
14
+ SerializableExample ::example,
15
+ eq(1 ),
16
+ )
17
+ }
18
+ }
Original file line number Diff line number Diff line change 1
1
package org.utbot.engine
2
2
3
+ import org.utbot.engine.types.OBJECT_TYPE
3
4
import org.utbot.engine.types.TypeRegistry
4
5
import org.utbot.framework.plugin.api.ClassId
5
6
import org.utbot.framework.plugin.api.id
@@ -54,14 +55,20 @@ class Hierarchy(private val typeRegistry: TypeRegistry) {
54
55
55
56
private fun findAncestors (id : ClassId ) =
56
57
with (Scene .v().getSootClass(id.name)) {
57
- if (this .isInterface) {
58
- Scene .v().activeHierarchy.getSuperinterfacesOfIncluding(this )
58
+ val superClasses = mutableListOf<SootClass >()
59
+ val superInterfaces = mutableListOf<SootClass >()
60
+
61
+ if (isInterface) {
62
+ superClasses + = OBJECT_TYPE .sootClass
63
+ superInterfaces + = Scene .v().activeHierarchy.getSuperinterfacesOfIncluding(this )
59
64
} else {
60
- Scene .v().activeHierarchy.getSuperclassesOfIncluding(this ) +
61
- this .interfaces.flatMap {
62
- Scene .v().activeHierarchy.getSuperinterfacesOfIncluding(it)
63
- }
65
+ superClasses + = Scene .v().activeHierarchy.getSuperclassesOfIncluding(this )
66
+ superInterfaces + = superClasses
67
+ .flatMap { it.interfaces }
68
+ .flatMap { Scene .v().activeHierarchy.getSuperinterfacesOfIncluding(it) }
64
69
}
70
+
71
+ superClasses + superInterfaces
65
72
}
66
73
67
74
private fun findInheritors (id : ClassId ) =
Original file line number Diff line number Diff line change
1
+ package org .utbot .examples .mixed ;
2
+
3
+ import java .io .File ;
4
+
5
+ public class SerializableExample {
6
+ public void example () {
7
+ join ("string" , File .separator , System .currentTimeMillis ());
8
+ }
9
+
10
+ public static <T > String join (T ... elements ) {
11
+ return null ;
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments