Implemented more general scheme of post-processing with intentions in J2K + added replacement of get/set with property access there
This commit is contained in:
Vendored
+3
@@ -49,6 +49,9 @@ public enum E {
|
||||
|
||||
public class Base {
|
||||
public @Nullable String foo(@Nullable String s) { return s; }
|
||||
|
||||
public int getProperty() { return 1; }
|
||||
public void setProperty(int value) {}
|
||||
}
|
||||
|
||||
public class Derived extends Base {
|
||||
|
||||
@@ -2,7 +2,7 @@ import java.io.File
|
||||
|
||||
class C {
|
||||
fun foo(file: File): String {
|
||||
val parent = file.getParentFile() ?: return ""
|
||||
val parent = file.parentFile ?: return ""
|
||||
return parent.getName()
|
||||
}
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import javaApi.Base;
|
||||
|
||||
class C extends Base {
|
||||
public void f() {
|
||||
Base other = Base();
|
||||
int value = other.getProperty() + getProperty();
|
||||
other.setProperty(1);
|
||||
setProperty(other.getProperty() + value);
|
||||
getBase(getProperty()).setProperty(0);
|
||||
}
|
||||
|
||||
private Base getBase(int i) {
|
||||
return new Base();
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import javaApi.Base
|
||||
|
||||
class C : Base() {
|
||||
public fun f() {
|
||||
val other = Base()
|
||||
val value = other.property + property
|
||||
other.property = 1
|
||||
property = other.property + value
|
||||
getBase(property).property = 0
|
||||
}
|
||||
|
||||
private fun getBase(i: Int): Base {
|
||||
return Base()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user