File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/util Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package org.utbot.framework.codegen.model.util
2
2
3
3
import org.utbot.framework.plugin.api.ClassId
4
4
import org.utbot.framework.plugin.api.util.id
5
+ import org.utbot.framework.plugin.api.util.isArray
5
6
6
7
/* *
7
8
* For now we will count class accessible if it is:
@@ -13,13 +14,19 @@ import org.utbot.framework.plugin.api.util.id
13
14
* @param packageName name of the package we check accessibility from
14
15
*/
15
16
infix fun ClassId.isAccessibleFrom (packageName : String ): Boolean {
16
- val isOuterClassAccessible = if (isNested) {
17
- outerClass!! .id.isAccessibleFrom(packageName)
18
- } else {
19
- true
17
+
18
+ if (this .isLocal || this .isSynthetic) {
19
+ return false
20
20
}
21
21
22
- val isAccessibleFromPackageByModifiers = isPublic || (this .packageName == packageName && (isPackagePrivate || isProtected))
22
+ val outerClassId = outerClass?.id
23
+ if (outerClassId != null && ! outerClassId.isAccessibleFrom(packageName)) {
24
+ return false
25
+ }
23
26
24
- return isOuterClassAccessible && isAccessibleFromPackageByModifiers && ! isLocal && ! isSynthetic
27
+ return if (this .isArray) {
28
+ elementClassId!! .isAccessibleFrom(packageName)
29
+ } else {
30
+ isPublic || (this .packageName == packageName && (isPackagePrivate || isProtected))
31
+ }
25
32
}
You can’t perform that action at this time.
0 commit comments