change signature: reorder params with javadoc without * (IDEA-110332)

This commit is contained in:
anna
2013-07-16 12:30:05 +02:00
parent 8a15ea45ab
commit 58e9f5ffd8
4 changed files with 36 additions and 1 deletions
@@ -1137,7 +1137,7 @@ public class RefactoringUtil {
paramTag.delete();
}
for (PsiDocTag psiDocTag : newTags) {
anchor = docComment.addAfter(psiDocTag, anchor);
anchor = anchor != null && anchor.isValid() ? docComment.addAfter(psiDocTag, anchor) : docComment.add(psiDocTag);
}
}
@@ -0,0 +1,14 @@
class X {
/**
* Has a method called {@link #mymethod(int, int)}.
*/
public class TestRefactorLink {
/**
@return nothing
@param y yparam
@param z zparam
*/
public void <caret>mymethod(int y, int z) { }
}
}
@@ -0,0 +1,14 @@
class X {
/**
* Has a method called {@link #mymethod(int, int)}.
*/
public class TestRefactorLink {
/**
@return nothing
* @param z zparam
* @param y yparam
*/
public void mymethod(int z, int y) { }
}
}
@@ -155,6 +155,13 @@ public class ChangeSignatureTest extends LightRefactoringTestCase {
}, false);
}
public void testParamJavadoc0() throws Exception {
doTest(null, new ParameterInfoImpl[] {
new ParameterInfoImpl(1, "z", PsiType.INT),
new ParameterInfoImpl(0, "y", PsiType.INT)
}, false);
}
public void testParamJavadoc1() throws Exception {
doTest(null, new ParameterInfoImpl[]{
new ParameterInfoImpl(0, "z", PsiType.BOOLEAN)