Skip to content

Commit

Permalink
8235139: Updated @deprecated text for setSocketFactory methods in Soc…
Browse files Browse the repository at this point in the history
…ket and ServerSocket
  • Loading branch information
pconcannon committed Feb 4, 2021
1 parent aca32fc commit e36f91d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
11 changes: 9 additions & 2 deletions src/java.base/share/classes/java/net/ServerSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -924,8 +924,15 @@ public String toString() {
* {@code checkSetFactory} method doesn't allow the operation.
* @see java.net.SocketImplFactory#createSocketImpl()
* @see SecurityManager#checkSetFactory
* @deprecated Use a {@link javax.net.ServerSocketFactory} and subclass
* {@code ServerSocket} directly.
* @deprecated Use {@link ServerSocketChannel}, or subclass {@code ServerSocket}
* directly.
* <br> This method provided a way in early JDK releases to replace the
* system wide implementation of {@code ServerSocket}. It has been mostly
* obsolete since Java 1.4. If required, a {@code ServerSocket} can be
* created to use a custom implementation by extending {@code ServerSocket}
* and using the {@linkplain #ServerSocket(SocketImpl) protected
* constructor} that takes an {@linkplain SocketImpl implementation}
* as a parameter.
*/
@Deprecated(since = "17")
public static synchronized void setSocketFactory(SocketImplFactory fac) throws IOException {
Expand Down
13 changes: 10 additions & 3 deletions src/java.base/share/classes/java/net/Socket.java
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,8 @@ void setImpl(SocketImpl si) {
* Sets impl to the system-default type of SocketImpl.
* @since 1.4
*/
@SuppressWarnings("deprecation")
void setImpl() {
@SuppressWarnings("deprecation")
SocketImplFactory factory = Socket.factory;
if (factory != null) {
impl = factory.createSocketImpl();
Expand Down Expand Up @@ -1751,8 +1751,15 @@ static SocketImplFactory socketImplFactory() {
* {@code checkSetFactory} method doesn't allow the operation.
* @see java.net.SocketImplFactory#createSocketImpl()
* @see SecurityManager#checkSetFactory
* @deprecated Use a {@link javax.net.SocketFactory} and subclass
* {@code Socket} directly.
* @deprecated Use {@link SocketChannel}, or subclass {@code Socket}
* directly.
* <br> This method provided a way in early JDK releases to replace the
* system wide implementation of {@code Socket}. It has been mostly
* obsolete since Java 1.4. If required, a {@code Socket} can be
* created to use a custom implementation by extending {@code Socket}
* and using the {@linkplain #Socket(SocketImpl) protected
* constructor} that takes an {@linkplain SocketImpl implementation}
* as a parameter.
*/
@Deprecated(since = "17")
public static synchronized void setSocketImplFactory(SocketImplFactory fac)
Expand Down

0 comments on commit e36f91d

Please sign in to comment.