From: stephan Date: Mon, 4 Sep 2023 05:34:30 +0000 (+0000) Subject: Move an internal utility class out of the public Java API. X-Git-Tag: version-3.44.0~216^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4eaf5883b38496c98fcf786b1f53cfcce9fd4b98;p=thirdparty%2Fsqlite.git Move an internal utility class out of the public Java API. FossilOrigin-Name: 8e1ae3197a62796565b7260b230057bdb3f136edd00a83f8a63532d44d386243 --- diff --git a/ext/jni/GNUmakefile b/ext/jni/GNUmakefile index 1e0b33be0a..2b48768e4c 100644 --- a/ext/jni/GNUmakefile +++ b/ext/jni/GNUmakefile @@ -92,7 +92,6 @@ JAVA_FILES.main := $(patsubst %,$(dir.src.jni)/%,\ TableColumnMetadata.java \ TraceV2Callback.java \ UpdateHookCallback.java \ - ValueHolder.java \ WindowFunction.java \ XDestroyCallback.java \ sqlite3.java \ diff --git a/ext/jni/src/org/sqlite/jni/Fts5.java b/ext/jni/src/org/sqlite/jni/Fts5.java index 3135db96d3..6e61c4149d 100644 --- a/ext/jni/src/org/sqlite/jni/Fts5.java +++ b/ext/jni/src/org/sqlite/jni/Fts5.java @@ -16,10 +16,8 @@ package org.sqlite.jni; /** INCOMPLETE AND COMPLETELY UNTESTED. - A wrapper for communicating C-level (fts5_api*) instances with - Java. These wrappers do not own their associated pointer, they - simply provide a type-safe way to communicate it between Java and C - via JNI. + A utility object for holding FTS5-specific types and constants + which are used by multiple FTS5 classes. */ public final class Fts5 { /* Not used */ diff --git a/ext/jni/src/org/sqlite/jni/Tester1.java b/ext/jni/src/org/sqlite/jni/Tester1.java index 02a4d4a47a..01e4ab18d5 100644 --- a/ext/jni/src/org/sqlite/jni/Tester1.java +++ b/ext/jni/src/org/sqlite/jni/Tester1.java @@ -38,6 +38,17 @@ import java.util.concurrent.Future; @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) @interface SingleThreadOnly{} +/** + A helper class which simply holds a single value. Its current use + is for communicating values out of anonymous classes, as doing so + requires a "final" reference. +*/ +class ValueHolder { + public T value; + public ValueHolder(){} + public ValueHolder(T v){value = v;} +} + public class Tester1 implements Runnable { //! True when running in multi-threaded mode. private static boolean mtMode = false; diff --git a/ext/jni/src/org/sqlite/jni/ValueHolder.java b/ext/jni/src/org/sqlite/jni/ValueHolder.java deleted file mode 100644 index 7f6a463ba5..0000000000 --- a/ext/jni/src/org/sqlite/jni/ValueHolder.java +++ /dev/null @@ -1,25 +0,0 @@ -/* -** 2023-07-21 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file is part of the JNI bindings for the sqlite3 C API. -*/ -package org.sqlite.jni; - -/** - A helper class which simply holds a single value. Its current use - is for communicating values out of anonymous classes, as doing so - requires a "final" reference. -*/ -public class ValueHolder { - public T value; - public ValueHolder(){} - public ValueHolder(T v){value = v;} -} diff --git a/ext/jni/src/org/sqlite/jni/annotation/NotNull.java b/ext/jni/src/org/sqlite/jni/annotation/NotNull.java index 02ff56896f..49003358db 100644 --- a/ext/jni/src/org/sqlite/jni/annotation/NotNull.java +++ b/ext/jni/src/org/sqlite/jni/annotation/NotNull.java @@ -2,17 +2,23 @@ package org.sqlite.jni.annotation; /** This annotation is for flagging parameters which may not legally be - null. When used in the context of callback methods which are - called into from the C APIs, this annotation communicates that the - C API will never pass a null value to the callback. + null or point to closed/finalized C-side resources. -

In the case of Java types which map directly to C struct types, - a closed/finalized resource is also considered to be null for - purposes this annotation because the effect C-side is the same as - if null is passed for a NotNull-annotated parameter.

+

In the case of Java types which map directly to C struct types + (e.g. {@link org.sqlite.jni.sqlite3}, {@link + org.sqlite.jni.sqlite3_stmt}, and {@link + org.sqlite.jni.sqlite3_context}), a closed/finalized resource is + also considered to be null for purposes this annotation because the + C-side effect of passing such a handle is the same as if null is + passed.

-

Passing a null for any parameter marked with this annoation - specifically invokes undefined behavior.

+

When used in the context of Java interfaces which are called + from the C APIs, this annotation communicates that the C API will + never pass a null value to the callback for that parameter.

+ +

Passing a null, for this annotation's definition of null, for + any parameter marked with this annoation specifically invokes + undefined behavior.

Note that the C-style API does not throw any exceptions on its own because it has a no-throw policy in order to retain its C-style diff --git a/manifest b/manifest index f7934d68f4..007295b3cb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Expose\ssqlite3_bind_parameter_name()\sto\sJNI.\sExtend\sthe\sdefinition\sof\snull\sfor\sthe\s@NotNull\sannotation,\sto\sconsider\sclosed/finalized\sJava-side\shandles\swrapping\sC-side\sresources\sas\snull\sfor\sits\spurposes. -D 2023-09-04T04:23:31.856 +C Move\san\sinternal\sutility\sclass\sout\sof\sthe\spublic\sJava\sAPI. +D 2023-09-04T05:34:30.074 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -234,7 +234,7 @@ F ext/fts5/tool/showfts5.tcl d54da0e067306663e2d5d523965ca487698e722c F ext/icu/README.txt 7ab7ced8ae78e3a645b57e78570ff589d4c672b71370f5aa9e1cd7024f400fc9 F ext/icu/icu.c c074519b46baa484bb5396c7e01e051034da8884bad1a1cb7f09bbe6be3f0282 F ext/icu/sqliteicu.h fa373836ed5a1ee7478bdf8a1650689294e41d0c89c1daab26e9ae78a32075a8 -F ext/jni/GNUmakefile 7bd7f0c28d664b71b08f9d8ff507eb8329f1f3e7b5d88f774f90a1a5259a3fe8 +F ext/jni/GNUmakefile 2ae5e34ad21da48a8c1dd6e9e421d6bbb78716e3a03ad29dd86d9bd530ee3fc0 F ext/jni/README.md 1332b1fa27918bd5d9ca2d0d4f3ac3a6ab86b9e3699dc5bfe32904a027f3d2a9 F ext/jni/jar-dist.make 030aaa4ae71dd86e4ec5e7c1e6cd86f9dfa47c4592c070d2e35157e42498e1fa F ext/jni/src/c/sqlite3-jni.c 4b6f4295378c198b145d402ca84af1f70fa242d713e1cfb37c0c10ab7d4d5cd0 @@ -250,7 +250,7 @@ F ext/jni/src/org/sqlite/jni/CollationNeededCallback.java 07df5fa161a0b811542952 F ext/jni/src/org/sqlite/jni/CommitHookCallback.java 77cf8bb4f5548113e9792978f3f8a454614f420fa0ad73939421cbff4e7776f2 F ext/jni/src/org/sqlite/jni/ConfigLogCallback.java 636ed6b89ed03f15bc2a6f6f47bf7853b8328e5a8269e52e80630708efa703a6 F ext/jni/src/org/sqlite/jni/ConfigSqllogCallback.java e3656909eab7ed0f7e457c5b82df160ca22dd5e954c0a306ec1fca61b0d266b4 -F ext/jni/src/org/sqlite/jni/Fts5.java 3ebfbd5b95fdb9d7bc40306f2e682abd12e247d9224e92510b8dd103b4f96fe8 +F ext/jni/src/org/sqlite/jni/Fts5.java 09b3bfca6762420fa57a24df0ef797e5b31071a5dd1891d0e22a811b6e520b42 F ext/jni/src/org/sqlite/jni/Fts5Context.java 0a5a02047a6a1dd3e4a38b0e542a8dd2de365033ba30e6ae019a676305959890 F ext/jni/src/org/sqlite/jni/Fts5ExtensionApi.java 6ac342951c5805b48ba1e46dd41dff3b74c609dc5bf1c26fca5738db36493031 F ext/jni/src/org/sqlite/jni/Fts5PhraseIter.java 6642beda341c0b1b46af4e2d7f6f9ab03a7aede43277b2c92859176d6bce3be9 @@ -265,15 +265,14 @@ F ext/jni/src/org/sqlite/jni/SQLFunction.java 544a875d33fd160467d82e2397ac33157b F ext/jni/src/org/sqlite/jni/SQLite3Jni.java a1beb9f9953bfaf76824239d8f556c81a3d8ea81f89307817e17d2cb0cbf7c9c F ext/jni/src/org/sqlite/jni/ScalarFunction.java 6d387bb499fbe3bc13c53315335233dbf6a0c711e8fa7c521683219b041c614c F ext/jni/src/org/sqlite/jni/TableColumnMetadata.java 54511b4297fa28dcb3f49b24035e34ced10e3fd44fd0e458e784f4d6b0096dab -F ext/jni/src/org/sqlite/jni/Tester1.java e536ad7d647abeab72e060b1b90f80db17f07e20908e7247667b40645595ef99 +F ext/jni/src/org/sqlite/jni/Tester1.java 79f64479297329cc98ad6401c506864750f5812449f896b696d6dbfa5af8355a F ext/jni/src/org/sqlite/jni/TesterFts5.java 1d127690daac4751300b277a14c09faa0cefd1efa365580cd8d95ea658e1ee59 F ext/jni/src/org/sqlite/jni/TraceV2Callback.java beb0b064c1a5f8bfe585a324ed39a4e33edbe379a3fc60f1401661620d3ca7c0 F ext/jni/src/org/sqlite/jni/UpdateHookCallback.java 8376f4a931f2d5612b295c003c9515ba933ee76d8f95610e89c339727376e36c -F ext/jni/src/org/sqlite/jni/ValueHolder.java f022873abaabf64f3dd71ab0d6037c6e71cece3b8819fa10bf26a5461dc973ee F ext/jni/src/org/sqlite/jni/WindowFunction.java 488980f4dbb6bdd7067d6cb9c43e4075475e51c54d9b74a5834422654b126246 F ext/jni/src/org/sqlite/jni/XDestroyCallback.java 50c5ca124ef6c6b735a7e136e7a23a557be367e61b56d4aab5777a614ab46cc2 F ext/jni/src/org/sqlite/jni/annotation/Canonical.java 2767daa5b3893b96729db80a0f8234d379d266d1b2c21400a057864b538a0ea5 -F ext/jni/src/org/sqlite/jni/annotation/NotNull.java 7e7268749fccb8e110876642b31e7d7defdd95193de1c2f5f8ed34a9d6e4620b +F ext/jni/src/org/sqlite/jni/annotation/NotNull.java d9b32956cb9fb11d1f8a562e5df70d0599820265285120c63858294dbe2b7711 F ext/jni/src/org/sqlite/jni/annotation/Nullable.java 6f962a98c9a5c6e9d21c50ae8716b16bdfdc934a191608cbb7e12ea588ddb6af F ext/jni/src/org/sqlite/jni/annotation/package-info.java f66bfb621c6494e67c03ed38a9e26a3bd6af99b9f9f6ef79556bcec30a025a22 F ext/jni/src/org/sqlite/jni/fts5_api.java bf7009a7fd2d11a77280380e6e2c7f98e377494b3f265e50fc44cbb9a24275d9 @@ -2118,8 +2117,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 85952b4a52a09e9da35754c1a1ec70b1bf277296011a2d37ac536b33437223d7 -R 7a15b2696dc9747d7a1ea502837a695b +P fc34e2bfa4a2255f019a2514367e58596837289de49f7fab87279c8b40c7f119 +R 768a12cfd33f550248c1b9dce66d5e0b U stephan -Z 236a641f15efc93fed4a9f543212d185 +Z 1c5b437e775779fe47dd6a40997032e6 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 241119d30c..f84fffe1b1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -fc34e2bfa4a2255f019a2514367e58596837289de49f7fab87279c8b40c7f119 \ No newline at end of file +8e1ae3197a62796565b7260b230057bdb3f136edd00a83f8a63532d44d386243 \ No newline at end of file