|
|
@ -57,11 +57,6 @@ class VisibilityTransformer @Inject constructor(private val profile: Profile) : |
|
|
|
classAccess: Int, |
|
|
|
classAccess: Int, |
|
|
|
access: Int |
|
|
|
access: Int |
|
|
|
): Int { |
|
|
|
): Int { |
|
|
|
if (classAccess and Opcodes.ACC_INTERFACE != 0) { |
|
|
|
|
|
|
|
// interface members are always public |
|
|
|
|
|
|
|
return Opcodes.ACC_PUBLIC |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val method = Type.getType(member.desc).sort == Type.METHOD |
|
|
|
val method = Type.getType(member.desc).sort == Type.METHOD |
|
|
|
if (method) { |
|
|
|
if (method) { |
|
|
|
if (member.name == "<clinit>") { |
|
|
|
if (member.name == "<clinit>") { |
|
|
@ -81,6 +76,11 @@ class VisibilityTransformer @Inject constructor(private val profile: Profile) : |
|
|
|
val partitionReferences = references[partition] |
|
|
|
val partitionReferences = references[partition] |
|
|
|
val partitionOwners = partition.mapTo(mutableSetOf(), MemberRef::owner) |
|
|
|
val partitionOwners = partition.mapTo(mutableSetOf(), MemberRef::owner) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val declaredByInterface = partitionOwners.any { classPath[it]!!.`interface` } |
|
|
|
|
|
|
|
if (declaredByInterface) { |
|
|
|
|
|
|
|
return Opcodes.ACC_PUBLIC |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// pick the weakest access level based on references in our own code |
|
|
|
// pick the weakest access level based on references in our own code |
|
|
|
val visibility = when { |
|
|
|
val visibility = when { |
|
|
|
partitionReferences.all { it == member.owner } && !hasOverride && !abstract -> Opcodes.ACC_PRIVATE |
|
|
|
partitionReferences.all { it == member.owner } && !hasOverride && !abstract -> Opcodes.ACC_PRIVATE |
|
|
|