mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 02:09:59 +07:00
replace inaccessible field with getter/setter (IDEA-22752)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// "Replace with getter" "true"
|
||||
class Test {
|
||||
private int i;
|
||||
|
||||
public int getI() {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
void foo(Test t) {
|
||||
System.out.println(t.getI());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace with setter" "true"
|
||||
class Test {
|
||||
private int i;
|
||||
|
||||
public void setI(int i) {
|
||||
this.i = i;
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
void foo(Test t) {
|
||||
t.setI(0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Replace with getter" "true"
|
||||
import java.io.File;
|
||||
|
||||
class Foo {
|
||||
void foo(File f) {
|
||||
String ss = f.getPath();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Replace with getter" "false"
|
||||
class Test {
|
||||
private int i;
|
||||
}
|
||||
|
||||
class Foo {
|
||||
void foo(Test t) {
|
||||
System.out.println(t.<caret>i);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Replace with setter" "false"
|
||||
class Test {
|
||||
private int i;
|
||||
}
|
||||
|
||||
class Foo {
|
||||
void foo(Test t) {
|
||||
System.out.println(t.<caret>i);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace with getter" "true"
|
||||
class Test {
|
||||
private int i;
|
||||
|
||||
public int getI() {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
void foo(Test t) {
|
||||
System.out.println(t.<caret>i);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace with getter" "false"
|
||||
class Test {
|
||||
private int i;
|
||||
|
||||
public int getI() {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
void foo(Test t) {
|
||||
t.<caret>i = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace with setter" "true"
|
||||
class Test {
|
||||
private int i;
|
||||
|
||||
public void setI(int i) {
|
||||
this.i = i;
|
||||
}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
void foo(Test t) {
|
||||
t.<caret>i = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Replace with getter" "true"
|
||||
import java.io.File;
|
||||
|
||||
class Foo {
|
||||
void foo(File f) {
|
||||
String ss = f.<caret>path;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user