Skip to content

Commit ce99198

Browse files
committedMay 21, 2024
8332181: Deprecate for removal the MulticastSocket.send(DatagramPacket, byte) and setTTL/getTTL methods on DatagramSocketImpl and MulticastSocket
Reviewed-by: dfuchs, iris, alanb
1 parent f5ab7df commit ce99198

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed
 

‎src/java.base/share/classes/java/net/DatagramSocketImpl.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -171,7 +171,7 @@ protected void disconnect() {
171171
* the time-to-live option.
172172
* @see #getTTL()
173173
*/
174-
@Deprecated
174+
@Deprecated(forRemoval = true, since = "1.2")
175175
protected abstract void setTTL(byte ttl) throws IOException;
176176

177177
/**
@@ -183,7 +183,7 @@ protected void disconnect() {
183183
* @return a byte representing the TTL value
184184
* @see #setTTL(byte)
185185
*/
186-
@Deprecated
186+
@Deprecated(forRemoval = true, since = "1.2")
187187
protected abstract byte getTTL() throws IOException;
188188

189189
/**

‎src/java.base/share/classes/java/net/MulticastSocket.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -226,7 +226,7 @@ public MulticastSocket(SocketAddress bindaddr) throws IOException {
226226
* <b>int</b> instead of <b>byte</b> as the type for ttl.
227227
* @see #getTTL()
228228
*/
229-
@Deprecated
229+
@Deprecated(forRemoval = true, since = "1.2")
230230
public void setTTL(byte ttl) throws IOException {
231231
delegate().setTTL(ttl);
232232
}
@@ -271,7 +271,7 @@ public void setTimeToLive(int ttl) throws IOException {
271271
* which returns an <b>int</b> instead of a <b>byte</b>.
272272
* @see #setTTL(byte)
273273
*/
274-
@Deprecated
274+
@Deprecated(forRemoval = true, since = "1.2")
275275
public byte getTTL() throws IOException {
276276
return delegate().getTTL();
277277
}
@@ -561,7 +561,7 @@ public boolean getLoopbackMode() throws SocketException {
561561
* @see SecurityManager#checkMulticast(java.net.InetAddress, byte)
562562
* @see SecurityManager#checkConnect
563563
*/
564-
@Deprecated
564+
@Deprecated(forRemoval = true, since = "1.4")
565565
public void send(DatagramPacket p, byte ttl)
566566
throws IOException {
567567
delegate().send(p, ttl);

‎src/java.base/share/classes/java/net/NetMulticastSocket.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -650,8 +650,8 @@ public Set<SocketOption<?>> supportedOptions() {
650650
*/
651651
private InetAddress infAddress = null;
652652

653-
@Deprecated
654653
@Override
654+
@SuppressWarnings("removal")
655655
public void setTTL(byte ttl) throws IOException {
656656
if (isClosed())
657657
throw new SocketException("Socket is closed");
@@ -668,8 +668,8 @@ public void setTimeToLive(int ttl) throws IOException {
668668
getImpl().setTimeToLive(ttl);
669669
}
670670

671-
@Deprecated
672671
@Override
672+
@SuppressWarnings("removal")
673673
public byte getTTL() throws IOException {
674674
if (isClosed())
675675
throw new SocketException("Socket is closed");
@@ -884,7 +884,6 @@ public boolean getLoopbackMode() throws SocketException {
884884
}
885885

886886
@SuppressWarnings("removal")
887-
@Deprecated
888887
@Override
889888
public void send(DatagramPacket p, byte ttl)
890889
throws IOException {

‎src/java.base/share/classes/sun/nio/ch/DatagramSocketAdaptor.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -401,7 +401,7 @@ public Set<SocketOption<?>> supportedOptions() {
401401
private InetAddress outgoingInetAddress;
402402

403403
@Override
404-
@Deprecated
404+
@SuppressWarnings("removal")
405405
public void setTTL(byte ttl) throws IOException {
406406
setTimeToLive(Byte.toUnsignedInt(ttl));
407407
}
@@ -417,7 +417,7 @@ public void setTimeToLive(int ttl) throws IOException {
417417
}
418418

419419
@Override
420-
@Deprecated
420+
@SuppressWarnings("removal")
421421
public byte getTTL() throws IOException {
422422
return (byte) getTimeToLive();
423423
}
@@ -592,7 +592,7 @@ public boolean getLoopbackMode() throws SocketException {
592592
}
593593

594594
@Override
595-
@Deprecated
595+
@SuppressWarnings("removal")
596596
public void send(DatagramPacket p, byte ttl) throws IOException {
597597
sendLock.lock();
598598
try {

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on May 21, 2024

@openjdk-notifier[bot]
Please sign in to comment.