Skip to content

Commit b9bcb58

Browse files
committed
Issue #12023 - Remove deprecated classes/methods.
Removed deprecated methods from EndPoint. Signed-off-by: Simone Bordet <[email protected]>
1 parent 1af9980 commit b9bcb58

File tree

6 files changed

+2
-94
lines changed

6 files changed

+2
-94
lines changed

jetty-core/jetty-http2/jetty-http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2StreamEndPoint.java

-19
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
package org.eclipse.jetty.http2;
1515

1616
import java.io.IOException;
17-
import java.net.InetSocketAddress;
1817
import java.net.SocketAddress;
1918
import java.nio.BufferOverflowException;
2019
import java.nio.ByteBuffer;
@@ -54,30 +53,12 @@ public HTTP2StreamEndPoint(HTTP2Stream stream)
5453
this.stream = stream;
5554
}
5655

57-
@Override
58-
public InetSocketAddress getLocalAddress()
59-
{
60-
SocketAddress local = getLocalSocketAddress();
61-
if (local instanceof InetSocketAddress)
62-
return (InetSocketAddress)local;
63-
return null;
64-
}
65-
6656
@Override
6757
public SocketAddress getLocalSocketAddress()
6858
{
6959
return stream.getSession().getLocalSocketAddress();
7060
}
7161

72-
@Override
73-
public InetSocketAddress getRemoteAddress()
74-
{
75-
SocketAddress remote = getRemoteSocketAddress();
76-
if (remote instanceof InetSocketAddress)
77-
return (InetSocketAddress)remote;
78-
return null;
79-
}
80-
8162
@Override
8263
public SocketAddress getRemoteSocketAddress()
8364
{

jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java

-19
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
package org.eclipse.jetty.io;
1515

1616
import java.io.IOException;
17-
import java.net.InetSocketAddress;
1817
import java.net.SocketAddress;
1918
import java.nio.ByteBuffer;
2019
import java.nio.channels.WritePendingException;
@@ -59,27 +58,9 @@ protected AbstractEndPoint(Scheduler scheduler)
5958
super(scheduler);
6059
}
6160

62-
@Override
63-
public InetSocketAddress getLocalAddress()
64-
{
65-
SocketAddress local = getLocalSocketAddress();
66-
if (local instanceof InetSocketAddress)
67-
return (InetSocketAddress)local;
68-
return null;
69-
}
70-
7161
@Override
7262
public abstract SocketAddress getLocalSocketAddress();
7363

74-
@Override
75-
public InetSocketAddress getRemoteAddress()
76-
{
77-
SocketAddress remote = getRemoteSocketAddress();
78-
if (remote instanceof InetSocketAddress)
79-
return (InetSocketAddress)remote;
80-
return null;
81-
}
82-
8364
@Override
8465
public abstract SocketAddress getRemoteSocketAddress();
8566

jetty-core/jetty-io/src/main/java/org/eclipse/jetty/io/EndPoint.java

+2-18
Original file line numberDiff line numberDiff line change
@@ -84,38 +84,22 @@ interface Wrapper
8484
EndPoint unwrap();
8585
}
8686

87-
/**
88-
* @return The local InetSocketAddress to which this {@code EndPoint} is bound, or {@code null}
89-
* if this {@code EndPoint} is not bound to a Socket address.
90-
* @deprecated use {@link #getLocalSocketAddress()} instead
91-
*/
92-
@Deprecated
93-
InetSocketAddress getLocalAddress();
94-
9587
/**
9688
* @return the local SocketAddress to which this {@code EndPoint} is bound or {@code null}
9789
* if this {@code EndPoint} is not bound to a Socket address.
9890
*/
9991
default SocketAddress getLocalSocketAddress()
10092
{
101-
return getLocalAddress();
93+
return null;
10294
}
10395

