View | Details | Raw Unified | Return to bug 352412
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties (-3 / +3 lines)
Lines 147-153 Link Here
147
166 = The default case is already defined
147
166 = The default case is already defined
148
167 = Unreachable catch block for {0}. This exception is never thrown from the try statement body
148
167 = Unreachable catch block for {0}. This exception is never thrown from the try statement body
149
168 = Unhandled exception type {0}
149
168 = Unhandled exception type {0}
150
169 = Cannot switch on a value of type {0}. Only convertible int values or enum constants are permitted
150
169 = Cannot switch on a value of type {0}. Only convertible int values or enum variables are permitted
151
170 = Duplicate case
151
170 = Duplicate case
152
171 = Duplicate label {0}
152
171 = Duplicate label {0}
153
172 = break cannot be used outside of a loop or a switch
153
172 = break cannot be used outside of a loop or a switch
Lines 635-645 Link Here
635
874 = Resource specification not allowed here for source level below 1.7
635
874 = Resource specification not allowed here for source level below 1.7
636
875 = Multi-catch parameters are not allowed for source level below 1.7
636
875 = Multi-catch parameters are not allowed for source level below 1.7
637
876 = Invocation of polymorphic methods not allowed for source level below 1.7
637
876 = Invocation of polymorphic methods not allowed for source level below 1.7
638
877 = Cannot switch on a value of type {0}. Only convertible int values, strings or enum constants are permitted
638
877 = Cannot switch on a value of type {0}. Only convertible int values, strings or enum variables are permitted
639
878 = Cannot infer type arguments for {0}
639
878 = Cannot infer type arguments for {0}
640
879 = Explicit type arguments cannot be used with '<>' in an allocation expression
640
879 = Explicit type arguments cannot be used with '<>' in an allocation expression
641
880 = '<>' cannot be used with anonymous classes
641
880 = '<>' cannot be used with anonymous classes
642
881 = Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted
642
881 = Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted
643
882 = Unhandled exception type {0} thrown by automatic close() invocation on {1}
643
882 = Unhandled exception type {0} thrown by automatic close() invocation on {1}
644
883 = '<>' operator is not allowed for source level below 1.7
644
883 = '<>' operator is not allowed for source level below 1.7
645
884 = Redundant specification of type arguments <{0}>
645
884 = Redundant specification of type arguments <{0}>
(-)src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java (-29 / +29 lines)
Lines 230-236 Link Here
230
			"1. ERROR in X.java (at line 4)\n" +
230
			"1. ERROR in X.java (at line 4)\n" +
231
			"	switch(this){\n" +
231
			"	switch(this){\n" +
232
			"	       ^^^^\n" +
232
			"	       ^^^^\n" +
233
			"Cannot switch on a value of type X. Only convertible int values, strings or enum constants are permitted\n" +
233
			"Cannot switch on a value of type X. Only convertible int values, strings or enum variables are permitted\n" +
234
			"----------\n" +
234
			"----------\n" +
235
			"2. ERROR in X.java (at line 6)\n" +
235
			"2. ERROR in X.java (at line 6)\n" +
236
			"	Zork z;\n" +
236
			"	Zork z;\n" +
Lines 252-258 Link Here
252
			"1. ERROR in X.java (at line 4)\n" +
252
			"1. ERROR in X.java (at line 4)\n" +
253
			"	switch(this){\n" +
253
			"	switch(this){\n" +
254
			"	       ^^^^\n" +
254
			"	       ^^^^\n" +
255
			"Cannot switch on a value of type X. Only convertible int values or enum constants are permitted\n" +
255
			"Cannot switch on a value of type X. Only convertible int values or enum variables are permitted\n" +
256
			"----------\n" +
256
			"----------\n" +
257
			"2. ERROR in X.java (at line 6)\n" +
257
			"2. ERROR in X.java (at line 6)\n" +
258
			"	Zork z;\n" +
258
			"	Zork z;\n" +
Lines 872-878 Link Here
872
			"1. ERROR in X.java (at line 3)\n" + 
872
			"1. ERROR in X.java (at line 3)\n" + 
873
			"	switch(args[0]) {\n" + 
873
			"	switch(args[0]) {\n" + 
874
			"	       ^^^^^^^\n" + 
874
			"	       ^^^^^^^\n" + 
875
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
875
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
876
			"----------\n" + 
876
			"----------\n" + 
877
			"2. ERROR in X.java (at line 4)\n" + 
877
			"2. ERROR in X.java (at line 4)\n" + 
878
			"	default: return args;\n" + 
878
			"	default: return args;\n" + 
Lines 952-958 Link Here
952
			"1. ERROR in X.java (at line 3)\n" + 
952
			"1. ERROR in X.java (at line 3)\n" + 
953
			"	switch(args[0]) {\n" + 
