diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/MethodReturnTypeFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/MethodReturnTypeFix.java index cab5866539a0..4172322a5163 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/MethodReturnTypeFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/MethodReturnTypeFix.java @@ -234,7 +234,7 @@ public class MethodReturnTypeFix extends LocalQuickFixAndIntentionActionOnPsiEle false, null, myName, returnType, - RemoveUnusedParameterFix.getNewParametersInfo(method, null), + RemoveUnusedParameterFix.getNewParametersInfo(targetMethod, null), methodSignatureChangeVisitor); processor.run(); } diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/methodReturn/afterUntouchMethodParams.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/methodReturn/afterUntouchMethodParams.java new file mode 100644 index 000000000000..4ae370c44ef8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/methodReturn/afterUntouchMethodParams.java @@ -0,0 +1,11 @@ +// "Make 'f' return 'int'" "true" +interface SomeInterface { + int f(T t); +} + +class B implements SomeInterface { + @Override + public int f(String s) { + return 1; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/methodReturn/beforeUntouchMethodParams.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/methodReturn/beforeUntouchMethodParams.java new file mode 100644 index 000000000000..94ccfa5482cb --- /dev/null +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/methodReturn/beforeUntouchMethodParams.java @@ -0,0 +1,11 @@ +// "Make 'f' return 'int'" "true" +interface SomeInterface { + void f(T t); +} + +class B implements SomeInterface { + @Override + public void f(String s) { + return 1; + } +} \ No newline at end of file