J2K: convert protected member used outside of inheritors as public
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package test;
|
||||
|
||||
public class BaseProtectedConstructor {
|
||||
protected void usageInConstructor() {
|
||||
|
||||
}
|
||||
|
||||
protected int usageInPropertyInitializer() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
protected void usageInStaticInit() {
|
||||
|
||||
}
|
||||
|
||||
protected void usageInMethod() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class DerivedSamePackage {
|
||||
DerivedSamePackage() {
|
||||
new BaseProtectedConstructor().usageInConstructor();
|
||||
}
|
||||
|
||||
private int i = new BaseProtectedConstructor().usageInPropertyInitializer();
|
||||
|
||||
static {
|
||||
new BaseProtectedConstructor().usageInStaticInit();
|
||||
}
|
||||
|
||||
void usage() {
|
||||
new BaseProtectedConstructor().usageInMethod();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user