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 2022/05/30 13:36:02 UTC
[tomcat] branch 10.0.x updated: Deprecate unused code
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.0.x by this push:
new 791e8af3bd Deprecate unused code
791e8af3bd is described below
commit 791e8af3bd2a36d122c870fb18f2874405c81568
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue May 24 19:14:37 2022 +0100
Deprecate unused code
---
java/org/apache/tomcat/jni/BIOCallback.java | 3 ++
java/org/apache/tomcat/jni/Buffer.java | 21 ++++++++++++++
java/org/apache/tomcat/jni/Error.java | 3 ++
java/org/apache/tomcat/jni/Library.java | 1 +
java/org/apache/tomcat/jni/PasswordCallback.java | 3 ++
java/org/apache/tomcat/jni/Pool.java | 33 +++++++++++++++++++++
java/org/apache/tomcat/jni/SSL.java | 37 ++++++++++++++++++++++++
java/org/apache/tomcat/jni/SSLContext.java | 28 ++++++++++++++++++
8 files changed, 129 insertions(+)
diff --git a/java/org/apache/tomcat/jni/BIOCallback.java b/java/org/apache/tomcat/jni/BIOCallback.java
index 7dfdce0512..ea9ccff67c 100644
--- a/java/org/apache/tomcat/jni/BIOCallback.java
+++ b/java/org/apache/tomcat/jni/BIOCallback.java
@@ -19,7 +19,10 @@ package org.apache.tomcat.jni;
/** Open SSL BIO Callback Interface
*
* @author Mladen Turk
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+@Deprecated
public interface BIOCallback {
/**
diff --git a/java/org/apache/tomcat/jni/Buffer.java b/java/org/apache/tomcat/jni/Buffer.java
index 9802b114a3..2645666357 100644
--- a/java/org/apache/tomcat/jni/Buffer.java
+++ b/java/org/apache/tomcat/jni/Buffer.java
@@ -28,7 +28,10 @@ public class Buffer {
* Allocate a new ByteBuffer from memory
* @param size The amount of memory to allocate
* @return The ByteBuffer with allocated memory
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native ByteBuffer malloc(int size);
/**
@@ -36,7 +39,10 @@ public class Buffer {
* @param num Number of elements.
* @param size Length in bytes of each element.
* @return The ByteBuffer with allocated memory
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native ByteBuffer calloc(int num, int size);
/**
@@ -44,7 +50,10 @@ public class Buffer {
* @param p The pool to allocate from
* @param size The amount of memory to allocate
* @return The ByteBuffer with allocated memory
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native ByteBuffer palloc(long p, int size);
/**
@@ -52,7 +61,10 @@ public class Buffer {
* @param p The pool to allocate from
* @param size The amount of memory to allocate
* @return The ByteBuffer with allocated memory
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native ByteBuffer pcalloc(long p, int size);
/**
@@ -62,7 +74,10 @@ public class Buffer {
* @param mem The memory to use
* @param size The amount of memory to use
* @return The ByteBuffer with attached memory
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native ByteBuffer create(long mem, int size);
/**
@@ -70,7 +85,10 @@ public class Buffer {
* <br><b>Warning :</b> Call this method only on ByteBuffers
* that were created by calling Buffer.alloc or Buffer.calloc.
* @param buf Previously allocated ByteBuffer to be freed.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void free(ByteBuffer buf);
/**
@@ -84,7 +102,10 @@ public class Buffer {
* Returns the allocated memory size of the ByteBuffer.
* @param buf Previously allocated ByteBuffer.
* @return the size
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native long size(ByteBuffer buf);
}
diff --git a/java/org/apache/tomcat/jni/Error.java b/java/org/apache/tomcat/jni/Error.java
index bd3d87b390..a72cc15d56 100644
--- a/java/org/apache/tomcat/jni/Error.java
+++ b/java/org/apache/tomcat/jni/Error.java
@@ -19,7 +19,10 @@ package org.apache.tomcat.jni;
/** Error
*
* @author Mladen Turk
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+@Deprecated
public class Error extends Exception {
private static final long serialVersionUID = 1L;
diff --git a/java/org/apache/tomcat/jni/Library.java b/java/org/apache/tomcat/jni/Library.java
index 09fe13a014..abda71f948 100644
--- a/java/org/apache/tomcat/jni/Library.java
+++ b/java/org/apache/tomcat/jni/Library.java
@@ -185,6 +185,7 @@ public final class Library {
public static int APR_MMAP_LIMIT;
/* return global TCN's APR pool */
+ @Deprecated
public static native long globalPool();
/**
diff --git a/java/org/apache/tomcat/jni/PasswordCallback.java b/java/org/apache/tomcat/jni/PasswordCallback.java
index a15dc77e52..5c579ddd5e 100644
--- a/java/org/apache/tomcat/jni/PasswordCallback.java
+++ b/java/org/apache/tomcat/jni/PasswordCallback.java
@@ -19,7 +19,10 @@ package org.apache.tomcat.jni;
/** PasswordCallback Interface
*
* @author Mladen Turk
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+@Deprecated
public interface PasswordCallback {
/**
diff --git a/java/org/apache/tomcat/jni/Pool.java b/java/org/apache/tomcat/jni/Pool.java
index c59cf8bc15..e3741f5cff 100644
--- a/java/org/apache/tomcat/jni/Pool.java
+++ b/java/org/apache/tomcat/jni/Pool.java
@@ -40,7 +40,10 @@ public class Pool {
* @param pool The pool to clear
* This does not actually free the memory, it just allows the pool
* to re-use this memory for the next allocation.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void clear(long pool);
/**
@@ -55,7 +58,10 @@ public class Pool {
* Get the parent pool of the specified pool.
* @param pool The pool for retrieving the parent pool.
* @return The parent of the given pool.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native long parentGet(long pool);
/**
@@ -64,7 +70,10 @@ public class Pool {
* @param b The pool to search for
* @return True if a is an ancestor of b, NULL is considered an ancestor
* of all pools.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native boolean isAncestor(long a, long b);
@@ -86,14 +95,20 @@ public class Pool {
* @param o The object to call when the pool is cleared
* or destroyed
* @return The cleanup handler.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native long cleanupRegister(long pool, Object o);
/**
* Remove a previously registered cleanup function
* @param pool The pool remove the cleanup from
* @param data The cleanup handler to remove from cleanup
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void cleanupKill(long pool, long data);
/**
@@ -108,7 +123,10 @@ public class Pool {
* APR_JUST_WAIT -- wait forever for the process to complete
* APR_KILL_ONLY_ONCE -- send SIGTERM and then wait
* </PRE>
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void noteSubprocess(long a, long proc, int how);
/**
@@ -116,7 +134,10 @@ public class Pool {
* @param p The pool to allocate from
* @param size The amount of memory to allocate
* @return The ByteBuffer with allocated memory
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native ByteBuffer alloc(long p, int size);
/**
@@ -124,7 +145,10 @@ public class Pool {
* @param p The pool to allocate from
* @param size The amount of memory to allocate
* @return The ByteBuffer with allocated memory
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native ByteBuffer calloc(long p, int size);
/*
@@ -142,7 +166,10 @@ public class Pool {
* Object attached to the pool will be globally referenced
* until the pool is cleared or dataSet is called with the null data.
* @return APR Status code.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native int dataSet(long pool, String key, Object data);
/**
@@ -150,13 +177,19 @@ public class Pool {
* @param key The key for the data to retrieve
* @param pool The current pool.
* @return the data
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native Object dataGet(long pool, String key);
/**
* Run all of the child_cleanups, so that any unnecessary files are
* closed because we are about to exec a new program
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void cleanupForExec();
}
diff --git a/java/org/apache/tomcat/jni/SSL.java b/java/org/apache/tomcat/jni/SSL.java
index 316e6182e3..797df5293e 100644
--- a/java/org/apache/tomcat/jni/SSL.java
+++ b/java/org/apache/tomcat/jni/SSL.java
@@ -306,7 +306,10 @@ public final class SSL {
* In case both files are unavailable builtin
* random seed generator is used.
* @return <code>true</code> if the operation was successful
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native boolean randLoad(String filename);
/**
@@ -315,7 +318,10 @@ public final class SSL {
* by calling randLoad in a later session.
* @param filename Filename to save the data
* @return <code>true</code> if the operation was successful
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native boolean randSave(String filename);
/**
@@ -324,12 +330,16 @@ public final class SSL {
* @param len The length of random sequence in bytes
* @param base64 Output the data in Base64 encoded format
* @return <code>true</code> if the operation was successful
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native boolean randMake(String filename, int len,
boolean base64);
/**
* Sets global random filename.
+ *
* @param filename Filename to use.
* If set it will be used for SSL initialization
* and all contexts where explicitly not set.
@@ -342,7 +352,10 @@ public final class SSL {
* @param callback BIOCallback to use
* @return New BIO handle
* @throws Exception An error occurred
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native long newBIO(long pool, BIOCallback callback)
throws Exception;
@@ -350,25 +363,37 @@ public final class SSL {
* Close BIO and dereference callback object
* @param bio BIO to close and destroy.
* @return APR Status code
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native int closeBIO(long bio);
/**
* Set global Password callback for obtaining passwords.
* @param callback PasswordCallback implementation to use.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void setPasswordCallback(PasswordCallback callback);
/**
* Set global Password for decrypting certificates and keys.
* @param password Password to use.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void setPassword(String password);
/**
* Return last SSL error string
* @return the error string
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native String getLastError();
/**
@@ -382,7 +407,10 @@ public final class SSL {
* @param op Bitwise-OR of all SSL_OP_* to test.
*
* @return true if all SSL_OP_* are supported by OpenSSL library.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native boolean hasOp(int op);
/**
@@ -423,7 +451,10 @@ public final class SSL {
* @param ssl SSL pointer (SSL *)
* @param rbio read BIO pointer (BIO *)
* @param wbio write BIO pointer (BIO *)
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void setBIO(long ssl, long rbio, long wbio);
/**
@@ -431,7 +462,10 @@ public final class SSL {
* @param ssl SSL pointer (SSL *)
* @param ret TLS/SSL I/O return value
* @return the error status
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native int getError(long ssl, int ret);
/**
@@ -495,7 +529,10 @@ public final class SSL {
* SSL_set_shutdown
* @param ssl the SSL instance (SSL *)
* @param mode Shutdown mode
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void setShutdown(long ssl, int mode);
/**
diff --git a/java/org/apache/tomcat/jni/SSLContext.java b/java/org/apache/tomcat/jni/SSLContext.java
index 3dd7830f78..bb258e7a3a 100644
--- a/java/org/apache/tomcat/jni/SSLContext.java
+++ b/java/org/apache/tomcat/jni/SSLContext.java
@@ -69,7 +69,10 @@ public final class SSLContext {
* Set Session context id. Usually host:port combination.
* @param ctx Context to use.
* @param id String that uniquely identifies this context.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void setContextId(long ctx, String id);
/**
@@ -90,7 +93,10 @@ public final class SSLContext {
* @param ctx Server or Client context to use.
* @param bio BIO handle to use, created with SSL.newBIO
* @param dir BIO direction (1 for input 0 for output).
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void setBIO(long ctx, long bio, int dir);
/**
@@ -139,7 +145,10 @@ public final class SSLContext {
* The default is normal shutdown behaviour as described by the TLS standard.
* @param ctx Server or Client context to use.
* @param mode True to set the quiet shutdown.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void setQuietShutdown(long ctx, boolean mode);
/**
@@ -343,7 +352,10 @@ public final class SSLContext {
* Set file for randomness
* @param ctx Server or Client context to use.
* @param file random file.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void setRandom(long ctx, String file);
/**
@@ -357,7 +369,10 @@ public final class SSLContext {
* </PRE>
* @param ctx Server or Client context to use.
* @param type Shutdown type to use.
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void setShutdownType(long ctx, int type);
/**
@@ -395,6 +410,7 @@ public final class SSLContext {
*/
public static native void setVerify(long ctx, int level, int depth);
+ @Deprecated
public static native int setALPN(long ctx, byte[] proto, int len);
/**
@@ -444,7 +460,10 @@ public final class SSLContext {
* via connections initiated using
* <code>defaultSSLContext</code> to the correct OpenSSL
* SSLContext
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static void registerDefault(Long defaultSSLContext,
SNICallBack sniCallBack) {
sniCallBacks.put(defaultSSLContext, sniCallBack);
@@ -456,7 +475,10 @@ public final class SSLContext {
*
* @param defaultSSLContext The Java representation of a pointer to the
* OpenSSL SSLContext that will no longer be used
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static void unregisterDefault(Long defaultSSLContext) {
sniCallBacks.remove(defaultSSLContext);
}
@@ -528,7 +550,10 @@ public final class SSLContext {
* @param cert DH param file (can be generated from e.g. {@code openssl dhparam -rand - 2048 > dhparam.pem} -
* see the <a href="https://www.openssl.org/docs/apps/dhparam.html">OpenSSL documentation</a>).
* @throws Exception An error occurred
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void setTmpDH(long ctx, String cert)
throws Exception;
@@ -538,7 +563,10 @@ public final class SSLContext {
* @param curveName the name of the elliptic curve to use
* (available names can be obtained from {@code openssl ecparam -list_curves}).
* @throws Exception An error occurred
+ *
+ * @deprecated Unused. Will be removed in Tomcat 10.1
*/
+ @Deprecated
public static native void setTmpECDHByCurveName(long ctx, String curveName)
throws Exception;
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org