This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new c91d60fdce Fix IDE warnings
c91d60fdce is described below
commit c91d60fdce60f63d0f71752104c8499d863e9909
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Mar 24 08:48:23 2025 +0000
Fix IDE warnings
---
java/org/apache/tomcat/util/net/AbstractEndpoint.java | 2 +-
.../apache/tomcat/websocket/WsRemoteEndpointImplBase.java | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index a845b6c049..0b7cb7c5da 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -1248,7 +1248,7 @@ public abstract class AbstractEndpoint<S,U> {
Executor executor = this.executor;
if (executor != null && internalExecutor) {
this.executor = null;
- if (executor instanceof
@SuppressWarnings("resource")ThreadPoolExecutor tpe) {
+ if (executor instanceof ThreadPoolExecutor tpe) {
//this is our internal one, so we need to shut it down
tpe.shutdownNow();
long timeout = getExecutorTerminationTimeoutMillis();
diff --git a/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
b/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
index 792fed1dcb..bf32bcc84c 100644
--- a/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
+++ b/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
@@ -581,7 +581,7 @@ public abstract class WsRemoteEndpointImplBase implements
RemoteEndpoint {
}
- @SuppressWarnings({ "unchecked", "rawtypes" })
+ @SuppressWarnings({ "unchecked", "rawtypes", "null" })
public void sendObject(Object obj) throws IOException, EncodeException {
if (obj == null) {
throw new
IllegalArgumentException(sm.getString("wsRemoteEndpoint.nullData"));
@@ -607,7 +607,7 @@ public abstract class WsRemoteEndpointImplBase implements
RemoteEndpoint {
String msg = text1.encode(obj);
sendString(msg);
}
- case Encoder.TextStream textStream -> {
+ case @SuppressWarnings("unused") Encoder.TextStream textStream -> {
try (Writer w = getSendWriter()) {
((Encoder.TextStream) encoder).encode(obj, w);
}
@@ -616,7 +616,7 @@ public abstract class WsRemoteEndpointImplBase implements
RemoteEndpoint {
ByteBuffer msg = binary.encode(obj);
sendBytes(msg);
}
- case Encoder.BinaryStream binaryStream -> {
+ case @SuppressWarnings("unused") Encoder.BinaryStream binaryStream
-> {
try (OutputStream os = getSendStream()) {
((Encoder.BinaryStream) encoder).encode(obj, os);
}
@@ -634,7 +634,7 @@ public abstract class WsRemoteEndpointImplBase implements
RemoteEndpoint {
}
- @SuppressWarnings({ "unchecked", "rawtypes" })
+ @SuppressWarnings({ "unchecked", "rawtypes", "null" })
public void sendObjectByCompletion(Object obj, SendHandler completion) {
if (obj == null) {
@@ -666,7 +666,7 @@ public abstract class WsRemoteEndpointImplBase implements
RemoteEndpoint {
String msg = text1.encode(obj);
sendStringByCompletion(msg, completion);
}
- case Encoder.TextStream textStream -> {
+ case @SuppressWarnings("unused") Encoder.TextStream textStream
-> {
try (Writer w = getSendWriter()) {
((Encoder.TextStream) encoder).encode(obj, w);
}
@@ -676,7 +676,7 @@ public abstract class WsRemoteEndpointImplBase implements
RemoteEndpoint {
ByteBuffer msg = binary.encode(obj);
sendBytesByCompletion(msg, completion);
}
- case Encoder.BinaryStream binaryStream -> {
+ case @SuppressWarnings("unused") Encoder.BinaryStream
binaryStream -> {
try (OutputStream os = getSendStream()) {
((Encoder.BinaryStream) encoder).encode(obj, os);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]