[java-intentions] ChangeMethodSignatureFromUsageFix: better handling of annotations

GitOrigin-RevId: b4de4a64ff488b167352bac2172c9df55836b819
This commit is contained in:
Tagir Valeev
2022-07-28 13:34:38 +02:00
committed by intellij-monorepo-bot
parent 90705bd897
commit 2c3779a08a
4 changed files with 47 additions and 8 deletions

View File

@@ -0,0 +1,18 @@
// "Change 2nd parameter of method 'f' from 'Integer' to 'String'" "true-preview"
import java.lang.annotation.*;
class A {
void f(@Anno @Anno2 @Anno3 String s, String i) {}
public void foo() {
f("s", "x");
}
@Target({ElementType.PARAMETER, ElementType.TYPE_USE})
@interface Anno {}
@Target({ElementType.TYPE_USE})
@interface Anno2 {}
@Target({ElementType.PARAMETER})
@interface Anno3 {}
}

View File

@@ -0,0 +1,18 @@
// "Change 2nd parameter of method 'f' from 'Integer' to 'String'" "true-preview"
import java.lang.annotation.*;
class A {
void f(@Anno @Anno2 @Anno3 String s, @Anno Integer i) {}
public void foo() {
<caret>f("s", "x");
}
@Target({ElementType.PARAMETER, ElementType.TYPE_USE})
@interface Anno {}
@Target({ElementType.TYPE_USE})
@interface Anno2 {}
@Target({ElementType.PARAMETER})
@interface Anno3 {}
}

View File

@@ -0,0 +1 @@
void f(@Anno @Anno2 @Anno3 String s, String i) {}