8268967: Update java.security to use switch expressions

Reviewed-by: xuelei
This commit is contained in:
Patrick Concannon 2021-06-25 16:34:18 +00:00
parent b565459f83
commit 35c4702055
3 changed files with 46 additions and 107 deletions

View file

@ -447,12 +447,8 @@ public abstract class MessageDigest extends MessageDigestSpi {
PrintStream p = new PrintStream(baos);
p.print(algorithm+" Message Digest from "+getProviderName()+", ");
switch (state) {
case INITIAL:
p.print("<initialized>");
break;
case IN_PROGRESS:
p.print("<in progress>");
break;
case INITIAL -> p.print("<initialized>");
case IN_PROGRESS -> p.print("<in progress>");
}
p.println();
return (baos.toString());