You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/05/30 21:27:18 UTC

[tomcat-native] branch 1.2.x updated: Update Java code to align with Tomcat 9.0.x

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

markt pushed a commit to branch 1.2.x
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git


The following commit(s) were added to refs/heads/1.2.x by this push:
     new d058d92af Update Java code to align with Tomcat 9.0.x
d058d92af is described below

commit d058d92afe47629a0ee722a20da882de01d34a29
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue May 30 22:25:54 2023 +0100

    Update Java code to align with Tomcat 9.0.x
---
 java/org/apache/tomcat/jni/BIOCallback.java       | 8 ++++----
 java/org/apache/tomcat/jni/Library.java           | 4 +++-
 java/org/apache/tomcat/jni/PasswordCallback.java  | 2 +-
 java/org/apache/tomcat/jni/PoolCallback.java      | 2 +-
 java/org/apache/tomcat/jni/ProcErrorCallback.java | 2 +-
 java/org/apache/tomcat/jni/SSLContext.java        | 4 ++--
 6 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/java/org/apache/tomcat/jni/BIOCallback.java b/java/org/apache/tomcat/jni/BIOCallback.java
index 24736da84..b98dd949b 100644
--- a/java/org/apache/tomcat/jni/BIOCallback.java
+++ b/java/org/apache/tomcat/jni/BIOCallback.java
@@ -31,27 +31,27 @@ public interface BIOCallback {
      * @param buf containing the bytes to write.
      * @return Number of characters written.
      */
-    public int write(byte [] buf);
+    int write(byte [] buf);
 
     /**
      * Read data
      * @param buf buffer to store the read bytes.
      * @return number of bytes read.
      */
-    public int read(byte [] buf);
+    int read(byte [] buf);
 
     /**
      * Puts string
      * @param data String to write
      * @return Number of characters written
      */
-    public int puts(String data);
+    int puts(String data);
 
     /**
      * Read string up to the len or CLRLF
      * @param len Maximum number of characters to read
      * @return String with up to len bytes read
      */
-    public String gets(int len);
+    String gets(int len);
 
 }
diff --git a/java/org/apache/tomcat/jni/Library.java b/java/org/apache/tomcat/jni/Library.java
index cbff50e60..aa350b17d 100644
--- a/java/org/apache/tomcat/jni/Library.java
+++ b/java/org/apache/tomcat/jni/Library.java
@@ -22,6 +22,8 @@ public final class Library {
 
     /* Default library names */
     private static final String [] NAMES = {"tcnative-2", "libtcnative-2", "tcnative-1", "libtcnative-1"};
+    /* System property used to define CATALINA_HOME */
+    private static final String CATALINA_HOME_PROP = "catalina.home";
     /*
      * A handle to the unique Library singleton instance.
      */
@@ -30,7 +32,7 @@ public final class Library {
     private Library() throws Exception {
         boolean loaded = false;
         StringBuilder err = new StringBuilder();
-        File binLib = new File(System.getProperty("catalina.home"), "bin");
+        File binLib = new File(System.getProperty(CATALINA_HOME_PROP), "bin");
         for (int i = 0; i < NAMES.length; i++) {
             File library = new File(binLib, System.mapLibraryName(NAMES[i]));
             try {
diff --git a/java/org/apache/tomcat/jni/PasswordCallback.java b/java/org/apache/tomcat/jni/PasswordCallback.java
index 77e08073f..fb06867b3 100644
--- a/java/org/apache/tomcat/jni/PasswordCallback.java
+++ b/java/org/apache/tomcat/jni/PasswordCallback.java
@@ -31,5 +31,5 @@ public interface PasswordCallback {
      * @param prompt Password prompt
      * @return Valid password or null
      */
-    public String callback(String prompt);
+    String callback(String prompt);
 }
diff --git a/java/org/apache/tomcat/jni/PoolCallback.java b/java/org/apache/tomcat/jni/PoolCallback.java
index 1e75c9200..95b426146 100644
--- a/java/org/apache/tomcat/jni/PoolCallback.java
+++ b/java/org/apache/tomcat/jni/PoolCallback.java
@@ -33,5 +33,5 @@ public interface PoolCallback {
      * Called when the pool is destroyed or cleared
      * @return Function must return APR_SUCCESS
      */
-    public int callback();
+    int callback();
 }
diff --git a/java/org/apache/tomcat/jni/ProcErrorCallback.java b/java/org/apache/tomcat/jni/ProcErrorCallback.java
index 692e7c7c2..0ecc84254 100644
--- a/java/org/apache/tomcat/jni/ProcErrorCallback.java
+++ b/java/org/apache/tomcat/jni/ProcErrorCallback.java
@@ -38,5 +38,5 @@ public interface ProcErrorCallback {
      * @param err APR error code describing the error
      * @param description Text description of type of processing which failed
      */
-    public void callback(long pool, int err, String description);
+    void callback(long pool, int err, String description);
 }
diff --git a/java/org/apache/tomcat/jni/SSLContext.java b/java/org/apache/tomcat/jni/SSLContext.java
index cba81b74d..61a819bf7 100644
--- a/java/org/apache/tomcat/jni/SSLContext.java
+++ b/java/org/apache/tomcat/jni/SSLContext.java
@@ -485,7 +485,7 @@ public final class SSLContext {
      * select an OpenSSL SSLContext based on the host name requested by the
      * client.
      */
-    public static interface SNICallBack {
+    public interface SNICallBack {
 
         /**
          * This callback is made during the TLS handshake when the client uses
@@ -498,7 +498,7 @@ public final class SSLContext {
          *         SSLContext to use for the given host or zero if no SSLContext
          *         could be identified
          */
-        public long getSslContext(String sniHostName);
+        long getSslContext(String sniHostName);
     }
 
     /**


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