-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inline method to attempt to copy over NLS comments when appropria…
…te (#1928) - change SourceProvider.getExpressionRanges() to add in comments of return statement when NLS comments are present - change CallInliner.replaceCall() to try and split the last block at a semi-colon in case it was created by a return statement that had NLS comments - if the split results in 2 segments, try and form a new statement that adds the new expression and NLS comments - add new test to InlineMethodTests - does not handle modifying existing NLS markers at target - fixes #1856
- Loading branch information
Showing
5 changed files
with
112 additions
and
25 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
11 changes: 11 additions & 0 deletions
11
...ests.refactoring/resources/InlineMethodWorkspace/TestCases/bugs_in/Test_issue_1856_1.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,11 @@ | ||
package bugs_in; | ||
|
||
public class Test_issue_1856_1 { | ||
String foo() { | ||
return "abc"; //$NON-NLS-1$ | ||
} | ||
String bar() { | ||
String result = /*]*/foo()/*[*/; | ||
return result; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...sts.refactoring/resources/InlineMethodWorkspace/TestCases/bugs_out/Test_issue_1856_1.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,11 @@ | ||
package bugs_in; | ||
|
||
public class Test_issue_1856_1 { | ||
String foo() { | ||
return "abc"; //$NON-NLS-1$ | ||
} | ||
String bar() { | ||
String result = /*]*/"abc"; //$NON-NLS-1$ | ||
return result; | ||
} | ||
} |
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