8302815: Use new Math.clamp method in core libraries

Reviewed-by: alanb
This commit is contained in:
Tagir F. Valeev 2023-02-22 09:51:14 +00:00
parent 5e1d1b7940
commit 3f3a1f534b
11 changed files with 37 additions and 45 deletions

View file

@ -308,8 +308,8 @@ public class ObjectInputStream
* The maximum number of interfaces allowed for a proxy is limited to 65535 by
* {@link java.lang.reflect.Proxy#newProxyInstance(ClassLoader, Class[], InvocationHandler)}.
*/
static final int PROXY_INTERFACE_LIMIT = Math.max(0, Math.min(65535, GetIntegerAction
.privilegedGetProperty("jdk.serialProxyInterfaceLimit", 65535)));
static final int PROXY_INTERFACE_LIMIT = Math.clamp(GetIntegerAction
.privilegedGetProperty("jdk.serialProxyInterfaceLimit", 65535), 0, 65535);
}
/*