mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SortContentAction: fix warping in the middle of initializer: IDEA-185786
This commit is contained in:
@@ -375,7 +375,7 @@ public class SortContentAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
for (int rowPosition = 0; rowPosition < entryCountOnRow; rowPosition++) {
|
||||
currentEntryIndex++;
|
||||
boolean isLastInRow = rowPosition + 1 == entryCountOnRow && rowPosition + 1 != lines;
|
||||
boolean isLastInRow = rowPosition + 1 == entryCountOnRow && rowIndex + 1 != lines;
|
||||
entries.get(entryIndex).generate(sb, isLastInRow, currentEntryIndex == entryCount);
|
||||
entryIndex++;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
<body>
|
||||
Intention to sort content of array or vararg.
|
||||
<!-- tooltip end -->
|
||||
<p>This intention can sort literals (int and string) and enum constants.</p>>
|
||||
<p>This intention can sort literals (int and string) and enum constants.</p>
|
||||
<p>Inspection tries to preserve count of expression on line, but in case of comments it is not always possible.</p>
|
||||
<small>New in 2018.1</small>
|
||||
</body>
|
||||
</html>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Sort content" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
private void test() {
|
||||
String[] LAST_NAMES = new String[]{
|
||||
//A
|
||||
"Allen", "Anderson", "Brown", "Clark", "Davis", "Garcia", "Hall",
|
||||
"Harris", "Jackson", "Johnson", "Jones", "Lee", "Lewis", "Martin",
|
||||
|
||||
"Martinez", "Miller", "Moore", "Robinson", "Rodriguez", "Smith", "Taylor",
|
||||
"Thomas", "Thompson", "Walker", "White", //B
|
||||
"Williams", "Wilson", "Young"//Z
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// "Sort content" "true"
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
private void test() {
|
||||
String[] LAST_NAMES = new String[]{
|
||||
//A
|
||||
"Smith", "Johnson", "Williams", "Jones", "Brown", "Davis", "Miller",
|
||||
"Wilson", "Moore", "Taylor", "Anderson", "Thomas", "Jackson", "White",
|
||||
//B<caret>
|
||||
"Harris", "Martin", "Thompson", "Garcia", "Martinez", "Robinson", "Clark",
|
||||
"Rodriguez", "Lewis", "Lee", "Walker", "Hall", "Allen", "Young"
|
||||
//Z
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user