J2K: convert protected member used outside of inheritors as public
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package test;
|
||||
|
||||
public class BaseOtherPackage {
|
||||
protected BaseOtherPackage() {
|
||||
|
||||
}
|
||||
|
||||
protected void foo() {
|
||||
|
||||
}
|
||||
|
||||
protected int i = 1;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package test
|
||||
|
||||
open class BaseOtherPackage protected constructor() {
|
||||
|
||||
protected fun foo() {
|
||||
|
||||
}
|
||||
|
||||
protected var i = 1
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package test2;
|
||||
|
||||
import test.*;
|
||||
|
||||
public class DerivedOtherPackage extends BaseOtherPackage {
|
||||
public void usage1() {
|
||||
BaseOtherPackage base = new BaseOtherPackage();
|
||||
base.foo();
|
||||
int i = base.i;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package test2
|
||||
|
||||
import test.*
|
||||
|
||||
class DerivedOtherPackage : BaseOtherPackage() {
|
||||
fun usage1() {
|
||||
val base = BaseOtherPackage()
|
||||
base.foo()
|
||||
val i = base.i
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package test3
|
||||
|
||||
import test.*
|
||||
|
||||
class DerivedOtherPackageKotlin : BaseOtherPackage() {
|
||||
fun usage1() {
|
||||
val base = BaseOtherPackage()
|
||||
base.foo()
|
||||
val i = base.i
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package test3
|
||||
|
||||
import test.*
|
||||
|
||||
class DerivedOtherPackageKotlin : BaseOtherPackage() {
|
||||
fun usage1() {
|
||||
val base = BaseOtherPackage()
|
||||
base.foo()
|
||||
val i = base.i
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user