mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
Merge
This commit is contained in:
commit
d7dd9d1027
444 changed files with 128295 additions and 2068 deletions
|
@ -273,6 +273,25 @@ public enum Wrapper {
|
|||
throw newIllegalArgumentException("not primitive: "+type);
|
||||
}
|
||||
|
||||
/** Return the wrapper that corresponds to the provided basic type char.
|
||||
* The basic type char must be for one of the eight primitive types, or void.
|
||||
* @throws IllegalArgumentException for unexpected types
|
||||
*/
|
||||
public static Wrapper forPrimitiveType(char basicTypeChar) {
|
||||
switch (basicTypeChar) {
|
||||
case 'I': return INT;
|
||||
case 'J': return LONG;
|
||||
case 'S': return SHORT;
|
||||
case 'B': return BYTE;
|
||||
case 'C': return CHAR;
|
||||
case 'F': return FLOAT;
|
||||
case 'D': return DOUBLE;
|
||||
case 'Z': return BOOLEAN;
|
||||
case 'V': return VOID;
|
||||
default: throw newIllegalArgumentException("not primitive: " + basicTypeChar);
|
||||
}
|
||||
}
|
||||
|
||||
static Wrapper findPrimitiveType(Class<?> type) {
|
||||
Wrapper w = FROM_PRIM[hashPrim(type)];
|
||||
if (w != null && w.primitiveType == type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue