Skip to content

Commit

Permalink
Issue #919 - Fix typo in error message (#928)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarthana committed Mar 30, 2023
1 parent ad2866c commit b681dfb
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,8 @@
1902 = Illegal fall-through to a pattern
1903 = A switch label may not have more than one pattern case label element
1904 = A switch label may not have both a pattern case label element and a default case label element
1905 = A null case label and patterns cannot co-exist in the same case label.
1906 = This case label is dominated by one of the preceding case label
1905 = A null case label and patterns cannot co-exist in the same case label
1906 = This case label is dominated by one of the preceding case labels
1907 = Switch case cannot have both unconditional pattern and default label
1908 = An enhanced switch statement should be exhaustive; a default label expected
1909 = The switch statement cannot have more than one unconditional pattern
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public void test009() {
" case Rectangle(ColoredPoint(Point(int x, int y), Color c),\n" +
" ColoredPoint(Point(int x1, int y1), Color c1)) -> {\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
// Test that nested pattern variables from record patterns are in scope in the case block
Expand Down Expand Up @@ -1077,7 +1077,7 @@ public void test29() {
"1. ERROR in X.java (at line 6)\n" +
" case R(int a) -> 0;\n" +
" ^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
// Test that an identical record pattern dominates another record pattern
Expand All @@ -1100,7 +1100,7 @@ public void test30() {
"1. ERROR in X.java (at line 6)\n" +
" case R(int a) -> 0;\n" +
" ^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
// Test that a type pattern with 'when' does not dominate a record pattern of the same type
Expand Down Expand Up @@ -1215,7 +1215,7 @@ public void test33() {
"1. ERROR in X.java (at line 6)\n" +
" case ((R(int a))) -> 0;\n" +
" ^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
// Test that a parenthesized record pattern dominates an identical record pattern
Expand All @@ -1238,7 +1238,7 @@ public void test34() {
"1. ERROR in X.java (at line 6)\n" +
" case ((R(int a))) -> 0;\n" +
" ^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
// Test that pattern dominance is reported on identical nested record pattern
Expand Down Expand Up @@ -1271,7 +1271,7 @@ public void test35() {
"1. ERROR in X.java (at line 6)\n" +
" case Pair(Teacher(Object n), Student(Object n1, Integer i)) -> 1;\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
// Test that pattern dominance is reported on identical nested record pattern
Expand Down Expand Up @@ -1304,7 +1304,7 @@ public void test36() {
"1. ERROR in X.java (at line 6)\n" +
" case Pair(Teacher(Object n), Student(String n1, Integer i)) -> 1;\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
// Test that pattern dominance is reported on identical nested record pattern
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,7 @@ public void testBug574559_002() {
"1. ERROR in X.java (at line 5)\n" +
" case Integer i, 30 -> System.out.println(o);\n" +
" ^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
// Test that fall-through to a pattern is not allowed (label statement group has one statement)
Expand Down Expand Up @@ -1835,7 +1835,7 @@ public void testBug573940_2a() {
"1. ERROR in X.java (at line 5)\n" +
" case Float f :\n" +
" ^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
// Test that falling through from a pattern to a default is allowed
Expand Down Expand Up @@ -2364,7 +2364,7 @@ public void testBug574563_002() {
"1. ERROR in X.java (at line 4)\n" +
" case null, Integer i -> System.out.println(0);\n" +
" ^^^^^^^^^\n" +
"A null case label and patterns cannot co-exist in the same case label. \n" +
"A null case label and patterns cannot co-exist in the same case label\n" +
"----------\n" +
"2. ERROR in X.java (at line 9)\n" +
" Zork();\n" +
Expand Down Expand Up @@ -2416,7 +2416,7 @@ public void testBug574563_004() {
"1. ERROR in X.java (at line 4)\n" +
" case null, Integer i when i > 10 -> System.out.println(0);\n" +
" ^^^^^^^^^^^^^^^^^^^^^\n" +
"A null case label and patterns cannot co-exist in the same case label. \n" +
"A null case label and patterns cannot co-exist in the same case label\n" +
"----------\n" +
"2. ERROR in X.java (at line 7)\n" +
" Zork();\n" +
Expand Down Expand Up @@ -2543,7 +2543,7 @@ public void testBug573921_1() {
"1. ERROR in X.java (at line 6)\n" +
" case String s when s.length() > 0 -> \n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testBug573921_2() {
Expand All @@ -2569,7 +2569,7 @@ public void testBug573921_2() {
"1. ERROR in X.java (at line 7)\n" +
" case String s:\n" +
" ^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testBug573921_3() {
Expand Down Expand Up @@ -2699,7 +2699,7 @@ public void testBug573921_7() {
"3. ERROR in X.java (at line 9)\n" +
" case List<String> s: \n" +
" ^^^^^^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testBug573921_8() {
Expand Down Expand Up @@ -2924,7 +2924,7 @@ public void testBug575048_01() {
"2. ERROR in X.java (at line 5)\n" +
" case Integer i1 -> 0;\n" +
" ^^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testBug575053_001() {
Expand Down Expand Up @@ -3464,7 +3464,7 @@ public void testBug575047_02() {
"1. ERROR in X.java (at line 5)\n" +
" case 0 -> 0;\n" +
" ^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testBug575047_03() {
Expand All @@ -3487,7 +3487,7 @@ public void testBug575047_03() {
"1. ERROR in X.java (at line 6)\n" +
" case Blue :\n" +
" ^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testBug575047_04() {
Expand Down Expand Up @@ -3554,7 +3554,7 @@ public void testBug575047_06() {
"2. ERROR in X.java (at line 6)\n" +
" case String s -> -1;\n" +
" ^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
// Test that when a literal is used as case constant
Expand Down Expand Up @@ -3724,7 +3724,7 @@ public void testBug575047_13() {
"2. ERROR in X.java (at line 5)\n" +
" case Red -> \"Red\";\n" +
" ^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testBug575047_14() {
Expand Down Expand Up @@ -3752,7 +3752,7 @@ public void testBug575047_14() {
"2. ERROR in X.java (at line 5)\n" +
" case Red -> \"Red\";\n" +
" ^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testBug575047_15() {
Expand Down Expand Up @@ -3889,7 +3889,7 @@ public void testBug575051_3() {
"1. ERROR in X.java (at line 5)\n" +
" case String s :\n" +
" ^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n",
"");
}
Expand Down Expand Up @@ -4081,12 +4081,12 @@ public void testBug575686_1() {
"2. ERROR in X.java (at line 7)\n" +
" case Number n, null ->\n" +
" ^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n" +
"3. ERROR in X.java (at line 7)\n" +
" case Number n, null ->\n" +
" ^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n" +
"4. ERROR in X.java (at line 7)\n" +
" case Number n, null ->\n" +
Expand All @@ -4111,32 +4111,32 @@ public void testBug575686_1() {
"8. ERROR in X.java (at line 9)\n" +
" case null, Class c ->\n" +
" ^^^^^^^\n" +
"A null case label and patterns cannot co-exist in the same case label. \n" +
"A null case label and patterns cannot co-exist in the same case label\n" +
"----------\n" +
"9. ERROR in X.java (at line 9)\n" +
" case null, Class c ->\n" +
" ^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n" +
"10. ERROR in X.java (at line 9)\n" +
" case null, Class c ->\n" +
" ^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n" +
"11. ERROR in X.java (at line 9)\n" +
" case null, Class c ->\n" +
" ^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n" +
"12. ERROR in X.java (at line 9)\n" +
" case null, Class c ->\n" +
" ^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n" +
"13. ERROR in X.java (at line 9)\n" +
" case null, Class c ->\n" +
" ^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testBug575737_001() {
Expand Down Expand Up @@ -5430,7 +5430,7 @@ public void testBug579355_003() {
"1. ERROR in X.java (at line 17)\n" +
" case 10 -> {\n" +
" ^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testBug579355_004() {
Expand Down Expand Up @@ -5752,12 +5752,12 @@ public void testIssue_556_008() {
"1. ERROR in X.java (at line 7)\n" +
" case String s :\n" +
" ^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n" +
"2. ERROR in X.java (at line 10)\n" +
" case String s when (s.length() == 10):\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testIssue_556_009() {
Expand Down Expand Up @@ -5786,7 +5786,7 @@ public void testIssue_556_009() {
"1. ERROR in X.java (at line 7)\n" +
" case String s :\n" +
" ^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testIssue658() {
Expand Down Expand Up @@ -5840,7 +5840,7 @@ public void testIssue711_1() {
"1. ERROR in X.java (at line 8)\n" +
" case ArrayList<? extends Number> aln -> // Error - dominated case label\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testIssue711_2() {
Expand All @@ -5866,7 +5866,7 @@ public void testIssue711_2() {
"1. ERROR in X.java (at line 8)\n" +
" case ArrayList<Number> al -> // Error - dominated case label\n" +
" ^^^^^^^^^^^^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testIssue742_1() {
Expand Down Expand Up @@ -5895,7 +5895,7 @@ public void testIssue742_1() {
"2. ERROR in X.java (at line 8)\n" +
" case Integer i -> // Error - dominated case label\n" +
" ^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testIssue742_2() {
Expand Down Expand Up @@ -5924,7 +5924,7 @@ public void testIssue742_2() {
"2. ERROR in X.java (at line 8)\n" +
" case Integer i when true -> // Error - dominated case label\n" +
" ^^^^^^^^^^^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testIssue712_001() {
Expand Down Expand Up @@ -6058,7 +6058,7 @@ public void testIssueDefaultDominance_001() {
"1. ERROR in X.java (at line 8)\n" +
" case Integer i: System.out.println(\"integer\"); break;\n" +
" ^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testIssueDefaultDominance_002() {
Expand All @@ -6080,7 +6080,7 @@ public void testIssueDefaultDominance_002() {
"1. ERROR in X.java (at line 7)\n" +
" case Integer i: System.out.println(\"integer\"); break;\n" +
" ^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testIssueDefaultDominance_003() {
Expand All @@ -6102,7 +6102,7 @@ public void testIssueDefaultDominance_003() {
"1. ERROR in X.java (at line 7)\n" +
" case null: System.out.println(\"null\"); break;\n" +
" ^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testIssueDefaultDominance_004() {
Expand All @@ -6125,7 +6125,7 @@ public void testIssueDefaultDominance_004() {
"1. ERROR in X.java (at line 8)\n" +
" case null: System.out.println(\"null\"); break;\n" +
" ^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
public void testIssue919() {
Expand Down Expand Up @@ -6164,22 +6164,22 @@ public void testIssue919() {
"1. ERROR in X.java (at line 8)\n" +
" case Integer value when value > 0 -> System.out.println(\"positive integer: \" + i);\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n" +
"2. ERROR in X.java (at line 15)\n" +
" case null -> System.out.println(\"value unavailable: \" + i);\n" +
" ^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n" +
"3. ERROR in X.java (at line 16)\n" +
" case Integer value when value > 0 -> System.out.println(\"positive integer: \" + i);\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n" +
"4. ERROR in X.java (at line 24)\n" +
" case Integer value when value > 0 -> System.out.println(\"positive integer: \" + i);\n" +
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"This case label is dominated by one of the preceding case label\n" +
"This case label is dominated by one of the preceding case labels\n" +
"----------\n");
}
}

0 comments on commit b681dfb

Please sign in to comment.