Explicit this inspection: suggest also for synthetic Java property

So #KT-22089 Fixed
This commit is contained in:
Toshiaki Kameyama
2018-05-22 11:25:26 +03:00
committed by Mikhail Glukhikh
parent 6b37e40f99
commit 4038d4d507
14 changed files with 159 additions and 5 deletions
@@ -0,0 +1,11 @@
public class Foo {
private String s;
public String getS() {
return s;
}
public void setS(String s) {
this.s = s;
}
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun test1() {
Foo().apply {
<caret>this.s = ""
}
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun test1() {
Foo().apply {
<caret>s = ""
}
}
@@ -0,0 +1,23 @@
public class Foo {
private boolean isB;
public boolean isB() {
return isB;
}
public void setB(boolean b) {
isB = b;
}
}
public class Bar {
private boolean isB;
public boolean isB() {
return isB;
}
public void setB(boolean b) {
isB = b;
}
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
// PROBLEM: none
fun test() {
Foo().apply {
Bar().run {
<caret>this@apply.isB = true
}
}
}
@@ -0,0 +1,11 @@
public class Foo {
private boolean isB;
public boolean isB() {
return isB;
}
public void setB(boolean b) {
isB = b;
}
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
// PROBLEM: none
fun test() {
Foo().apply {
Foo().run {
<caret>this@apply.isB = true
}
}
}
@@ -0,0 +1,11 @@
public class Foo {
private boolean isB;
public boolean isB() {
return isB;
}
public void setB(boolean b) {
isB = b;
}
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun test() {
Foo().apply {
<caret>this.isB = true
}
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun test() {
Foo().apply {
<caret>isB = true
}
}
@@ -0,0 +1,11 @@
public class Foo {
private boolean isB;
public boolean isB() {
return isB;
}
public void setB(boolean b) {
isB = b;
}
}
@@ -0,0 +1,11 @@
// WITH_RUNTIME
// PROBLEM: none
fun test() {
val isB = true
Foo().apply {
<caret>this.isB = true
}
}