-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This change improves the Javadoc generation behavior of the "Make Static" refactoring and aligns it with other refactorings such as "Change Method Signature". It ensures that generated parameter tags are inserted at proper positions within an existing Javadoc comment. The tag for the parameter itself is added as the first parameter tag, following any author or version tags. The tags for potential type parameters are added as the last parameter tags, preceding any other tags than author or version. The reused functionality from ChangeMethodSignatureRefactoringContribution is factored out to the JavadocUtil class. Fixes #1043
- Loading branch information
1 parent
5e0f474
commit 36a9f78
Showing
8 changed files
with
182 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...i.tests.refactoring/resources/MakeStatic/testJavaDocInsertBetweenExistingTags/in/Foo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class Foo<A> { | ||
|
||
int j; | ||
|
||
/** | ||
* Some documentation ... | ||
* | ||
* @author someone | ||
* @see Object#equals(Object) | ||
* @throws IllegalArgumentException | ||
*/ | ||
private void bar() throws IllegalArgumentException { | ||
this.j= 0; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
....tests.refactoring/resources/MakeStatic/testJavaDocInsertBetweenExistingTags/out/Foo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class Foo<A> { | ||
|
||
int j; | ||
|
||
/** | ||
* Some documentation ... | ||
* | ||
* @author someone | ||
* @param foo | ||
* @param <A> | ||
* @see Object#equals(Object) | ||
* @throws IllegalArgumentException | ||
*/ | ||
private static <A> void bar(Foo<A> foo) throws IllegalArgumentException { | ||
foo.j= 0; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...ui.tests.refactoring/resources/MakeStatic/testJavaDocShuffledTagsWithGenerics/in/Foo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class Foo<A, B extends Runnable> { | ||
|
||
int j; | ||
|
||
/** | ||
* Some documentation ... | ||
* | ||
* @author someone | ||
* @param value1 | ||
* @return empty string | ||
* @param value2 | ||
* @param value3 | ||
* @see Object#equals(Object) | ||
* @param <T> | ||
* @param <Z> | ||
* @throws IllegalArgumentException | ||
*/ | ||
private <T, Z> String bar(T value1, T value2, Z value3) throws IllegalArgumentException { | ||
this.j= 0; | ||
return ""; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...i.tests.refactoring/resources/MakeStatic/testJavaDocShuffledTagsWithGenerics/out/Foo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
class Foo<A, B extends Runnable> { | ||
|
||
int j; | ||
|
||
/** | ||
* Some documentation ... | ||
* | ||
* @author someone | ||
* @param foo | ||
* @param value1 | ||
* @return empty string | ||
* @param value2 | ||
* @param value3 | ||
* @see Object#equals(Object) | ||
* @param <T> | ||
* @param <Z> | ||
* @param <A> | ||
* @param <B> | ||
* @throws IllegalArgumentException | ||
*/ | ||
private static <T, Z, A, B extends Runnable> String bar(Foo<A, B> foo, T value1, T value2, Z value3) throws IllegalArgumentException { | ||
foo.j= 0; | ||
return ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters