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-21 09:12:08 +00:00
committed by intellij-monorepo-bot
parent 3d38ad9549
commit bd7f1f4270
133 changed files with 145 additions and 147 deletions
@@ -2428,12 +2428,12 @@ mark.modules.as.loaded.together.fix.text=Mark ''{0}'' and ''{1}'' modules as loa
inspection.suspicious.package.private.access.description={0} is {1}, but declared in a different module ''{2}''
replace.case.default.with.default=Replace 'case default' with 'default'
replace.case.default.null.with.null.default=Replace 'case default, null' with 'case null, default'
create.default.branch.fix.family.name=Insert 'default' branch
create.null.branch.fix.family.name=Insert 'null' branch
create.default.branch.fix.family.name=Create 'default' branch
create.null.branch.fix.family.name=Create 'null' branch
create.missing.enum.switch.branches.fix.family.name=Create missing enum switch branches
create.missing.boolean.switch.branches.fix.family.name=Create missing boolean switch branches
create.missing.sealed.class.switch.branches.fix.family.name=Create missing sealed class switch branches
create.missing.branches.with.null.branch.fix.family.name=Create missing switch branches with null branch
create.missing.branches.with.null.branch.fix.family.name=Create missing and 'null' branches
create.missing.record.deconstructions.switch.branches.fix.family.name=Create missing record deconstruction switch branches
unnecessary.fully.qualified.name.fix.family.name=Replace fully qualified name
return.of.collection.field.fix.family.name=Make return collection 'unmodifiable'
@@ -2488,8 +2488,8 @@ inspection.collection.must.have.initial.capacity.initializers.option=Don't repor
utility.class.without.private.constructor.cant.generate.constructor.message=Utility class has instantiations, private constructor will not be created
inspection.suspicious.package.private.access.problem={0} overrides a package-private method from {1} which is declared in a different module ''{2}''
inspection.condition.covered.by.further.condition.descr=Condition ''{0}'' covered by subsequent {1, choice, 1#condition ''''{2}''''|2#conditions}
create.missing.switch.branch=Create missing switch branch ''{0}''
create.missing.switch.branches=Create missing branches: {0}
create.missing.switch.branch=Create missing branch {0}
create.missing.switch.branches=Create missing branches {0}
redundant.as.list.for.iteration.problem=Unnecessary 'Arrays.asList()' call
redundant.as.list.for.iteration.fix.name=Unwrap
assert.with.side.effects.call.mutates.expression=call to ''{0}()'' mutates ''{1}''
@@ -1,4 +1,4 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInsight.daemon.impl.analysis;
import com.intellij.codeInsight.daemon.JavaErrorBundle;
@@ -24,6 +24,7 @@ import com.siyeh.ig.psiutils.SwitchUtils;
import one.util.streamex.StreamEx;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.PropertyKey;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -375,7 +376,7 @@ public class SwitchBlockHighlightingModel {
HighlightInfo.Builder info = createCompletenessInfoForSwitch(hasElements);
if (!missingConstants.isEmpty() && getSwitchSelectorKind() == SelectorKind.ENUM) {
IntentionAction enumBranchesFix =
getFixFactory().createAddMissingEnumBranchesFix(myBlock, ContainerUtil.map2Set(missingConstants, PsiField::getName));
getFixFactory().createAddMissingEnumBranchesFix(myBlock, ContainerUtil.map2LinkedSet(missingConstants, PsiField::getName));
IntentionAction fix = PriorityIntentionActionWrapper.highPriority(enumBranchesFix);
info.registerFix(fix, null, null, null, null);
}
@@ -395,7 +396,7 @@ public class SwitchBlockHighlightingModel {
@NotNull
HighlightInfo.Builder createCompletenessInfoForSwitch(boolean hasAnyCaseLabels) {
String messageKey;
@PropertyKey(resourceBundle = JavaErrorBundle.BUNDLE) String messageKey;
boolean isSwitchExpr = myBlock instanceof PsiExpression;
if (hasAnyCaseLabels) {
messageKey = isSwitchExpr ? "switch.expr.incomplete" : "switch.statement.incomplete";
@@ -53,7 +53,7 @@ public final class CreateMissingBooleanPrimitiveBranchesFix extends CreateMissin
}
}
if (missed.isEmpty()) return null;
return new CreateMissingBooleanPrimitiveBranchesFix(block, new HashSet<>(missed));
return new CreateMissingBooleanPrimitiveBranchesFix(block, new LinkedHashSet<>(missed));
}
@Nullable
@@ -21,7 +21,7 @@ public abstract class CreateMissingSwitchBranchesFix extends BaseSwitchFix {
@Override
protected String getText(@NotNull PsiSwitchBlock switchBlock) {
return CreateSwitchBranchesUtil.getActionName(myNames.stream().sorted().toList());
return CreateSwitchBranchesUtil.getActionName(myNames);
}
@Override
@@ -2,6 +2,7 @@
package com.siyeh.ig.psiutils;
import com.intellij.codeInsight.template.impl.ConstantNode;
import com.intellij.ide.nls.NlsMessages;
import com.intellij.modcommand.ModPsiUpdater;
import com.intellij.modcommand.ModTemplateBuilder;
import com.intellij.openapi.util.Couple;
@@ -14,7 +15,6 @@ import com.intellij.psi.util.PsiUtil;
import com.intellij.util.ObjectUtils;
import com.intellij.util.containers.ContainerUtil;
import com.siyeh.InspectionGadgetsBundle;
import one.util.streamex.Joining;
import one.util.streamex.StreamEx;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
@@ -29,20 +29,17 @@ public final class CreateSwitchBranchesUtil {
* @return a name of the action which creates missing switch branches.
*/
public static @NotNull @Nls String getActionName(Collection<String> names) {
if (names.size() == 1) {
return InspectionGadgetsBundle.message("create.missing.switch.branch",
StreamEx.of(names).collect(Joining.with("").maxChars(50).cutAfterDelimiter()));
}
return InspectionGadgetsBundle.message("create.missing.switch.branches", formatMissingBranches(names));
return InspectionGadgetsBundle.message(names.size() == 1 ? "create.missing.switch.branch" : "create.missing.switch.branches",
formatMissingBranches(names));
}
/**
* @param names names of individual branches to create (non-empty)
* @return a string which contains all the names (probably abbreviated if too long)
* @return a string which contains all the names (abbreviated if too long)
*/
public static String formatMissingBranches(Collection<String> names) {
return StreamEx.of(names).map(name -> name.startsWith("'") || name.startsWith("\"") ? name : "'" + name + "'").mapLast("and "::concat)
.collect(Joining.with(", ").maxChars(50).cutAfterDelimiter());
names = ContainerUtil.map(names, name -> name.startsWith("'") || name.startsWith("\"") ? name : "'" + name + "'");
return StringUtil.shortenTextWithEllipsis(NlsMessages.formatAndList(names), 50, 0);
}
/**
@@ -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 {
@@ -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 {
@@ -1,4 +1,4 @@
// "Create missing switch branch 'true'" "true-preview"
// "Create missing branch 'true'" "true-preview"
import java.util.List;
class Test {
@@ -1,4 +1,4 @@
// "Create missing switch branch 'false'" "true-preview"
// "Create missing branch 'false'" "true-preview"
import java.util.List;
class Test {
@@ -1,4 +1,4 @@
// "Create missing switch branch 'false'" "true-preview"
// "Create missing branch 'false'" "true-preview"
import java.util.List;
class Test {
@@ -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;
@@ -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 {
@@ -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 {
@@ -1,4 +1,4 @@
// "Create missing switch branch 'true'" "true-preview"
// "Create missing branch 'true'" "true-preview"
import java.util.List;
class Test {
@@ -1,4 +1,4 @@
// "Create missing switch branch 'false'" "true-preview"
// "Create missing branch 'false'" "true-preview"
import java.util.List;
class Test {
@@ -1,4 +1,4 @@
// "Create missing switch branch 'false'" "true-preview"
// "Create missing branch 'false'" "true-preview"
import java.util.List;
class Test {
@@ -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;
@@ -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;
@@ -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 {}
@@ -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) {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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) {
}
@@ -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) {
}
@@ -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) {
}
@@ -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) {
}
@@ -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) {
}
@@ -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 {}
@@ -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) {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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) {
}
@@ -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) {
}
@@ -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) {
}
@@ -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) {
}
@@ -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) {
}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {
}
@@ -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 {}
@@ -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{}
@@ -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 {
@@ -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 {
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {}
@@ -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 {
}
@@ -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 {}
@@ -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{}
@@ -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 {
@@ -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 {
@@ -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 {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
void test(int i, int j) {
switch(i=j) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
void test(int i) {
switch(i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
void test(int i) {
switch(i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
int test(int i) {
return switch(i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
void test(int i, int j) {
switch(i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
void test(int i) {
switch(i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
void test(int i) {
switch(i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
void test(int i, int j) {
switch(i=j) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
void test(int i) {
switch(i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
void test(int i) {
switch(i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
int test(int i) {
return switch(<caret>i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "false"
// "Create 'default' branch" "false"
class X {
void test(int i) {
switch(i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "false"
// "Create 'default' branch" "false"
class X {
void test(int i, int j) {
switch(i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
void test(int i, int j) {
switch(i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
void test(int i) {
switch(i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class X {
void test(int i) {
switch(i) {
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class Test {
void test(Day d) {
switch (d){
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class Test {
void test(I i) {
switch (i){
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class Test {
void test(Day d) {
switch (<caret>d){
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "true"
// "Create 'default' branch" "true"
class Test {
void test(I i) {
switch (<caret>i){
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "false"
// "Create 'default' branch" "false"
class Test {
void test(Day d) {
switch (<caret>d){
@@ -1,4 +1,4 @@
// "Insert 'default' branch" "false"
// "Create 'default' branch" "false"
class Test {
void test(I i) {
switch (<caret>i){
@@ -1,4 +1,4 @@
// "Create missing switch branch 'ERROR'" "true"
// "Create missing branch 'ERROR'" "true"
package com.siyeh.ipp.enumswitch;
class Main {
@@ -1,4 +1,4 @@
// "Create missing switch branch 'ERROR'" "true"
// "Create missing branch 'ERROR'" "true"
package com.siyeh.ipp.enumswitch;
class BeforeDefault {
@@ -1,4 +1,4 @@
// "Create missing switch branch 'ERROR'" "true"
// "Create missing branch 'ERROR'" "true"
class BeforeDefault {
enum Status { ACTIVE, INACTIVE, ERROR }
@@ -1,4 +1,4 @@
// "Create missing branches: 'B', and 'D'" "true"
// "Create missing branches 'B' and 'D'" "true"
enum Foo { A, B, C, D, E }
class Test {
@@ -1,4 +1,4 @@
// "Create missing branches: 'B', and 'D'" "true"
// "Create missing branches 'B' and 'D'" "true"
enum Foo { A, B, C, D, E }
class Test {
@@ -1,4 +1,4 @@
// "Create missing switch branch 'INACTIVE'" "true"
// "Create missing branch 'INACTIVE'" "true"
package com.siyeh.ipp.enumswitch;
class BeforeDefault {
@@ -1,4 +1,4 @@
// "Create missing branches: 'A', 'B', 'C', 'D', 'E', and 'F'" "true"
// "Create missing branches 'A', 'B', 'C', 'D', 'E', and 'F'" "true"
package com.siyeh.ipp.enumswitch;
class BeforeDefault {

Some files were not shown because too many files have changed in this diff Show More