953
			"	switch(args[0]) {\n" + 
954
			"	       ^^^^^^^\n" + 
954
			"	       ^^^^^^^\n" + 
955
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
955
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
956
			"----------\n" + 
956
			"----------\n" + 
957
			"2. ERROR in X.java (at line 12)\n" + 
957
			"2. ERROR in X.java (at line 12)\n" + 
958
			"	case (boolean) 8: break;\n" + 
958
			"	case (boolean) 8: break;\n" + 
Lines 997-1003 Link Here
997
			"1. ERROR in X.java (at line 6)\n" + 
997
			"1. ERROR in X.java (at line 6)\n" + 
998
			"	switch (\"Sunday\") {\n" + 
998
			"	switch (\"Sunday\") {\n" + 
999
			"	        ^^^^^^^^\n" + 
999
			"	        ^^^^^^^^\n" + 
1000
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1000
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1001
			"----------\n";
1001
			"----------\n";
1002
				
1002
				
1003
		this.runNegativeTest(new String[] {
1003
		this.runNegativeTest(new String[] {
Lines 1084-1090 Link Here
1084
			"1. ERROR in X.java (at line 3)\n" + 
1084
			"1. ERROR in X.java (at line 3)\n" + 
1085
			"	switch(args[0]) {\n" + 
1085
			"	switch(args[0]) {\n" + 
1086
			"	       ^^^^^^^\n" + 
1086
			"	       ^^^^^^^\n" + 
1087
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1087
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1088
			"----------\n" + 
1088
			"----------\n" + 
1089
			"2. ERROR in X.java (at line 6)\n" + 
1089
			"2. ERROR in X.java (at line 6)\n" + 
1090
			"	default: return args;\n" + 
1090
			"	default: return args;\n" + 
Lines 1157-1163 Link Here
1157
			"1. ERROR in X.java (at line 8)\n" + 
1157
			"1. ERROR in X.java (at line 8)\n" + 
1158
			"	switch(args[0]) {\n" + 
1158
			"	switch(args[0]) {\n" + 
1159
			"	       ^^^^^^^\n" + 
1159
			"	       ^^^^^^^\n" + 
1160
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1160
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1161
			"----------\n" + 
1161
			"----------\n" + 
1162
			"2. ERROR in X.java (at line 15)\n" + 
1162
			"2. ERROR in X.java (at line 15)\n" + 
1163
			"	case ifield: break;\n" + 
1163
			"	case ifield: break;\n" + 
Lines 1237-1243 Link Here
1237
			"1. ERROR in X.java (at line 6)\n" + 
1237
			"1. ERROR in X.java (at line 6)\n" + 
1238
			"	switch(args[0]) {\n" + 
1238
			"	switch(args[0]) {\n" + 
1239
			"	       ^^^^^^^\n" + 
1239
			"	       ^^^^^^^\n" + 
1240
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1240
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1241
			"----------\n";
1241
			"----------\n";
1242
				
1242
				
1243
		this.runNegativeTest(new String[] {
1243
		this.runNegativeTest(new String[] {
Lines 1279-1285 Link Here
1279
			"1. ERROR in X.java (at line 6)\n" + 
1279
			"1. ERROR in X.java (at line 6)\n" + 
1280
			"	switch(args[0]) {\n" + 
1280
			"	switch(args[0]) {\n" + 
1281
			"	       ^^^^^^^\n" + 
1281
			"	       ^^^^^^^\n" + 
1282
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1282
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1283
			"----------\n";
1283
			"----------\n";
1284
				
1284
				
1285
		this.runNegativeTest(new String[] {
1285
		this.runNegativeTest(new String[] {
Lines 1346-1352 Link Here
1346
			"1. ERROR in X.java (at line 6)\n" + 
1346
			"1. ERROR in X.java (at line 6)\n" + 
1347
			"	switch(args[0]) {\n" + 
1347
			"	switch(args[0]) {\n" + 
1348
			"	       ^^^^^^^\n" + 
1348
			"	       ^^^^^^^\n" + 
1349
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1349
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1350
			"----------\n";
1350
			"----------\n";
1351
				
1351
				
1352
		this.runNegativeTest(new String[] {
1352
		this.runNegativeTest(new String[] {
Lines 1409-1415 Link Here
1409
			"1. ERROR in X.java (at line 8)\n" + 
1409
			"1. ERROR in X.java (at line 8)\n" + 
1410
			"	switch(args[0]) {\n" + 
1410
			"	switch(args[0]) {\n" + 
1411
			"	       ^^^^^^^\n" + 
1411
			"	       ^^^^^^^\n" + 
1412
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1412
			"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1413
			"----------\n" + 
1413
			"----------\n" + 
1414
			"2. ERROR in X.java (at line 18)\n" + 
1414
			"2. ERROR in X.java (at line 18)\n" + 
1415
			"	default: break;\n" + 
1415
			"	default: break;\n" + 
Lines 1450-1456 Link Here
1450
		"1. ERROR in testDuplicateHashCode.java (at line 5)\n" + 
1450
		"1. ERROR in testDuplicateHashCode.java (at line 5)\n" + 
1451
		"	switch (dispatcher) {\n" + 
1451
		"	switch (dispatcher) {\n" + 
1452
		"	        ^^^^^^^^^^\n" + 
1452
		"	        ^^^^^^^^^^\n" + 
1453
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1453
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1454
		"----------\n";
1454
		"----------\n";
1455
	
1455
	
1456
	String [] sourceFiles = 
1456
	String [] sourceFiles = 
Lines 1506-1512 Link Here
1506
		"1. ERROR in testDuplicateHashCode.java (at line 5)\n" + 
1506
		"1. ERROR in testDuplicateHashCode.java (at line 5)\n" + 
1507
		"	switch (dispatcher) {\n" + 
1507
		"	switch (dispatcher) {\n" + 
1508
		"	        ^^^^^^^^^^\n" + 
1508
		"	        ^^^^^^^^^^\n" + 
1509
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1509
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1510
		"----------\n";
1510
		"----------\n";
1511
	
1511
	
1512
	String [] sourceFiles = 
1512
	String [] sourceFiles = 
Lines 1569-1595 Link Here
1569
		"1. ERROR in testSwitchOnNull.java (at line 13)\n" + 
1569
		"1. ERROR in testSwitchOnNull.java (at line 13)\n" + 
1570
		"	switch (s) {\n" + 
1570
		"	switch (s) {\n" + 
1571
		"	        ^\n" + 
1571
		"	        ^\n" + 
1572
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1572
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1573
		"----------\n" + 
1573
		"----------\n" + 
1574
		"2. ERROR in testSwitchOnNull.java (at line 23)\n" + 
1574
		"2. ERROR in testSwitchOnNull.java (at line 23)\n" + 
1575
		"	switch ((String) null) {\n" + 
1575
		"	switch ((String) null) {\n" + 
1576
		"	        ^^^^^^^^^^^^^\n" + 
1576
		"	        ^^^^^^^^^^^^^\n" + 
1577
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1577
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1578
		"----------\n" + 
1578
		"----------\n" + 
1579
		"3. ERROR in testSwitchOnNull.java (at line 33)\n" + 
1579
		"3. ERROR in testSwitchOnNull.java (at line 33)\n" + 
1580
		"	switch (someMethod()) {\n" + 
1580
		"	switch (someMethod()) {\n" + 
1581
		"	        ^^^^^^^^^^^^\n" + 
1581
		"	        ^^^^^^^^^^^^\n" + 
1582
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1582
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1583
		"----------\n" + 
1583
		"----------\n" + 
1584
		"4. ERROR in testSwitchOnNull.java (at line 40)\n" + 
1584
		"4. ERROR in testSwitchOnNull.java (at line 40)\n" + 
1585
		"	switch (nullString) {\n" + 
1585
		"	switch (nullString) {\n" + 
1586
		"	        ^^^^^^^^^^\n" + 
1586
		"	        ^^^^^^^^^^\n" + 
1587
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1587
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1588
		"----------\n" + 
1588
		"----------\n" + 
1589
		"5. ERROR in testSwitchOnNull.java (at line 47)\n" + 
1589
		"5. ERROR in testSwitchOnNull.java (at line 47)\n" + 
1590
		"	switch (someMethod()) {\n" + 
1590
		"	switch (someMethod()) {\n" + 
1591
		"	        ^^^^^^^^^^^^\n" + 
1591
		"	        ^^^^^^^^^^^^\n" + 
1592
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1592
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1593
		"----------\n";
1593
		"----------\n";
1594
	
1594
	
1595
	String [] sourceFiles = 
1595
	String [] sourceFiles = 
Lines 1665-1671 Link Here
1665
		"1. ERROR in testSideEffect.java (at line 11)\n" + 
1665
		"1. ERROR in testSideEffect.java (at line 11)\n" + 
1666
		"	switch(dispatcher()) {\n" + 
1666
		"	switch(dispatcher()) {\n" + 
1667
		"	       ^^^^^^^^^^^^\n" + 
1667
		"	       ^^^^^^^^^^^^\n" + 
1668
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1668
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1669
		"----------\n";
1669
		"----------\n";
1670
	
1670
	
1671
	String [] sourceFiles = 
1671
	String [] sourceFiles = 
Lines 1703-1709 Link Here
1703
		"1. ERROR in testFallThrough.java (at line 11)\n" + 
1703
		"1. ERROR in testFallThrough.java (at line 11)\n" + 
1704
		"	switch(s = dispatcher()) {\n" + 
1704
		"	switch(s = dispatcher()) {\n" + 
1705
		"	       ^^^^^^^^^^^^^^^^\n" + 
1705
		"	       ^^^^^^^^^^^^^^^^\n" + 
1706
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1706
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1707
		"----------\n";
1707
		"----------\n";
1708
	
1708
	
1709
	String [] sourceFiles = 
1709
	String [] sourceFiles = 
Lines 1753-1759 Link Here
1753
		"1. ERROR in testFallThrough.java (at line 11)\n" + 
1753
		"1. ERROR in testFallThrough.java (at line 11)\n" + 
1754
		"	switch(s = dispatcher()) {\n" + 
1754
		"	switch(s = dispatcher()) {\n" + 
1755
		"	       ^^^^^^^^^^^^^^^^\n" + 
1755
		"	       ^^^^^^^^^^^^^^^^\n" + 
1756
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1756
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1757
		"----------\n";
1757
		"----------\n";
1758
	
1758
	
1759
	String [] sourceFiles = 
1759
	String [] sourceFiles = 
Lines 1798-1804 Link Here
1798
		"1. ERROR in testMarysLamb.java (at line 4)\n" + 
1798
		"1. ERROR in testMarysLamb.java (at line 4)\n" + 
1799
		"	switch(s) {\n" + 
1799
		"	switch(s) {\n" + 
1800
		"	       ^\n" + 
1800
		"	       ^\n" + 
1801
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1801
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1802
		"----------\n";
1802
		"----------\n";
1803
	
1803
	
1804
	String [] sourceFiles = 
1804
	String [] sourceFiles = 
Lines 1826-1832 Link Here
1826
		"1. ERROR in testBreakOut.java (at line 5)\n" + 
1826
		"1. ERROR in testBreakOut.java (at line 5)\n" + 
1827
		"	switch(s) {\n" + 
1827
		"	switch(s) {\n" + 
1828
		"	       ^\n" + 
1828
		"	       ^\n" + 
1829
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1829
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1830
		"----------\n";
1830
		"----------\n";
1831
	
1831
	
1832
	String [] sourceFiles = 
1832
	String [] sourceFiles = 
Lines 1864-1880 Link Here
1864
		"1. ERROR in X.java (at line 6)\n" + 
1864
		"1. ERROR in X.java (at line 6)\n" + 
1865
		"	switch (s) {\n" + 
1865
		"	switch (s) {\n" + 
1866
		"	        ^\n" + 
1866
		"	        ^\n" + 
1867
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1867
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1868
		"----------\n" + 
1868
		"----------\n" + 
1869
		"2. ERROR in X.java (at line 35)\n" + 
1869
		"2. ERROR in X.java (at line 35)\n" + 
1870
		"	switch (s) {\n" + 
1870
		"	switch (s) {\n" + 
1871
		"	        ^\n" + 
1871
		"	        ^\n" + 
1872
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1872
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1873
		"----------\n" + 
1873
		"----------\n" + 
1874
		"3. ERROR in X.java (at line 51)\n" + 
1874
		"3. ERROR in X.java (at line 51)\n" + 
1875
		"	switch (s) {\n" + 
1875
		"	switch (s) {\n" + 
1876
		"	        ^\n" + 
1876
		"	        ^\n" + 
1877
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1877
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1878
		"----------\n";
1878
		"----------\n";
1879
	
1879
	
1880
	String [] sourceFiles = 
1880
	String [] sourceFiles = 
Lines 1966-1982 Link Here
1966
		"1. ERROR in X.java (at line 4)\n" + 
1966
		"1. ERROR in X.java (at line 4)\n" + 
1967
		"	switch (s) {\n" + 
1967
		"	switch (s) {\n" + 
1968
		"	        ^\n" + 
1968
		"	        ^\n" + 
1969
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1969
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1970
		"----------\n" + 
1970
		"----------\n" + 
1971
		"2. ERROR in X.java (at line 7)\n" + 
1971
		"2. ERROR in X.java (at line 7)\n" + 
1972
		"	switch (s) {\n" + 
1972
		"	switch (s) {\n" + 
1973
		"	        ^\n" + 
1973
		"	        ^\n" + 
1974
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1974
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1975
		"----------\n" + 
1975
		"----------\n" + 
1976
		"3. ERROR in X.java (at line 18)\n" + 
1976
		"3. ERROR in X.java (at line 18)\n" + 
1977
		"	switch (s) {\n" + 
1977
		"	switch (s) {\n" + 
1978
		"	        ^\n" + 
1978
		"	        ^\n" + 
1979
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + 
1979
		"Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + 
1980
		"----------\n";
1980
		"----------\n";
1981
	
1981
	
1982
	String [] sourceFiles = 
1982
	String [] sourceFiles = 

Return to bug 352412