104-
/**
105-
* @return The remote InetSocketAddress to which this {@code EndPoint} is connected, or {@code null}
106-
* if this {@code EndPoint} is not connected to a Socket address.
107-
* @deprecated use {@link #getRemoteSocketAddress()} instead.
108-
*/
109-
@Deprecated
110-
InetSocketAddress getRemoteAddress();
111-
11296
/**
11397
* @return The remote SocketAddress to which this {@code EndPoint} is connected, or {@code null}
11498
* if this {@code EndPoint} is not connected to a Socket address.
11599
*/
116100
default SocketAddress getRemoteSocketAddress()
117101
{
118-
return getRemoteAddress();
102+
return null;
119103
}
120104

121105
/**

jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java

-18
Original file line numberDiff line numberDiff line change
@@ -879,30 +879,12 @@ public void setIdleTimeout(long idleTimeout)
879879
_endPoint.setIdleTimeout(idleTimeout);
880880
}
881881

882-
@Override
883-
public InetSocketAddress getLocalAddress()
884-
{
885-
SocketAddress local = getLocalSocketAddress();
886-
if (local instanceof InetSocketAddress)
887-
return (InetSocketAddress)local;
888-
return null;
889-
}
890-
891882
@Override
892883
public SocketAddress getLocalSocketAddress()
893884
{
894885
return _local;
895886
}
896887

897-
@Override
898-
public InetSocketAddress getRemoteAddress()
899-
{
900-
SocketAddress remote = getRemoteSocketAddress();
901-
if (remote instanceof InetSocketAddress)
902-
return (InetSocketAddress)remote;
903-
return null;
904-
}
905-
906888
@Override
907889
public SocketAddress getRemoteSocketAddress()
908890
{

jetty-core/jetty-unixdomain-server/src/test/java/org/eclipse/jetty/unixdomain/server/UnixDomainTest.java

-7
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
5353
import static org.junit.jupiter.api.Assertions.assertEquals;
5454
import static org.junit.jupiter.api.Assertions.assertNotNull;
55-
import static org.junit.jupiter.api.Assertions.assertNull;
5655
import static org.junit.jupiter.api.Assertions.assertThrows;
5756
import static org.junit.jupiter.api.Assertions.assertTrue;
5857

@@ -103,12 +102,6 @@ public boolean handle(Request request, Response response, Callback callback)
103102
SocketAddress remote = endPoint.getRemoteSocketAddress();
104103
assertThat(remote, Matchers.instanceOf(UnixDomainSocketAddress.class));
105104

106-
// Verify that other address methods don't throw.
107-
local = assertDoesNotThrow(endPoint::getLocalAddress);
108-
assertNull(local);
109-
remote = assertDoesNotThrow(endPoint::getRemoteAddress);
110-
assertNull(remote);
111-
112105
assertDoesNotThrow(endPoint::toString);
113106

114107
callback.succeeded();

jetty-core/jetty-websocket/jetty-websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/internal/MockEndpoint.java

-13
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
package org.eclipse.jetty.websocket.core.internal;
1515

1616
import java.io.IOException;
17-
import java.net.InetSocketAddress;
1817
import java.net.SocketAddress;
1918
import java.nio.ByteBuffer;
2019
import java.nio.channels.ReadPendingException;
@@ -28,24 +27,12 @@ public class MockEndpoint implements EndPoint
2827
{
2928
public static final String NOT_SUPPORTED = "Not supported by MockEndPoint";
3029

31-
@Override
32-
public InetSocketAddress getLocalAddress()
33-
{
34-
throw new UnsupportedOperationException(NOT_SUPPORTED);
35-
}
36-
3730
@Override
3831
public SocketAddress getLocalSocketAddress()
3932
{
4033
throw new UnsupportedOperationException(NOT_SUPPORTED);
4134
}
4235

43-
@Override
44-
public InetSocketAddress getRemoteAddress()
45-
{
46-
throw new UnsupportedOperationException(NOT_SUPPORTED);
47-
}
48-
4936
@Override
5037
public SocketAddress getRemoteSocketAddress()
5138
{

0 commit comments

Comments
 (0)