From 6b2fd28871ceccdf3428cfa2049be9c192b5458a Mon Sep 17 00:00:00 2001 From: Dmytro Shteflyuk Date: Tue, 20 Oct 2026 18:45:31 -0400 Subject: [PATCH] Fix PHPStan and Java Spotless failures Client: java,php Co-Authored-By: OpenAI Codex (gpt-6.1-sol) --- .../org/apache/thrift/server/TSaslNonblockingServer.java | 6 +++--- lib/php/lib/Transport/TTransport.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/java/src/main/java/org/apache/thrift/server/TSaslNonblockingServer.java b/lib/java/src/main/java/org/apache/thrift/server/TSaslNonblockingServer.java index d8274fd3ca..bdada2c722 100644 --- a/lib/java/src/main/java/org/apache/thrift/server/TSaslNonblockingServer.java +++ b/lib/java/src/main/java/org/apache/thrift/server/TSaslNonblockingServer.java @@ -308,9 +308,9 @@ private void closeAfterFailure(Throwable failure, Runnable closeConnection) { /** * Logs a failure without letting the logging itself end this thread: building the message and - * rendering the throwable both allocate, which under memory pressure can raise another error, so - * everything that allocates stays inside the guard. ThreadDeath and other virtual machine errors - * are still allowed through. + * rendering the throwable both allocate, which under memory pressure can raise another error, + * so everything that allocates stays inside the guard. ThreadDeath and other virtual machine + * errors are still allowed through. */ private void logFailure(String message, Throwable failure) { try { diff --git a/lib/php/lib/Transport/TTransport.php b/lib/php/lib/Transport/TTransport.php index ddbd192533..8d174e5020 100644 --- a/lib/php/lib/Transport/TTransport.php +++ b/lib/php/lib/Transport/TTransport.php @@ -73,7 +73,7 @@ public function decrementRecursionDepth(): void public function checkStringSize(int $len): void { $max = TProtocol::DEFAULT_MAX_STRING_SIZE; - if ($max > 0 && $len > $max) { + if ($len > $max) { throw new TProtocolException( "String size ($len) larger than the maximum ($max)", TProtocolException::SIZE_LIMIT