GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Replace `ClosedChannelException` with `StacklessClosedChannelExceptio… · netty/netty@70d6e9b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • handler/src/main/java/io/netty/handler/ssl
    • SslHandler.java
  • transport/src/main/java/io/netty/channel
    • StacklessClosedChannelException.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎handler/src/main/java/io/netty/handler/ssl/SslHandler.java‎

Copy file name to clipboardExpand all lines: handler/src/main/java/io/netty/handler/ssl/SslHandler.java
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import io.netty.channel.ChannelOutboundHandler;
3131
import io.netty.channel.ChannelPipeline;
3232
import io.netty.channel.ChannelShutdownType;
33+
import io.netty.channel.StacklessClosedChannelException;
3334
import io.netty.channel.unix.UnixChannel;
3435
import io.netty.handler.codec.ByteToMessageDecoder;
3536
import io.netty.handler.codec.DecoderException;
@@ -51,7 +52,6 @@
5152

5253
import java.io.IOException;
5354
import java.nio.ByteBuffer;
54-
import java.nio.channels.ClosedChannelException;
5555
import java.nio.channels.DatagramChannel;
5656
import java.nio.channels.SocketChannel;
5757
import java.security.cert.CertificateException;
@@ -1123,7 +1123,8 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception {
11231123
boolean handshakeFailed = handshakePromise.cause() != null;
11241124

11251125
// Channel closed, we will generate 'ClosedChannelException' now.
1126-
ClosedChannelException exception = new ClosedChannelException();
1126+
StacklessClosedChannelException exception = StacklessClosedChannelException.newInstance(
1127+
SslHandler.class, "channelInactive(ChannelHandlerContext)");
11271128

11281129
// Add a supressed exception if the handshake was not completed yet.
11291130
if (isStateSet(STATE_HANDSHAKE_STARTED) && !handshakePromise.isDone()) {
Collapse file

‎transport/src/main/java/io/netty/channel/StacklessClosedChannelException.java‎

Copy file name to clipboardExpand all lines: transport/src/main/java/io/netty/channel/StacklessClosedChannelException.java
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
package io.netty.channel;
1717

1818
import io.netty.util.internal.ThrowableUtil;
19+
import io.netty.util.internal.UnstableApi;
1920

2021
import java.nio.channels.ClosedChannelException;
2122

2223
/**
2324
* Cheap {@link ClosedChannelException} that does not fill in the stacktrace.
2425
*/
25-
final class StacklessClosedChannelException extends ClosedChannelException {
26+
@UnstableApi
27+
public final class StacklessClosedChannelException extends ClosedChannelException {
2628

2729
private static final long serialVersionUID = -2214806025529435136L;
2830

@@ -37,7 +39,7 @@ public Throwable fillInStackTrace() {
3739
/**
3840
* Creates a new {@link StacklessClosedChannelException} which has the origin of the given {@link Class} and method.
3941
*/
40-
static StacklessClosedChannelException newInstance(Class<?> clazz, String method) {
42+
public static StacklessClosedChannelException newInstance(Class<?> clazz, String method) {
4143
return ThrowableUtil.unknownStackTrace(new StacklessClosedChannelException(), clazz, method);
4244
}
4345
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.