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 11package org.utbot.framework.plugin.sarif
22
33import org.utbot.framework.plugin.api.UtMethod
4+ import org.utbot.framework.plugin.api.util.executableId
45import java.io.File
56import kotlin.reflect.KCallable
67import kotlin.reflect.KClass
7- import kotlin.reflect.KVisibility
88import kotlin.reflect.jvm.kotlinFunction
99
1010/* *
@@ -22,15 +22,16 @@ data class TargetClassWrapper(
2222 * Returns the methods of the class [classUnderTest] declared by the user.
2323 */
2424 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()
3028 } else {
31- declaredMethods .filter {
32- it.callable.visibility != KVisibility . PRIVATE
29+ allDeclaredMethods .filter {
30+ ! it.executableId.isPrivate
3331 }
3432 }
33+ neededDeclaredMethods.map {
34+ UtMethod (it.kotlinFunction as KCallable <* >, classUnderTest)
35+ }
3536 }
3637}
You can’t perform that action at this time.
0 commit comments