mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8268124: Update java.lang to use switch expressions
Reviewed-by: naoto, darcy, mchung, iris, lancea, dfuchs
This commit is contained in:
parent
a187fcc3ec
commit
d43c8a74b3
22 changed files with 421 additions and 551 deletions
|
@ -187,22 +187,17 @@ class LambdaForm {
|
|||
return ALL_TYPES[type];
|
||||
}
|
||||
static BasicType basicType(char type) {
|
||||
switch (type) {
|
||||
case 'L': return L_TYPE;
|
||||
case 'I': return I_TYPE;
|
||||
case 'J': return J_TYPE;
|
||||
case 'F': return F_TYPE;
|
||||
case 'D': return D_TYPE;
|
||||
case 'V': return V_TYPE;
|
||||
return switch (type) {
|
||||
case 'L' -> L_TYPE;
|
||||
case 'I' -> I_TYPE;
|
||||
case 'J' -> J_TYPE;
|
||||
case 'F' -> F_TYPE;
|
||||
case 'D' -> D_TYPE;
|
||||
case 'V' -> V_TYPE;
|
||||
// all subword types are represented as ints
|
||||
case 'Z':
|
||||
case 'B':
|
||||
case 'S':
|
||||
case 'C':
|
||||
return I_TYPE;
|
||||
default:
|
||||
throw newInternalError("Unknown type char: '"+type+"'");
|
||||
}
|
||||
case 'Z', 'B', 'S', 'C' -> I_TYPE;
|
||||
default -> throw newInternalError("Unknown type char: '" + type + "'");
|
||||
};
|
||||
}
|
||||
static BasicType basicType(Wrapper type) {
|
||||
char c = type.basicTypeChar();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue