Java: proper order of 'true' and 'false' in quick-fix name (IDEA-357973)

also fixes internationalization and the incorrect comma in the name
for "Create missing switch branches" quick-fix

GitOrigin-RevId: 16285e054447d8d15318df8889499bbbf91243a7
This commit is contained in:
Bas Leijdekkers
2024-08-20 15:30:13 +02:00
committed by intellij-monorepo-bot
parent 3d38ad9549
commit bd7f1f4270
133 changed files with 145 additions and 147 deletions

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'false', and 'true'" "true-preview"
// "Create missing branches 'true' and 'false'" "true-preview"
import java.util.List;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'false', and 'true'" "true-preview"
// "Create missing branches 'true' and 'false'" "true-preview"
import java.util.List;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'true'" "true-preview"
// "Create missing branch 'true'" "true-preview"
import java.util.List;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'false'" "true-preview"
// "Create missing branch 'false'" "true-preview"
import java.util.List;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'false'" "true-preview"
// "Create missing branch 'false'" "true-preview"
import java.util.List;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing switch branches with null branch" "true-preview"
// "Create missing and 'null' branches" "true-preview"
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'false', and 'true'" "true-preview"
// "Create missing branches 'true' and 'false'" "true-preview"
import java.util.List;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'false', and 'true'" "true-preview"
// "Create missing branches 'true' and 'false'" "true-preview"
import java.util.List;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'true'" "true-preview"
// "Create missing branch 'true'" "true-preview"
import java.util.List;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'false'" "true-preview"
// "Create missing branch 'false'" "true-preview"
import java.util.List;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'false'" "true-preview"
// "Create missing branch 'false'" "true-preview"
import java.util.List;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing switch branches with null branch" "true-preview"
// "Create missing and 'null' branches" "true-preview"
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

View File

