Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 201099 Details for
Bug 352412
Switching on strings in 1.6- modes produces misleading message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed fix v1.0 + updated tests
patch352412.txt (text/plain), 15.65 KB, created by
Ayushman Jain
on 2011-08-08 14:46:39 EDT
(
hide
)
Description:
proposed fix v1.0 + updated tests
Filename:
MIME Type:
Creator:
Ayushman Jain
Created:
2011-08-08 14:46:39 EDT
Size:
15.65 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties,v >retrieving revision 1.267 >diff -u -r1.267 messages.properties >--- compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 28 Jul 2011 17:07:48 -0000 1.267 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 8 Aug 2011 18:44:38 -0000 >@@ -147,7 +147,7 @@ > 166 = The default case is already defined > 167 = Unreachable catch block for {0}. This exception is never thrown from the try statement body > 168 = Unhandled exception type {0} >-169 = Cannot switch on a value of type {0}. Only convertible int values or enum constants are permitted >+169 = Cannot switch on a value of type {0}. Only convertible int values or enum variables are permitted > 170 = Duplicate case > 171 = Duplicate label {0} > 172 = break cannot be used outside of a loop or a switch >@@ -635,11 +635,11 @@ > 874 = Resource specification not allowed here for source level below 1.7 > 875 = Multi-catch parameters are not allowed for source level below 1.7 > 876 = Invocation of polymorphic methods not allowed for source level below 1.7 >-877 = Cannot switch on a value of type {0}. Only convertible int values, strings or enum constants are permitted >+877 = Cannot switch on a value of type {0}. Only convertible int values, strings or enum variables are permitted > 878 = Cannot infer type arguments for {0} > 879 = Explicit type arguments cannot be used with '<>' in an allocation expression > 880 = '<>' cannot be used with anonymous classes >-881 = Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted >+881 = Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted > 882 = Unhandled exception type {0} thrown by automatic close() invocation on {1} > 883 = '<>' operator is not allowed for source level below 1.7 > 884 = Redundant specification of type arguments <{0}> >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java,v >retrieving revision 1.28 >diff -u -r1.28 SwitchTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java 28 Jul 2011 17:06:27 -0000 1.28 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/SwitchTest.java 8 Aug 2011 18:44:40 -0000 >@@ -230,7 +230,7 @@ > "1. ERROR in X.java (at line 4)\n" + > " switch(this){\n" + > " ^^^^\n" + >- "Cannot switch on a value of type X. Only convertible int values, strings or enum constants are permitted\n" + >+ "Cannot switch on a value of type X. Only convertible int values, strings or enum variables are permitted\n" + > "----------\n" + > "2. ERROR in X.java (at line 6)\n" + > " Zork z;\n" + >@@ -252,7 +252,7 @@ > "1. ERROR in X.java (at line 4)\n" + > " switch(this){\n" + > " ^^^^\n" + >- "Cannot switch on a value of type X. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type X. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "2. ERROR in X.java (at line 6)\n" + > " Zork z;\n" + >@@ -872,7 +872,7 @@ > "1. ERROR in X.java (at line 3)\n" + > " switch(args[0]) {\n" + > " ^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "2. ERROR in X.java (at line 4)\n" + > " default: return args;\n" + >@@ -952,7 +952,7 @@ > "1. ERROR in X.java (at line 3)\n" + > " switch(args[0]) {\n" + > " ^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "2. ERROR in X.java (at line 12)\n" + > " case (boolean) 8: break;\n" + >@@ -997,7 +997,7 @@ > "1. ERROR in X.java (at line 6)\n" + > " switch (\"Sunday\") {\n" + > " ^^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > this.runNegativeTest(new String[] { >@@ -1084,7 +1084,7 @@ > "1. ERROR in X.java (at line 3)\n" + > " switch(args[0]) {\n" + > " ^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "2. ERROR in X.java (at line 6)\n" + > " default: return args;\n" + >@@ -1157,7 +1157,7 @@ > "1. ERROR in X.java (at line 8)\n" + > " switch(args[0]) {\n" + > " ^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "2. ERROR in X.java (at line 15)\n" + > " case ifield: break;\n" + >@@ -1237,7 +1237,7 @@ > "1. ERROR in X.java (at line 6)\n" + > " switch(args[0]) {\n" + > " ^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > this.runNegativeTest(new String[] { >@@ -1279,7 +1279,7 @@ > "1. ERROR in X.java (at line 6)\n" + > " switch(args[0]) {\n" + > " ^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > this.runNegativeTest(new String[] { >@@ -1346,7 +1346,7 @@ > "1. ERROR in X.java (at line 6)\n" + > " switch(args[0]) {\n" + > " ^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > this.runNegativeTest(new String[] { >@@ -1409,7 +1409,7 @@ > "1. ERROR in X.java (at line 8)\n" + > " switch(args[0]) {\n" + > " ^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "2. ERROR in X.java (at line 18)\n" + > " default: break;\n" + >@@ -1450,7 +1450,7 @@ > "1. ERROR in testDuplicateHashCode.java (at line 5)\n" + > " switch (dispatcher) {\n" + > " ^^^^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > String [] sourceFiles = >@@ -1506,7 +1506,7 @@ > "1. ERROR in testDuplicateHashCode.java (at line 5)\n" + > " switch (dispatcher) {\n" + > " ^^^^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > String [] sourceFiles = >@@ -1569,27 +1569,27 @@ > "1. ERROR in testSwitchOnNull.java (at line 13)\n" + > " switch (s) {\n" + > " ^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "2. ERROR in testSwitchOnNull.java (at line 23)\n" + > " switch ((String) null) {\n" + > " ^^^^^^^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "3. ERROR in testSwitchOnNull.java (at line 33)\n" + > " switch (someMethod()) {\n" + > " ^^^^^^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "4. ERROR in testSwitchOnNull.java (at line 40)\n" + > " switch (nullString) {\n" + > " ^^^^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "5. ERROR in testSwitchOnNull.java (at line 47)\n" + > " switch (someMethod()) {\n" + > " ^^^^^^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > String [] sourceFiles = >@@ -1665,7 +1665,7 @@ > "1. ERROR in testSideEffect.java (at line 11)\n" + > " switch(dispatcher()) {\n" + > " ^^^^^^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > String [] sourceFiles = >@@ -1703,7 +1703,7 @@ > "1. ERROR in testFallThrough.java (at line 11)\n" + > " switch(s = dispatcher()) {\n" + > " ^^^^^^^^^^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > String [] sourceFiles = >@@ -1753,7 +1753,7 @@ > "1. ERROR in testFallThrough.java (at line 11)\n" + > " switch(s = dispatcher()) {\n" + > " ^^^^^^^^^^^^^^^^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > String [] sourceFiles = >@@ -1798,7 +1798,7 @@ > "1. ERROR in testMarysLamb.java (at line 4)\n" + > " switch(s) {\n" + > " ^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > String [] sourceFiles = >@@ -1826,7 +1826,7 @@ > "1. ERROR in testBreakOut.java (at line 5)\n" + > " switch(s) {\n" + > " ^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > String [] sourceFiles = >@@ -1864,17 +1864,17 @@ > "1. ERROR in X.java (at line 6)\n" + > " switch (s) {\n" + > " ^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "2. ERROR in X.java (at line 35)\n" + > " switch (s) {\n" + > " ^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "3. ERROR in X.java (at line 51)\n" + > " switch (s) {\n" + > " ^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > String [] sourceFiles = >@@ -1966,17 +1966,17 @@ > "1. ERROR in X.java (at line 4)\n" + > " switch (s) {\n" + > " ^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "2. ERROR in X.java (at line 7)\n" + > " switch (s) {\n" + > " ^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n" + > "3. ERROR in X.java (at line 18)\n" + > " switch (s) {\n" + > " ^\n" + >- "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum constants are permitted\n" + >+ "Cannot switch on a value of type String for source level below 1.7. Only convertible int values or enum variables are permitted\n" + > "----------\n"; > > String [] sourceFiles =
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 352412
: 201099