8282536: java.net.InetAddress should be a sealed class

Reviewed-by: dfuchs, jpai, rriggs, michaelm
This commit is contained in:
Aleksei Efimov 2022-03-23 14:57:36 +00:00
parent dc45b0ac58
commit 2b291d837e
2 changed files with 5 additions and 25 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -593,10 +593,6 @@ class Inet6Address extends InetAddress {
throws IOException, ClassNotFoundException {
NetworkInterface scope_ifname = null;
if (getClass().getClassLoader() != null) {
throw new SecurityException ("invalid address type");
}
ObjectInputStream.GetField gf = s.readFields();
byte[] ipaddress = (byte[])gf.get("ipaddress", new byte[0]);
int scope_id = gf.get("scope_id", -1);