File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/util Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -653,6 +653,9 @@ open class ClassId(
653653
654654 open val packageName: String get() = jClass.`package`?.name ? : " " // empty package for primitives
655655
656+ open val isInDefaultPackage: Boolean
657+ get() = packageName.isEmpty()
658+
656659 open val isPublic: Boolean
657660 get() = Modifier .isPublic(jClass.modifiers)
658661
Original file line number Diff line number Diff line change @@ -169,6 +169,8 @@ internal fun CgContextOwner.importIfNeeded(type: ClassId) {
169169 .takeIf { (it.isRefType && it.packageName != testClassPackageName && it.packageName != " java.lang" ) || it.isNested }
170170 // we cannot import inaccessible classes (builtin classes like JUnit are accessible here because they are public)
171171 ?.takeIf { it.isAccessibleFrom(testClassPackageName) }
172+ // don't import classes from default package
173+ ?.takeIf { ! it.isInDefaultPackage }
172174 // cannot import anonymous classes
173175 ?.takeIf { ! it.isAnonymous }
174176 // do not import if there is a simple name clash
You can’t perform that action at this time.
0 commit comments