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
22
33import org.utbot.framework.plugin.api.ClassId
44import org.utbot.framework.plugin.api.util.id
5+ import org.utbot.framework.plugin.api.util.isArray
56
67/* *
78 * For now we will count class accessible if it is:
@@ -13,13 +14,19 @@ import org.utbot.framework.plugin.api.util.id
1314 * @param packageName name of the package we check accessibility from
1415 */
1516infix 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
2020 }
2121
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+ }
2326
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+ }
2532}
You can’t perform that action at this time.
0 commit comments