@@ -1,4 +1,4 @@
// "Create missing switch branches with null branch" "false"
// "Create missing and 'null' branches" "false"
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<I>(I x, D y)'" "true-preview"
// "Create missing branch 'Pair<I>(I x, D y)'" "true-preview"
sealed interface I permits C, D {}
final class C implements I {}
final class D implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<Box,Box>(Box b1, Box b2)'" "true-preview"
// "Create missing branch 'Pair<Box,Box>(Box b1, Box b2)'" "true-preview"
record Rec(L1 l1) {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<Boxed,Boxed>(Box b1, Boxed b2)'" "true-preview"
// "Create missing branch 'Pair<Boxed,Boxed>(Box b1, Boxed b2)'" "true-preview"
record Pair<T, K>(T b1, K b2) {}
sealed interface Boxed permits Box, Box2 {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'PairString<Boxed>(Box2 t, String t2)'" "true-preview"
// "Create missing branch 'PairString<Boxed>(Box2 t, String t2)'" "true-preview"
sealed interface Boxed permits Box, Box2 {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'StringPair<Boxed>(String t2, Box t)'" "true-preview"
// "Create missing branch 'StringPair<Boxed>(String t2, Box t)'" "true-preview"
sealed interface Boxed permits Box, Box2 {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<I>(C y, int x)'" "true-preview"
// "Create missing branch 'Pair<I>(C y, int x)'" "true-preview"
sealed interface I permits C, D {}
final class C implements I {}
final class D implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<I>(int x, C y)'" "true-preview"
// "Create missing branch 'Pair<I>(int x, C y)'" "true-preview"
sealed interface I permits C, D {}
final class C implements I {}
final class D implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<I>(I x, C y)'" "true-preview"
// "Create missing branch 'Pair<I>(I x, C y)'" "true-preview"
sealed interface I permits C, D {}
final class C implements I {}
final class D implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<I>(C x, I y)'" "true-preview"
// "Create missing branch 'Pair<I>(C x, I y)'" "true-preview"
sealed interface I permits C, D {}
final class C implements I {}
final class D implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<I>(I x, C y)'" "true-preview"
// "Create missing branch 'Pair<I>(I x, C y)'" "true-preview"
sealed interface I permits C, D {}
final class C implements I {}
final class D implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<Boxed,Boxed>(Box b1, Boxed b2)'" "true-preview"
// "Create missing branch 'Pair<Boxed,Boxed>(Box b1, Boxed b2)'" "true-preview"
record Pair<T, K>(T b1, K b2) {
}

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'Pair(A sc1, B sc2)', and 'Pair(B sc1, A sc2)'" "true-preview"
// "Create missing branches 'Pair(A sc1, B sc2)' and 'Pair(B sc1, A sc2)'" "true-preview"
record Pair(SC sc1, SC sc2) {
}

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'Pair(A sc1, A sc2)', and 'Pair(B sc1, B sc2)'" "true-preview"
// "Create missing branches 'Pair(A sc1, A sc2)' and 'Pair(B sc1, B sc2)'" "true-preview"
record Pair(SC sc1, SC sc2) {
}

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'Pair(A sc1, B sc2)', 'Pair(A sc1, C sc2)', ..." "true-preview"
// "Create missing branches 'Pair(A sc1, B sc2)', 'Pair(A sc1, C sc2)', 'Pa..." "true-preview"
record Pair(SC sc1, SC sc2) {
}

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'Pair(A sc2, B sc3)', and 'Pair(B sc2, A sc3)'" "true-preview"
// "Create missing branches 'Pair(A sc2, B sc3)' and 'Pair(B sc2, A sc3)'" "true-preview"
record Pair(SC sc1, SC sc2) {
}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<I>(I x, D y)'" "true-preview"
// "Create missing branch 'Pair<I>(I x, D y)'" "true-preview"
sealed interface I permits C, D {}
final class C implements I {}
final class D implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<Box,Box>(Box b1, Box b2)'" "true-preview"
// "Create missing branch 'Pair<Box,Box>(Box b1, Box b2)'" "true-preview"
record Rec(L1 l1) {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<Boxed,Boxed>(Box b1, Boxed b2)'" "true-preview"
// "Create missing branch 'Pair<Boxed,Boxed>(Box b1, Boxed b2)'" "true-preview"
record Pair<T, K>(T b1, K b2) {}
sealed interface Boxed permits Box, Box2 {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'PairString<Boxed>(Box2 t, String t2)'" "true-preview"
// "Create missing branch 'PairString<Boxed>(Box2 t, String t2)'" "true-preview"
sealed interface Boxed permits Box, Box2 {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'StringPair<Boxed>(String t2, Box t)'" "true-preview"
// "Create missing branch 'StringPair<Boxed>(String t2, Box t)'" "true-preview"
sealed interface Boxed permits Box, Box2 {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<I>(C y, int x)'" "true-preview"
// "Create missing branch 'Pair<I>(C y, int x)'" "true-preview"
sealed interface I permits C, D {}
final class C implements I {}
final class D implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<I>(int x, C y)'" "true-preview"
// "Create missing branch 'Pair<I>(int x, C y)'" "true-preview"
sealed interface I permits C, D {}
final class C implements I {}
final class D implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<I>(I x, C y)'" "true-preview"
// "Create missing branch 'Pair<I>(I x, C y)'" "true-preview"
sealed interface I permits C, D {}
final class C implements I {}
final class D implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<I>(C x, I y)'" "true-preview"
// "Create missing branch 'Pair<I>(C x, I y)'" "true-preview"
sealed interface I permits C, D {}
final class C implements I {}
final class D implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<I>(I x, C y)'" "true-preview"
// "Create missing branch 'Pair<I>(I x, C y)'" "true-preview"
sealed interface I permits C, D {}
final class C implements I {}
final class D implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Pair<Boxed,Boxed>(Box b1, Boxed b2)'" "true-preview"
// "Create missing branch 'Pair<Boxed,Boxed>(Box b1, Boxed b2)'" "true-preview"
record Pair<T, K>(T b1, K b2) {
}

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'Pair(A sc1, B sc2)', and 'Pair(B sc1, A sc2)'" "true-preview"
// "Create missing branches 'Pair(A sc1, B sc2)' and 'Pair(B sc1, A sc2)'" "true-preview"
record Pair(SC sc1, SC sc2) {
}

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'Pair(A sc1, A sc2)', and 'Pair(B sc1, B sc2)'" "true-preview"
// "Create missing branches 'Pair(A sc1, A sc2)' and 'Pair(B sc1, B sc2)'" "true-preview"
record Pair(SC sc1, SC sc2) {
}

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'Pair(A sc1, B sc2)', 'Pair(A sc1, C sc2)', ..." "true-preview"
// "Create missing branches 'Pair(A sc1, B sc2)', 'Pair(A sc1, C sc2)', 'Pa..." "true-preview"
record Pair(SC sc1, SC sc2) {
}

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'Pair(A sc2, B sc3)', and 'Pair(B sc2, A sc3)'" "true-preview"
// "Create missing branches 'Pair(A sc2, B sc3)' and 'Pair(B sc2, A sc3)'" "true-preview"
record Pair(SC sc1, SC sc2) {
}

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'AA', 'AB', and 'AC'" "true-preview"
// "Create missing branches 'AA', 'AB', and 'AC'" "true-preview"
abstract sealed class A {}
final class AA extends A {}
sealed class AB extends A {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Ab'" "true-preview"
// "Create missing branch 'Ab'" "true-preview"
sealed interface A {}
sealed interface Aa extends A {}
final class Aaa implements Aa {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Sub1'" "true-preview"
// "Create missing branch 'Sub1'" "true-preview"
sealed interface I {}
sealed interface J extends I {}
final class Sub1 implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Sub1'" "true-preview"
// "Create missing branch 'Sub1'" "true-preview"
sealed interface I {}
sealed interface J extends I {}
final class Sub1 implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Sub1'" "true-preview"
// "Create missing branch 'Sub1'" "true-preview"
sealed interface I {}
final class Sub1 implements I {}
final class Sub2 implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Sub1'" "true-preview"
// "Create missing branch 'Sub1'" "true-preview"
sealed interface I {}
final class Sub1 implements I {}
final class Sub2 implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Outer.Book'" "true-preview"
// "Create missing branch 'Outer.Book'" "true-preview"
class Outer {
interface SaleItem permits Book {
}

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'AA', 'AB', and 'AC'" "true-preview"
// "Create missing branches 'AA', 'AB', and 'AC'" "true-preview"
abstract sealed class A permits AC, AA, AB {}
final class AA extends A {}
sealed class AB extends A permits ABC, ABA {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Test.Cl1'" "true-preview"
// "Create missing branch 'Test.Cl1'" "true-preview"
class Test {
interface II1{}
sealed interface II2{}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branches with null branch" "true-preview"
// "Create missing and 'null' branches" "true-preview"
import org.jetbrains.annotations.Nullable;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'Test.Bar', and 'Test.Foo'" "true-preview"
// "Create missing branches 'Test.Bar' and 'Test.Foo'" "true-preview"
import java.util.List;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'AA', 'AB', and 'AC'" "true-preview"
// "Create missing branches 'AA', 'AB', and 'AC'" "true-preview"
abstract sealed class A {}
final class AA extends A {}
sealed class AB extends A {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Ab'" "true-preview"
// "Create missing branch 'Ab'" "true-preview"
sealed interface A {}
sealed interface Aa extends A {}
final class Aaa implements Aa {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Sub1'" "true-preview"
// "Create missing branch 'Sub1'" "true-preview"
sealed interface I {}
sealed interface J extends I {}
final class Sub1 implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Sub1'" "true-preview"
// "Create missing branch 'Sub1'" "true-preview"
sealed interface I {}
sealed interface J extends I {}
final class Sub1 implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Sub1'" "true-preview"
// "Create missing branch 'Sub1'" "true-preview"
sealed interface I {}
final class Sub1 implements I {}
final class Sub2 implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Sub1'" "true-preview"
// "Create missing branch 'Sub1'" "true-preview"
sealed interface I {}
final class Sub1 implements I {}
final class Sub2 implements I {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Outer.Book'" "true-preview"
// "Create missing branch 'Outer.Book'" "true-preview"
class Outer {
interface SaleItem permits Book {
}

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'AA', 'AB', and 'AC'" "true-preview"
// "Create missing branches 'AA', 'AB', and 'AC'" "true-preview"
abstract sealed class A permits AC, AA, AB {}
final class AA extends A {}
sealed class AB extends A permits ABC, ABA {}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branch 'Test.Cl1'" "true-preview"
// "Create missing branch 'Test.Cl1'" "true-preview"
class Test {
interface II1{}
sealed interface II2{}

View File

@@ -1,4 +1,4 @@
// "Create missing switch branches with null branch" "false"
// "Create missing and 'null' branches" "false"
import org.jetbrains.annotations.NotNull;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing switch branches with null branch" "true-preview"
// "Create missing and 'null' branches" "true-preview"
import org.jetbrains.annotations.Nullable;
class Test {

View File

@@ -1,4 +1,4 @@
// "Create missing branches: 'Test.Bar', and 'Test.Foo'" "true-preview"
// "Create missing branches 'Test.Bar' and 'Test.Foo'" "true-preview"
import java.util.List;
class Test {