File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
utbot-framework/src/main/kotlin/org/utbot/framework/plugin/sarif Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
1
package org.utbot.framework.plugin.sarif
2
2
3
3
import org.utbot.framework.plugin.api.UtMethod
4
+ import org.utbot.framework.plugin.api.util.executableId
4
5
import java.io.File
5
6
import kotlin.reflect.KCallable
6
7
import kotlin.reflect.KClass
7
- import kotlin.reflect.KVisibility
8
8
import kotlin.reflect.jvm.kotlinFunction
9
9
10
10
/* *
@@ -22,15 +22,16 @@ data class TargetClassWrapper(
22
22
* Returns the methods of the class [classUnderTest] declared by the user.
23
23
*/
24
24
val targetMethods: List <UtMethod <* >> = run {
25
- val declaredMethods = classUnderTest.java.declaredMethods.map {
26
- UtMethod (it.kotlinFunction as KCallable <* >, classUnderTest)
27
- }
28
- if (testPrivateMethods) {
29
- declaredMethods
25
+ val allDeclaredMethods = classUnderTest.java.declaredMethods
26
+ val neededDeclaredMethods = if (testPrivateMethods) {
27
+ allDeclaredMethods.toList()
30
28
} else {
31
- declaredMethods .filter {
32
- it.callable.visibility != KVisibility . PRIVATE
29
+ allDeclaredMethods .filter {
30
+ ! it.executableId.isPrivate
33
31
}
34
32
}
33
+ neededDeclaredMethods.map {
34
+ UtMethod (it.kotlinFunction as KCallable <* >, classUnderTest)
35
+ }
35
36
}
36
37
}
You can’t perform that action at this time.
0 commit comments