mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
IDEA-85758 intention to replace casted var with a var of the right type and having the same value implemented
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "true"
|
||||
|
||||
import java.lang.Object;
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
FooBar foobar = (FooBar)foo;
|
||||
Object o = foobar.baz;
|
||||
foo = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "true"
|
||||
|
||||
import java.lang.Object;
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
FooBar foobar = (FooBar)foo;
|
||||
Object o = foobar.baz;
|
||||
foobar = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "true"
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
foo = null;
|
||||
FooBar foobar = (FooBar)foo;
|
||||
return foobar.baz;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "true"
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
foobar = null;
|
||||
FooBar foobar = (FooBar)foo;
|
||||
return foobar.baz;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "true"
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
FooBar foobar = (FooBar)foo;
|
||||
foobar = null;
|
||||
foo = null;
|
||||
foobar = (FooBar)foo;
|
||||
return foobar.baz;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "true"
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
FooBar foobar = (FooBar)foo;
|
||||
return foobar.baz;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar2'" "true"
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
FooBar foobar = (FooBar)foo;
|
||||
foobar = null;
|
||||
FooBar foobar2 = (FooBar)foo;
|
||||
return foobar2.baz;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "true"
|
||||
|
||||
import java.lang.Object;
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
FooBar foobar = (FooBar)foo;
|
||||
Object o = ((FooBar<caret>)foo).baz;
|
||||
foo = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "true"
|
||||
|
||||
import java.lang.Object;
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
FooBar foobar = (FooBar)foo;
|
||||
Object o = ((FooBar<caret>)foo).baz;
|
||||
foobar = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "true"
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
foo = null;
|
||||
FooBar foobar = (FooBar)foo;
|
||||
return ((FooBar<caret>)foo).baz;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "true"
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
foobar = null;
|
||||
FooBar foobar = (FooBar)foo;
|
||||
return ((FooBar<caret>)foo).baz;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "false"
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
FooBar foobar = (FooBar)foo;
|
||||
foo = null;
|
||||
return ((FooBar<caret>)foo).baz;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "true"
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
FooBar foobar = (FooBar)foo;
|
||||
foobar = null;
|
||||
foo = null;
|
||||
foobar = (FooBar)foo;
|
||||
return ((FooBar<caret>)foo).baz;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "false"
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
FooBar foobar = (FooBar)foo;
|
||||
foobar = null;
|
||||
return ((FooBar<caret>)foo).baz;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar'" "true"
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
FooBar foobar = (FooBar)foo;
|
||||
return ((FooBar<caret>)foo).baz;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace '(FooBar)foo' with 'foobar2'" "true"
|
||||
|
||||
class FooBar {
|
||||
public int baz;
|
||||
|
||||
int method(Object foo) {
|
||||
FooBar foobar = (FooBar)foo;
|
||||
foobar = null;
|
||||
FooBar foobar2 = (FooBar)foo;
|
||||
return ((FooBar<caret>)foo).baz;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user