8234103: DatagramSocketImpl::socket is not needed

DatagramSocketImpl has a socket field that links back to the DatagramSocket. This is only used to figure out whether multicasting is supported or not. This fix replaces it with a boolean isMulticast.

Reviewed-by: alanb, chegar, dfuchs
This commit is contained in:
Patrick Concannon 2019-11-20 10:13:10 +00:00
parent a0b8244416
commit e636c69e61
8 changed files with 25 additions and 23 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2019, 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
@ -69,7 +69,7 @@ class DefaultDatagramSocketImplFactory {
throw new SocketException("can't instantiate DatagramSocketImpl");
}
} else {
return new java.net.PlainDatagramSocketImpl();
return new java.net.PlainDatagramSocketImpl(isMulticast);
}
}
}

View file

@ -37,6 +37,10 @@ import sun.net.ext.ExtendedSocketOptions;
class PlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl
{
PlainDatagramSocketImpl(boolean isMulticast) {
super(isMulticast);
}
static {
init();
}