[java-intentions] ChangeParameterClassFix: fixes after a review

IJ-CR-101642

GitOrigin-RevId: ed911621e808a7bf1ceff70a321685df424e3ec1
This commit is contained in:
Andrey Cherkasov
2023-03-01 20:05:49 +04:00
committed by intellij-monorepo-bot
parent 4cd808e3b0
commit 36545aa244
28 changed files with 113 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
// "Make 'a' implement 'java.lang.Runnable'" "true"
// "Make 'a' implement 'java.lang.Runnable'" "true-preview"
class a implements Runnable {
void f(Runnable r) {
f(this);

View File

@@ -1,4 +1,4 @@
// "Make 'a' extend 'b'" "true"
// "Make 'a' extend 'b'" "true-preview"
class a extends b <caret>{
void f(b b, Runnable r) {
f(this, null);

View File

@@ -1,4 +1,4 @@
// "Make 'b' extend 'a'" "true"
// "Make 'b' extend 'a'" "true-preview"
class a {
void f(a a) {
b b = null;

View File

@@ -1,4 +1,4 @@
// "Make 'a' implement 'b'" "true"
// "Make 'a' implement 'b'" "true-preview"
class a implements b<String> {
void f(b<String> r) {
r.g(this);

View File

@@ -1,4 +1,4 @@
// "Make 'A' extend 'B'" "true"
// "Make 'A' extend 'B'" "true-preview"
class B {}
class A extends B {

View File

@@ -1,4 +1,4 @@
// "Make 'Foo' implement 'Foo.Bar'" "true"
// "Make 'Foo' implement 'Foo.Bar'" "true-preview"
public class Foo implements Foo.Bar {
public Bar getBar() {

View File

@@ -1,4 +1,4 @@
// "Make 'Bar' implement 'java.lang.Runnable'" "true"
// "Make 'Bar' implement 'java.lang.Runnable'" "true-preview"
abstract class Foo {
abstract Runnable foo();

View File

@@ -1,4 +1,4 @@
// "Make 'T' implement 'b'" "true"
// "Make 'T' implement 'b'" "true-preview"
class a<T extends b<String>> {
void f(b<String> r, T t) {
r.g(t);

View File

@@ -1,4 +1,4 @@
// "Make 'A' extend 'B'" "true"
// "Make 'A' extend 'B'" "true-preview"
class B {}
class A extends B {

View File

@@ -1,11 +1,11 @@
// "Make 'a' implement 'b'" "true"
// "Make 'a' implement 'b'" "true-preview"
interface b<T> {
void f(T t);
}
class a implements b<Integer> {
public void f(Integer integer) {
<caret>
}
}

View File

@@ -1,4 +1,4 @@
// "Make 'T' extend 'java.lang.Enum'" "true"
// "Make 'T' extend 'java.lang.Enum'" "true-preview"
class EnumGeneric<T extends Enum<?>> {
}

View File

@@ -1,4 +1,4 @@
// "Make 'a' implement 'java.lang.Runnable'" "true"
// "Make 'a' implement 'java.lang.Runnable'" "true-preview"
class a {
void f(Runnable r) {
f(<caret>this);

View File

@@ -1,4 +1,4 @@
// "Make 'a' extend 'b'" "true"
// "Make 'a' extend 'b'" "true-preview"
class a {
void f(b b, Runnable r) {
f(<caret>this, null);

View File

@@ -1,4 +1,4 @@
// "Make 'b' extend 'a'" "true"
// "Make 'b' extend 'a'" "true-preview"
class a {
void f(a a) {
b b = null;

View File

@@ -1,4 +1,4 @@
// "Make 'a' implement 'b'" "true"
// "Make 'a' implement 'b'" "true-preview"
class a {
void f(b<String> r) {
r.g(<caret>this);

View File

@@ -1,4 +1,4 @@
// "Make 'A' extend 'B'" "true"
// "Make 'A' extend 'B'" "true-preview"
class B {}
class A {

View File

@@ -1,4 +1,4 @@
// "Make 'Foo' implement 'Foo.Bar'" "true"
// "Make 'Foo' implement 'Foo.Bar'" "true-preview"
public class Foo {
public Bar getBar() {

View File

@@ -1,4 +1,4 @@
// "Make 'Bar' implement 'java.lang.Runnable'" "true"
// "Make 'Bar' implement 'java.lang.Runnable'" "true-preview"
abstract class Foo {
abstract Runnable foo();

View File

@@ -1,4 +1,4 @@
// "Make 'T' implement 'b'" "true"
// "Make 'T' implement 'b'" "true-preview"
class a<T> {
void f(b<String> r, T t) {
r.g(<caret>t);

View File

@@ -1,4 +1,4 @@
// "Make 'A' extend 'B'" "true"
// "Make 'A' extend 'B'" "true-preview"
class B {}
class A {

View File

@@ -1,4 +1,4 @@
// "Make 'a' implement 'b'" "true"
// "Make 'a' implement 'b'" "true-preview"
interface b<T> {
void f(T t);
}

View File

@@ -1,4 +1,4 @@
// "Make 'T' extend 'java.lang.Enum'" "true"
// "Make 'T' extend 'java.lang.Enum'" "true-preview"
class EnumGeneric<T extends Enum<?>> {
}

View File

@@ -0,0 +1,10 @@
// "Make 'a' implement 'java.lang.Runnable'" "true-preview"
class a implements Runnable {
void f(Runnable r) {
f(this);
}
public void run() {
}
}

View File

@@ -0,0 +1,13 @@
// "Make 'a' implement 'b'" "true-preview"
class a implements b<String> {
void f(b<String> r) {
r.g(this);
}
public void g(b<String> t) {
}
}
interface b<T> {
void g(b<T> t);
}

View File

@@ -0,0 +1,18 @@
// "Make 'Bar' implement 'java.lang.Runnable'" "true-preview"
abstract class Foo {
abstract Runnable foo();
}
class FooBar extends Foo {
@Override
Bar foo() {
return null;
}
static class Bar implements Runnable {
public void run() {
}
}
}

View File

@@ -0,0 +1,20 @@
// "Make 'a' implement 'b'" "true-preview"
interface b<T> {
void f(T t);
}
class a implements b<Integer> {
public void f(Integer integer) {
}
}
class X {
void h(b<? super Integer> i) {
}
void g() {
h(new a());
}
}