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:
Valentin Kipyatkov
2015-08-11 19:07:10 +03:00
parent 671b9f5d56
commit e66d0f71ac
9 changed files with 204 additions and 95 deletions
+3
View File
@@ -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()
}
}
@@ -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();
}
}
@@ -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()
}
}