File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
utbot-framework/src/main/kotlin/org/utbot/framework/concrete
utbot-instrumentation/src/main/kotlin/org/utbot/instrumentation/instrumentation/mock Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
1
package org.utbot.framework.concrete
2
2
3
- import org.utbot.framework.plugin.api.util.signature
4
3
import java.lang.reflect.Method
5
4
import java.util.IdentityHashMap
5
+ import org.objectweb.asm.Type
6
+ import org.utbot.framework.plugin.api.util.signature
6
7
7
8
/* *
8
9
* Some information, which is computed after classes instrumentation.
@@ -66,7 +67,9 @@ class InstrumentationContext {
66
67
}
67
68
68
69
fun updateMocks (obj : Any? , method : Method , values : List <* >) {
69
- updateMocks(obj, method.signature, values)
70
+ val type = Type .getInternalName(method.declaringClass)
71
+ val signature = method.signature
72
+ updateMocks(obj, " $type @$signature " , values)
70
73
}
71
74
}
72
75
}
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import org.utbot.instrumentation.instrumentation.mock.MockConfig
6
6
import java.lang.reflect.Field
7
7
import java.lang.reflect.Method
8
8
import java.lang.reflect.Modifier
9
+ import org.objectweb.asm.Type
9
10
10
11
11
12
/* *
@@ -31,7 +32,9 @@ class MethodMockController(
31
32
error(" $method is an instance method, but instance is null!" )
32
33
}
33
34
34
- val id = instrumentationContext.methodSignatureToId[method.signature]
35
+ val type = Type .getInternalName(method.declaringClass)
36
+ val computedSignature = " $type @${method.signature} "
37
+ val id = instrumentationContext.methodSignatureToId[computedSignature]
35
38
36
39
isMockField = clazz.declaredFields.firstOrNull { it.name == MockConfig .IS_MOCK_FIELD + id }
37
40
? : error(" No field ${MockConfig .IS_MOCK_FIELD + id} in $clazz " )
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ class MockClassVisitor(
73
73
val isStatic = access and Opcodes .ACC_STATIC != 0
74
74
val isVoidMethod = Type .getReturnType(descriptor) == Type .VOID_TYPE
75
75
76
- val computedSignature = name + descriptor
76
+ val computedSignature = " $internalClassName @ $ name$ descriptor"
77
77
val id = signatureToId.size
78
78
signatureToId[computedSignature] = id
79
79
You can’t perform that action at this time.
0 commit comments