This is an automated email from the ASF dual-hosted git repository.

remm 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 962cdc9aa8 Remove useless sync
962cdc9aa8 is described below

commit 962cdc9aa821f8c32b41d0968fdbeebe80f8eda5
Author: remm <r...@apache.org>
AuthorDate: Wed Jan 17 17:26:17 2024 +0100

    Remove useless sync
    
    init is called right after the constructor before using the object.
    Nothing actually syncs on the same lock as the one on destroy.
    Found by coverity.
---
 java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java        | 4 ++--
 java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java 
b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java
index cac88badf7..00b3ddacc3 100644
--- a/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java
+++ b/java/org/apache/tomcat/util/net/openssl/OpenSSLContext.java
@@ -198,7 +198,7 @@ public class OpenSSLContext implements 
org.apache.tomcat.util.net.SSLContext {
 
 
     @Override
-    public synchronized void destroy() {
+    public void destroy() {
         cleanable.clean();
     }
 
@@ -297,7 +297,7 @@ public class OpenSSLContext implements 
org.apache.tomcat.util.net.SSLContext {
      * @param sr Is not used for this implementation.
      */
     @Override
-    public synchronized void init(KeyManager[] kms, TrustManager[] tms, 
SecureRandom sr) {
+    public void init(KeyManager[] kms, TrustManager[] tms, SecureRandom sr) {
         if (initialized) {
             log.warn(sm.getString("openssl.doubleInit"));
             return;
diff --git a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java 
b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
index 2a3dfec8dd..5d1189cf19 100644
--- a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
+++ b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
@@ -463,7 +463,7 @@ public class OpenSSLContext implements 
org.apache.tomcat.util.net.SSLContext {
      * @param sr Is not used for this implementation.
      */
     @Override
-    public synchronized void init(KeyManager[] kms, TrustManager[] tms, 
SecureRandom sr) {
+    public void init(KeyManager[] kms, TrustManager[] tms, SecureRandom sr) {
         if (initialized) {
             log.warn(sm.getString("openssl.doubleInit"));
             return;
@@ -1367,7 +1367,7 @@ public class OpenSSLContext implements 
org.apache.tomcat.util.net.SSLContext {
     }
 
     @Override
-    public synchronized SSLEngine createSSLEngine() {
+    public SSLEngine createSSLEngine() {
         return new OpenSSLEngine(cleaner, state.sslCtx, defaultProtocol, 
false, sessionContext,
                 alpn, initialized,
                 sslHostConfig.getCertificateVerificationDepth(),


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to