From 0203a19c478ebbb9944d7ffe6180f09a53b18202 Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee Date: Tue, 5 Mar 2024 20:32:42 +0530 Subject: [PATCH 01/59] version bumped to 4.2.3-SNAPSHOT --- nitrite-bom/pom.xml | 2 +- nitrite-jackson-mapper/pom.xml | 2 +- nitrite-mvstore-adapter/pom.xml | 2 +- nitrite-rocksdb-adapter/pom.xml | 2 +- nitrite-spatial/pom.xml | 2 +- nitrite-support/pom.xml | 2 +- nitrite/pom.xml | 2 +- pom.xml | 2 +- potassium-nitrite/pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/nitrite-bom/pom.xml b/nitrite-bom/pom.xml index c3e28959..e3719896 100644 --- a/nitrite-bom/pom.xml +++ b/nitrite-bom/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.2-SNAPSHOT + 4.2.3-SNAPSHOT nitrite-bom diff --git a/nitrite-jackson-mapper/pom.xml b/nitrite-jackson-mapper/pom.xml index df293eb8..1c4669bb 100644 --- a/nitrite-jackson-mapper/pom.xml +++ b/nitrite-jackson-mapper/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.2-SNAPSHOT + 4.2.3-SNAPSHOT nitrite-jackson-mapper diff --git a/nitrite-mvstore-adapter/pom.xml b/nitrite-mvstore-adapter/pom.xml index 910a6956..2e9a7be3 100644 --- a/nitrite-mvstore-adapter/pom.xml +++ b/nitrite-mvstore-adapter/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.2-SNAPSHOT + 4.2.3-SNAPSHOT nitrite-mvstore-adapter diff --git a/nitrite-rocksdb-adapter/pom.xml b/nitrite-rocksdb-adapter/pom.xml index aa194a07..fc4ae6ef 100644 --- a/nitrite-rocksdb-adapter/pom.xml +++ b/nitrite-rocksdb-adapter/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.2-SNAPSHOT + 4.2.3-SNAPSHOT nitrite-rocksdb-adapter diff --git a/nitrite-spatial/pom.xml b/nitrite-spatial/pom.xml index e18183f9..9ae86a27 100644 --- a/nitrite-spatial/pom.xml +++ b/nitrite-spatial/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.2-SNAPSHOT + 4.2.3-SNAPSHOT nitrite-spatial diff --git a/nitrite-support/pom.xml b/nitrite-support/pom.xml index 1b391494..c6cce111 100644 --- a/nitrite-support/pom.xml +++ b/nitrite-support/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.2-SNAPSHOT + 4.2.3-SNAPSHOT nitrite-support diff --git a/nitrite/pom.xml b/nitrite/pom.xml index 3ce14ef9..ca7cd8b1 100644 --- a/nitrite/pom.xml +++ b/nitrite/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.2-SNAPSHOT + 4.2.3-SNAPSHOT nitrite diff --git a/pom.xml b/pom.xml index 1fcd88c3..c4cd4b35 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.2-SNAPSHOT + 4.2.3-SNAPSHOT pom Nitrite Database diff --git a/potassium-nitrite/pom.xml b/potassium-nitrite/pom.xml index 72068dd1..18602dd8 100644 --- a/potassium-nitrite/pom.xml +++ b/potassium-nitrite/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.2-SNAPSHOT + 4.2.3-SNAPSHOT potassium-nitrite From 4fc63a4a405ff53356f8675b9e9f0cca43a194cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 23:22:42 +0530 Subject: [PATCH 02/59] Bump jakarta.xml.bind:jakarta.xml.bind-api from 4.0.1 to 4.0.2 (#924) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c4cd4b35..aae4c695 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ 2.12.7 2.0.3 2.2 - 4.0.1 + 4.0.2 4.0.4 1.0.2 33.0.0-jre From fdec12cd42199c2af7b4713226c635e9f57ca51f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Mar 2024 07:58:14 +0530 Subject: [PATCH 03/59] Bump com.sun.xml.bind:jaxb-impl from 4.0.4 to 4.0.5 (#925) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aae4c695..c631479c 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ 2.0.3 2.2 4.0.2 - 4.0.4 + 4.0.5 1.0.2 33.0.0-jre 1.6.8 From 044ab73d3b74f3d44f63dfdec04fc2f36858034e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Mar 2024 14:24:17 +0530 Subject: [PATCH 04/59] Bump kotlin.version from 1.9.22 to 1.9.23 (#923) Bumps `kotlin.version` from 1.9.22 to 1.9.23. Updates `org.jetbrains.kotlin:kotlin-stdlib` from 1.9.22 to 1.9.23 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.9.23/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.9.22...v1.9.23) Updates `org.jetbrains.kotlin:kotlin-reflect` from 1.9.22 to 1.9.23 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.9.23/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.9.22...v1.9.23) Updates `org.jetbrains.kotlin:kotlin-test` from 1.9.22 to 1.9.23 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.9.23/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.9.22...v1.9.23) Updates `org.jetbrains.kotlin:kotlin-test-junit` from 1.9.22 to 1.9.23 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.9.23/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.9.22...v1.9.23) Updates `org.jetbrains.kotlin:kotlin-maven-serialization` from 1.9.22 to 1.9.23 Updates `org.jetbrains.kotlin:kotlin-maven-plugin` from 1.9.22 to 1.9.23 --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-stdlib dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-reflect dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-test dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-test-junit dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-maven-serialization dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c631479c..95986434 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.19.0 1.16.1 2.15.1 - 1.9.22 + 1.9.23 1.6.3 1.18.30 1.18.20.0 From 7640762f9b7f0c51ce14ab95f3416258e57a0e62 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 23:44:30 +0530 Subject: [PATCH 05/59] Bump log4j.version from 2.23.0 to 2.23.1 (#927) Bumps `log4j.version` from 2.23.0 to 2.23.1. Updates `org.apache.logging.log4j:log4j-api` from 2.23.0 to 2.23.1 Updates `org.apache.logging.log4j:log4j-slf4j2-impl` from 2.23.0 to 2.23.1 Updates `org.apache.logging.log4j:log4j-core` from 2.23.0 to 2.23.1 --- updated-dependencies: - dependency-name: org.apache.logging.log4j:log4j-api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.logging.log4j:log4j-slf4j2-impl dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.logging.log4j:log4j-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 95986434..dc2c43dc 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 4.13.2 5.11.0 8.0.1.RELEASE - 2.23.0 + 2.23.1 4.2.0 2.12.7 2.0.3 From 702ea63b8885b2efafbaaa2dd087f15084ab41ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 23:44:40 +0530 Subject: [PATCH 06/59] Bump jackson.version from 2.16.1 to 2.16.2 (#928) Bumps `jackson.version` from 2.16.1 to 2.16.2. Updates `com.fasterxml.jackson.core:jackson-databind` from 2.16.1 to 2.16.2 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.datatype:jackson-datatype-jsr310` from 2.16.1 to 2.16.2 Updates `com.fasterxml.jackson.datatype:jackson-datatype-jdk8` from 2.16.1 to 2.16.2 Updates `com.fasterxml.jackson.module:jackson-module-kotlin` from 2.16.1 to 2.16.2 - [Commits](https://github.com/FasterXML/jackson-module-kotlin/compare/jackson-module-kotlin-2.16.1...jackson-module-kotlin-2.16.2) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jdk8 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.module:jackson-module-kotlin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dc2c43dc..c3618076 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ 11 11 UTF-8 - 2.16.1 + 2.16.2 2.0.12 1.9.3 2.2.224 From 8d6dba19e1485bce6f7c75585c3ee72a5e491748 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 23:44:51 +0530 Subject: [PATCH 07/59] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.1.0 to 3.2.0 (#929) Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.1.0 to 3.2.0. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.1.0...maven-gpg-plugin-3.2.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c3618076..21a5a276 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 1.23 7.0_r2 1.6.13 - 3.1.0 + 3.2.0 From 687dac27c48f146b436a50a8e07cbb892230abc4 Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee <696662+anidotnet@users.noreply.github.com> Date: Tue, 12 Mar 2024 21:11:44 +0530 Subject: [PATCH 08/59] JPMS support added (#930) * JPMS module support added * jar plugin modified --- nitrite-bom/pom.xml | 2 +- nitrite-jackson-mapper/pom.xml | 13 ++++++++++++- nitrite-mvstore-adapter/pom.xml | 13 ++++++++++++- nitrite-rocksdb-adapter/pom.xml | 13 ++++++++++++- nitrite-spatial/pom.xml | 13 ++++++++++++- nitrite-support/pom.xml | 13 ++++++++++++- nitrite/pom.xml | 13 ++++++++++++- pom.xml | 2 +- potassium-nitrite/pom.xml | 13 ++++++++++++- 9 files changed, 86 insertions(+), 9 deletions(-) diff --git a/nitrite-bom/pom.xml b/nitrite-bom/pom.xml index e3719896..2adcda87 100644 --- a/nitrite-bom/pom.xml +++ b/nitrite-bom/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.3-SNAPSHOT + 4.3.0-SNAPSHOT nitrite-bom diff --git a/nitrite-jackson-mapper/pom.xml b/nitrite-jackson-mapper/pom.xml index 1c4669bb..3828db19 100644 --- a/nitrite-jackson-mapper/pom.xml +++ b/nitrite-jackson-mapper/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.3-SNAPSHOT + 4.3.0-SNAPSHOT nitrite-jackson-mapper @@ -144,6 +144,17 @@ org.sonatype.plugins nexus-staging-maven-plugin + + org.apache.maven.plugins + maven-jar-plugin + + + + org.dizitart.no2.jackson + + + + diff --git a/nitrite-mvstore-adapter/pom.xml b/nitrite-mvstore-adapter/pom.xml index 2e9a7be3..4409d86c 100644 --- a/nitrite-mvstore-adapter/pom.xml +++ b/nitrite-mvstore-adapter/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.3-SNAPSHOT + 4.3.0-SNAPSHOT nitrite-mvstore-adapter @@ -182,6 +182,17 @@ org.sonatype.plugins nexus-staging-maven-plugin + + org.apache.maven.plugins + maven-jar-plugin + + + + org.dizitart.no2.mvstore + + + + diff --git a/nitrite-rocksdb-adapter/pom.xml b/nitrite-rocksdb-adapter/pom.xml index fc4ae6ef..b7acfa61 100644 --- a/nitrite-rocksdb-adapter/pom.xml +++ b/nitrite-rocksdb-adapter/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.3-SNAPSHOT + 4.3.0-SNAPSHOT nitrite-rocksdb-adapter @@ -180,6 +180,17 @@ org.sonatype.plugins nexus-staging-maven-plugin + + org.apache.maven.plugins + maven-jar-plugin + + + + org.dizitart.no2.rocksdb + + + + diff --git a/nitrite-spatial/pom.xml b/nitrite-spatial/pom.xml index 9ae86a27..53bb5b24 100644 --- a/nitrite-spatial/pom.xml +++ b/nitrite-spatial/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.3-SNAPSHOT + 4.3.0-SNAPSHOT nitrite-spatial @@ -125,6 +125,17 @@ org.sonatype.plugins nexus-staging-maven-plugin + + org.apache.maven.plugins + maven-jar-plugin + + + + org.dizitart.no2.spatial + + + + diff --git a/nitrite-support/pom.xml b/nitrite-support/pom.xml index c6cce111..a4769f78 100644 --- a/nitrite-support/pom.xml +++ b/nitrite-support/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.3-SNAPSHOT + 4.3.0-SNAPSHOT nitrite-support @@ -133,6 +133,17 @@ org.sonatype.plugins nexus-staging-maven-plugin + + org.apache.maven.plugins + maven-jar-plugin + + + + org.dizitart.no2.support + + + + diff --git a/nitrite/pom.xml b/nitrite/pom.xml index ca7cd8b1..9025cbbc 100644 --- a/nitrite/pom.xml +++ b/nitrite/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.3-SNAPSHOT + 4.3.0-SNAPSHOT nitrite @@ -218,6 +218,17 @@ org.sonatype.plugins nexus-staging-maven-plugin + + org.apache.maven.plugins + maven-jar-plugin + + + + org.dizitart.no2 + + + + diff --git a/pom.xml b/pom.xml index 21a5a276..6622de6c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.3-SNAPSHOT + 4.3.0-SNAPSHOT pom Nitrite Database diff --git a/potassium-nitrite/pom.xml b/potassium-nitrite/pom.xml index 18602dd8..f8468cfa 100644 --- a/potassium-nitrite/pom.xml +++ b/potassium-nitrite/pom.xml @@ -4,7 +4,7 @@ org.dizitart nitrite-java - 4.2.3-SNAPSHOT + 4.3.0-SNAPSHOT potassium-nitrite @@ -166,6 +166,17 @@ org.sonatype.plugins nexus-staging-maven-plugin + + org.apache.maven.plugins + maven-jar-plugin + + + + org.dizitart.kno2 + + + + From 185989df82937a6012004c99147552b777296a29 Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee Date: Tue, 12 Mar 2024 21:54:33 +0530 Subject: [PATCH 09/59] changelog updated --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d248a2f1..7eb3d88d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Release 4.3.0 + +### New Changes + +- Nitrite now supports JPMS. It is now modular and can be used in Java 9 or above. + ## Release 4.2.2 - Mar 5, 2024 ### Issue Fixes From d380b66784f9eca6dfb991a4ca2df6316480b0e8 Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee Date: Tue, 12 Mar 2024 21:57:32 +0530 Subject: [PATCH 10/59] changelog updated --- .github/workflows/build.yml | 1 + CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0edba690..df10d2af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,7 @@ on: - release paths-ignore: - "README.md" + - "CHANGELOG.md" jobs: build_linux: diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eb3d88d..669dda3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### New Changes - Nitrite now supports JPMS. It is now modular and can be used in Java 9 or above. +- Version upgrade for several dependencies ## Release 4.2.2 - Mar 5, 2024 From 77ff09268d92225798557b1cdae621183555a49d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 23:04:51 +0530 Subject: [PATCH 11/59] Bump com.google.errorprone:error_prone_core from 2.25.0 to 2.26.0 (#932) Bumps [com.google.errorprone:error_prone_core](https://github.com/google/error-prone) from 2.25.0 to 2.26.0. - [Release notes](https://github.com/google/error-prone/releases) - [Commits](https://github.com/google/error-prone/compare/v2.25.0...v2.26.0) --- updated-dependencies: - dependency-name: com.google.errorprone:error_prone_core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6622de6c..0eb97a72 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 33.0.0-jre 1.6.8 - 2.25.0 + 2.26.0 0.8.11 3.2.5 3.12.1 From e75c80402b52155dca2245664f366a8851063088 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 08:06:02 +0530 Subject: [PATCH 12/59] Bump com.google.errorprone:error_prone_core from 2.26.0 to 2.26.1 (#934) Bumps [com.google.errorprone:error_prone_core](https://github.com/google/error-prone) from 2.26.0 to 2.26.1. - [Release notes](https://github.com/google/error-prone/releases) - [Commits](https://github.com/google/error-prone/compare/v2.26.0...v2.26.1) --- updated-dependencies: - dependency-name: com.google.errorprone:error_prone_core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0eb97a72..8ee4f5df 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 33.0.0-jre 1.6.8 - 2.26.0 + 2.26.1 0.8.11 3.2.5 3.12.1 From 835de1969078fd2cc3f96d27964abd73367cea6c Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee <696662+anidotnet@users.noreply.github.com> Date: Thu, 14 Mar 2024 10:18:11 +0530 Subject: [PATCH 13/59] fixes #935 (#936) --- CHANGELOG.md | 4 + .../no2/common/mapper/JacksonMapperTest.java | 161 +----------------- .../collection/CollectionFindTest.java | 28 +++ .../collection/CollectionFindTest.java | 28 +++ .../collection/operation/ReadOperations.java | 8 +- .../collection/CollectionFindTest.java | 28 +++ 6 files changed, 95 insertions(+), 162 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 669dda3b..8b17b1a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ - Nitrite now supports JPMS. It is now modular and can be used in Java 9 or above. - Version upgrade for several dependencies +### Issue Fixes + +- Fix for #935 + ## Release 4.2.2 - Mar 5, 2024 ### Issue Fixes diff --git a/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/common/mapper/JacksonMapperTest.java b/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/common/mapper/JacksonMapperTest.java index 4bf36c02..87efabe0 100644 --- a/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/common/mapper/JacksonMapperTest.java +++ b/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/common/mapper/JacksonMapperTest.java @@ -17,183 +17,24 @@ package org.dizitart.no2.common.mapper; -import com.fasterxml.jackson.databind.DeserializationConfig; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.cfg.ContextAttributes; -import com.fasterxml.jackson.databind.introspect.VisibilityChecker; -import com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator; -import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.BinaryNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import org.dizitart.no2.NitriteConfig; -import org.dizitart.no2.common.mapper.modules.NitriteIdModule; import org.dizitart.no2.exceptions.ObjectMappingException; import org.junit.Test; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; -import java.text.DateFormat; import static org.junit.Assert.*; public class JacksonMapperTest { - @Test - public void testConstructor() { - ObjectMapper objectMapper = (new JacksonMapper()).getObjectMapper(); - PolymorphicTypeValidator polymorphicTypeValidator = objectMapper.getPolymorphicTypeValidator(); - assertTrue(polymorphicTypeValidator instanceof LaissezFaireSubTypeValidator); - VisibilityChecker visibilityChecker = objectMapper.getVisibilityChecker(); - assertTrue(visibilityChecker instanceof VisibilityChecker.Std); - assertNull(objectMapper.getPropertyNamingStrategy()); - assertTrue(objectMapper - .getDeserializationContext() instanceof com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.Impl); - assertSame(objectMapper.getFactory(), objectMapper.getJsonFactory()); - assertTrue(objectMapper.getSerializerFactory() instanceof com.fasterxml.jackson.databind.ser.BeanSerializerFactory); - assertTrue(objectMapper - .getSerializerProvider() instanceof com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.Impl); - assertTrue(objectMapper - .getSerializerProviderInstance() instanceof com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.Impl); - assertTrue( - objectMapper.getSubtypeResolver() instanceof com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver); - DeserializationConfig deserializationConfig = objectMapper.getDeserializationConfig(); - assertTrue(deserializationConfig - .getAnnotationIntrospector() instanceof com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector); - assertNull(deserializationConfig.getActiveView()); - assertNull(deserializationConfig.getHandlerInstantiator()); - assertSame(visibilityChecker, deserializationConfig.getDefaultVisibilityChecker()); - assertTrue(deserializationConfig - .getClassIntrospector() instanceof com.fasterxml.jackson.databind.introspect.BasicClassIntrospector); - DateFormat expectedDateFormat = objectMapper.getDateFormat(); - assertSame(expectedDateFormat, deserializationConfig.getDateFormat()); - assertNull(deserializationConfig.getFullRootName()); - JsonNodeFactory expectedNodeFactory = objectMapper.getNodeFactory(); - assertSame(expectedNodeFactory, deserializationConfig.getNodeFactory()); - assertSame(polymorphicTypeValidator, deserializationConfig.getPolymorphicTypeValidator()); - assertNull(deserializationConfig.getDefaultMergeable()); - assertEquals(237020288, deserializationConfig.getDeserializationFeatures()); - assertTrue(deserializationConfig.getAttributes() instanceof ContextAttributes.Impl); - } - - @Test - public void testConstructor2() { - NitriteIdModule nitriteIdModule = new NitriteIdModule(); - NitriteIdModule nitriteIdModule1 = new NitriteIdModule(); - JacksonMapper jacksonMapper = new JacksonMapper(); - jacksonMapper.registerJacksonModule(nitriteIdModule); - jacksonMapper.registerJacksonModule(nitriteIdModule1); - jacksonMapper.registerJacksonModule(new NitriteIdModule()); - ObjectMapper objectMapper = jacksonMapper.getObjectMapper(); - PolymorphicTypeValidator polymorphicTypeValidator = objectMapper.getPolymorphicTypeValidator(); - assertTrue(polymorphicTypeValidator instanceof LaissezFaireSubTypeValidator); - VisibilityChecker visibilityChecker = objectMapper.getVisibilityChecker(); - assertTrue(visibilityChecker instanceof VisibilityChecker.Std); - assertNull(objectMapper.getPropertyNamingStrategy()); - assertTrue(objectMapper - .getDeserializationContext() instanceof com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.Impl); - assertSame(objectMapper.getFactory(), objectMapper.getJsonFactory()); - assertTrue(objectMapper.getSerializerFactory() instanceof com.fasterxml.jackson.databind.ser.BeanSerializerFactory); - assertTrue(objectMapper - .getSerializerProvider() instanceof com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.Impl); - assertTrue(objectMapper - .getSerializerProviderInstance() instanceof com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.Impl); - assertTrue( - objectMapper.getSubtypeResolver() instanceof com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver); - DeserializationConfig deserializationConfig = objectMapper.getDeserializationConfig(); - assertTrue(deserializationConfig - .getAnnotationIntrospector() instanceof com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector); - assertNull(deserializationConfig.getActiveView()); - assertNull(deserializationConfig.getHandlerInstantiator()); - assertSame(visibilityChecker, deserializationConfig.getDefaultVisibilityChecker()); - assertTrue(deserializationConfig - .getClassIntrospector() instanceof com.fasterxml.jackson.databind.introspect.BasicClassIntrospector); - DateFormat expectedDateFormat = objectMapper.getDateFormat(); - assertSame(expectedDateFormat, deserializationConfig.getDateFormat()); - assertNull(deserializationConfig.getFullRootName()); - JsonNodeFactory expectedNodeFactory = objectMapper.getNodeFactory(); - assertSame(expectedNodeFactory, deserializationConfig.getNodeFactory()); - assertSame(polymorphicTypeValidator, deserializationConfig.getPolymorphicTypeValidator()); - assertNull(deserializationConfig.getDefaultMergeable()); - assertEquals(237020288, deserializationConfig.getDeserializationFeatures()); - assertTrue(deserializationConfig.getAttributes() instanceof ContextAttributes.Impl); - } - - @Test - public void testConstructor3() { - JacksonMapper jacksonMapper = new JacksonMapper(); - jacksonMapper.registerJacksonModule(new NitriteIdModule()); - ObjectMapper objectMapper = jacksonMapper.getObjectMapper(); - PolymorphicTypeValidator polymorphicTypeValidator = objectMapper.getPolymorphicTypeValidator(); - assertTrue(polymorphicTypeValidator instanceof LaissezFaireSubTypeValidator); - VisibilityChecker visibilityChecker = objectMapper.getVisibilityChecker(); - assertTrue(visibilityChecker instanceof VisibilityChecker.Std); - assertNull(objectMapper.getPropertyNamingStrategy()); - assertTrue(objectMapper - .getDeserializationContext() instanceof com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.Impl); - assertSame(objectMapper.getFactory(), objectMapper.getJsonFactory()); - assertTrue(objectMapper.getSerializerFactory() instanceof com.fasterxml.jackson.databind.ser.BeanSerializerFactory); - assertTrue(objectMapper - .getSerializerProvider() instanceof com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.Impl); - assertTrue(objectMapper - .getSerializerProviderInstance() instanceof com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.Impl); - assertTrue( - objectMapper.getSubtypeResolver() instanceof com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver); - DeserializationConfig deserializationConfig = objectMapper.getDeserializationConfig(); - assertTrue(deserializationConfig - .getAnnotationIntrospector() instanceof com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector); - assertNull(deserializationConfig.getActiveView()); - assertNull(deserializationConfig.getHandlerInstantiator()); - assertSame(visibilityChecker, deserializationConfig.getDefaultVisibilityChecker()); - assertTrue(deserializationConfig - .getClassIntrospector() instanceof com.fasterxml.jackson.databind.introspect.BasicClassIntrospector); - DateFormat expectedDateFormat = objectMapper.getDateFormat(); - assertSame(expectedDateFormat, deserializationConfig.getDateFormat()); - assertNull(deserializationConfig.getFullRootName()); - JsonNodeFactory expectedNodeFactory = objectMapper.getNodeFactory(); - assertSame(expectedNodeFactory, deserializationConfig.getNodeFactory()); - assertSame(polymorphicTypeValidator, deserializationConfig.getPolymorphicTypeValidator()); - assertNull(deserializationConfig.getDefaultMergeable()); - assertEquals(237020288, deserializationConfig.getDeserializationFeatures()); - assertTrue(deserializationConfig.getAttributes() instanceof ContextAttributes.Impl); - } - @Test public void testGetObjectMapper() { ObjectMapper actualCreateObjectMapperResult = (new JacksonMapper()).getObjectMapper(); - PolymorphicTypeValidator polymorphicTypeValidator = actualCreateObjectMapperResult.getPolymorphicTypeValidator(); - assertTrue(polymorphicTypeValidator instanceof LaissezFaireSubTypeValidator); - VisibilityChecker visibilityChecker = actualCreateObjectMapperResult.getVisibilityChecker(); - assertTrue(visibilityChecker instanceof VisibilityChecker.Std); - assertNull(actualCreateObjectMapperResult.getPropertyNamingStrategy()); - assertTrue(actualCreateObjectMapperResult - .getDeserializationContext() instanceof com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.Impl); - assertSame(actualCreateObjectMapperResult.getFactory(), actualCreateObjectMapperResult.getJsonFactory()); - assertTrue(actualCreateObjectMapperResult - .getSerializerFactory() instanceof com.fasterxml.jackson.databind.ser.BeanSerializerFactory); - assertTrue(actualCreateObjectMapperResult - .getSerializerProvider() instanceof com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.Impl); - assertTrue(actualCreateObjectMapperResult - .getSerializerProviderInstance() instanceof com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.Impl); - assertTrue(actualCreateObjectMapperResult - .getSubtypeResolver() instanceof com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver); - DeserializationConfig deserializationConfig = actualCreateObjectMapperResult.getDeserializationConfig(); - assertTrue(deserializationConfig.getAttributes() instanceof ContextAttributes.Impl); - assertTrue(deserializationConfig - .getAnnotationIntrospector() instanceof com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector); - assertNull(deserializationConfig.getActiveView()); - assertEquals(237020288, deserializationConfig.getDeserializationFeatures()); - DateFormat expectedDateFormat = actualCreateObjectMapperResult.getDateFormat(); - assertSame(expectedDateFormat, deserializationConfig.getDateFormat()); - assertNull(deserializationConfig.getDefaultMergeable()); - assertSame(visibilityChecker, deserializationConfig.getDefaultVisibilityChecker()); - assertNull(deserializationConfig.getHandlerInstantiator()); - JsonNodeFactory expectedNodeFactory = actualCreateObjectMapperResult.getNodeFactory(); - assertSame(expectedNodeFactory, deserializationConfig.getNodeFactory()); - assertSame(polymorphicTypeValidator, deserializationConfig.getPolymorphicTypeValidator()); - assertTrue(deserializationConfig - .getClassIntrospector() instanceof com.fasterxml.jackson.databind.introspect.BasicClassIntrospector); - assertNull(deserializationConfig.getFullRootName()); - assertNull(deserializationConfig.getProblemHandlers()); + assertNotNull(actualCreateObjectMapperResult); } @Test diff --git a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/collection/CollectionFindTest.java b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/collection/CollectionFindTest.java index 7dedc072..4d7814e5 100644 --- a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/collection/CollectionFindTest.java +++ b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/collection/CollectionFindTest.java @@ -822,4 +822,32 @@ public void testByIdFilter() { result = collection.find(or(byId(nitriteId), where("tag").eq(document.get("tag")))).firstOrNull(); assertEquals(document, result); } + + @Test + public void testByNonExistingId() { + Document doc1 = createDocument("age", 31).put("tag", "one"); + Document doc2 = createDocument("age", 32).put("tag", "two"); + Document doc3 = createDocument("age", 33).put("tag", "three"); + Document doc4 = createDocument("age", 34).put("tag", "four"); + Document doc5 = createDocument("age", 35).put("tag", "five"); + + NitriteCollection collection = db.getCollection("tag"); + collection.insert(doc1, doc2, doc3, doc4, doc5); + + NitriteId nitriteId = NitriteId.newId(); + Document result = collection.find(byId(nitriteId)).firstOrNull(); + assertNull(result); + + result = collection.find(and(byId(nitriteId), where("age").notEq(null))).firstOrNull(); + assertNull(result); + + result = collection.find(or(byId(nitriteId), where("tag").eq("one"))).firstOrNull(); + assertNotNull(result); + assertEquals(result.get("tag"), "one"); + + DocumentCursor cursor = collection.find(where("_id").eq(nitriteId.getIdValue())); + Iterator idIter = cursor.iterator(); + assertFalse(idIter.hasNext()); + assertEquals(cursor.size(), 0); + } } diff --git a/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/collection/CollectionFindTest.java b/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/collection/CollectionFindTest.java index 7dedc072..4d7814e5 100644 --- a/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/collection/CollectionFindTest.java +++ b/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/collection/CollectionFindTest.java @@ -822,4 +822,32 @@ public void testByIdFilter() { result = collection.find(or(byId(nitriteId), where("tag").eq(document.get("tag")))).firstOrNull(); assertEquals(document, result); } + + @Test + public void testByNonExistingId() { + Document doc1 = createDocument("age", 31).put("tag", "one"); + Document doc2 = createDocument("age", 32).put("tag", "two"); + Document doc3 = createDocument("age", 33).put("tag", "three"); + Document doc4 = createDocument("age", 34).put("tag", "four"); + Document doc5 = createDocument("age", 35).put("tag", "five"); + + NitriteCollection collection = db.getCollection("tag"); + collection.insert(doc1, doc2, doc3, doc4, doc5); + + NitriteId nitriteId = NitriteId.newId(); + Document result = collection.find(byId(nitriteId)).firstOrNull(); + assertNull(result); + + result = collection.find(and(byId(nitriteId), where("age").notEq(null))).firstOrNull(); + assertNull(result); + + result = collection.find(or(byId(nitriteId), where("tag").eq("one"))).firstOrNull(); + assertNotNull(result); + assertEquals(result.get("tag"), "one"); + + DocumentCursor cursor = collection.find(where("_id").eq(nitriteId.getIdValue())); + Iterator idIter = cursor.iterator(); + assertFalse(idIter.hasNext()); + assertEquals(cursor.size(), 0); + } } diff --git a/nitrite/src/main/java/org/dizitart/no2/collection/operation/ReadOperations.java b/nitrite/src/main/java/org/dizitart/no2/collection/operation/ReadOperations.java index 807b47d9..3cf02c57 100644 --- a/nitrite/src/main/java/org/dizitart/no2/collection/operation/ReadOperations.java +++ b/nitrite/src/main/java/org/dizitart/no2/collection/operation/ReadOperations.java @@ -136,8 +136,12 @@ private RecordStream> findSuitableStream(FindPlan find if (findPlan.getByIdFilter() != null) { FieldBasedFilter byIdFilter = findPlan.getByIdFilter(); NitriteId nitriteId = NitriteId.createId((String) byIdFilter.getValue()); - Document document = nitriteMap.get(nitriteId); - rawStream = RecordStream.single(pair(nitriteId, document)); + if (nitriteMap.containsKey(nitriteId)) { + Document document = nitriteMap.get(nitriteId); + rawStream = RecordStream.single(pair(nitriteId, document)); + } else { + rawStream = RecordStream.empty(); + } } else { IndexDescriptor indexDescriptor = findPlan.getIndexDescriptor(); if (indexDescriptor != null) { diff --git a/nitrite/src/test/java/org/dizitart/no2/integration/collection/CollectionFindTest.java b/nitrite/src/test/java/org/dizitart/no2/integration/collection/CollectionFindTest.java index 5fd70730..49c50118 100644 --- a/nitrite/src/test/java/org/dizitart/no2/integration/collection/CollectionFindTest.java +++ b/nitrite/src/test/java/org/dizitart/no2/integration/collection/CollectionFindTest.java @@ -852,4 +852,32 @@ public void testByIdFilter() { result = collection.find(or(byId(nitriteId), where("tag").eq(document.get("tag")))).firstOrNull(); assertEquals(document, result); } + + @Test + public void testByNonExistingId() { + Document doc1 = createDocument("age", 31).put("tag", "one"); + Document doc2 = createDocument("age", 32).put("tag", "two"); + Document doc3 = createDocument("age", 33).put("tag", "three"); + Document doc4 = createDocument("age", 34).put("tag", "four"); + Document doc5 = createDocument("age", 35).put("tag", "five"); + + NitriteCollection collection = db.getCollection("tag"); + collection.insert(doc1, doc2, doc3, doc4, doc5); + + NitriteId nitriteId = NitriteId.newId(); + Document result = collection.find(byId(nitriteId)).firstOrNull(); + assertNull(result); + + result = collection.find(and(byId(nitriteId), where("age").notEq(null))).firstOrNull(); + assertNull(result); + + result = collection.find(or(byId(nitriteId), where("tag").eq("one"))).firstOrNull(); + assertNotNull(result); + assertEquals(result.get("tag"), "one"); + + DocumentCursor cursor = collection.find(where("_id").eq(nitriteId.getIdValue())); + Iterator idIter = cursor.iterator(); + assertFalse(idIter.hasNext()); + assertEquals(cursor.size(), 0); + } } From f71058669e5363f5a54c2a7ed407c163c093a31a Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee Date: Thu, 14 Mar 2024 10:41:31 +0530 Subject: [PATCH 14/59] support test cases fixed --- .../support/exchange/BaseExternalTest.java | 3 +- .../no2/support/exchange/ExporterTest.java | 51 +------------------ 2 files changed, 3 insertions(+), 51 deletions(-) diff --git a/nitrite-support/src/test/java/org/dizitart/no2/support/exchange/BaseExternalTest.java b/nitrite-support/src/test/java/org/dizitart/no2/support/exchange/BaseExternalTest.java index e130914c..6e53f5ef 100644 --- a/nitrite-support/src/test/java/org/dizitart/no2/support/exchange/BaseExternalTest.java +++ b/nitrite-support/src/test/java/org/dizitart/no2/support/exchange/BaseExternalTest.java @@ -31,7 +31,6 @@ import org.junit.Rule; import java.io.File; -import java.io.IOException; import java.util.List; import java.util.UUID; @@ -64,7 +63,7 @@ public void setUp() { } @After - public void cleanUp() throws IOException { + public void cleanUp() { closeDb(); TestUtil.deleteDb(sourceDbFile); TestUtil.deleteDb(destDbFile); diff --git a/nitrite-support/src/test/java/org/dizitart/no2/support/exchange/ExporterTest.java b/nitrite-support/src/test/java/org/dizitart/no2/support/exchange/ExporterTest.java index e8a7b8e6..1d1dee73 100644 --- a/nitrite-support/src/test/java/org/dizitart/no2/support/exchange/ExporterTest.java +++ b/nitrite-support/src/test/java/org/dizitart/no2/support/exchange/ExporterTest.java @@ -1,62 +1,15 @@ package org.dizitart.no2.support.exchange; -import com.fasterxml.jackson.databind.DeserializationConfig; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.cfg.ContextAttributes; -import com.fasterxml.jackson.databind.introspect.VisibilityChecker; -import com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator; -import com.fasterxml.jackson.databind.jsontype.SubtypeResolver; -import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator; -import com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.type.TypeFactory; -import org.dizitart.no2.support.exchange.Exporter; import org.junit.Test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; public class ExporterTest { @Test public void testCreateObjectMapper() { ObjectMapper actualCreateObjectMapperResult = Exporter.createObjectMapper(); - DeserializationConfig deserializationConfig = actualCreateObjectMapperResult.getDeserializationConfig(); - assertTrue(actualCreateObjectMapperResult - .getSerializerFactory() instanceof com.fasterxml.jackson.databind.ser.BeanSerializerFactory); - PolymorphicTypeValidator polymorphicTypeValidator = actualCreateObjectMapperResult.getPolymorphicTypeValidator(); - assertTrue(polymorphicTypeValidator instanceof LaissezFaireSubTypeValidator); - assertTrue(actualCreateObjectMapperResult - .getDeserializationContext() instanceof com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.Impl); - assertSame(actualCreateObjectMapperResult.getFactory(), actualCreateObjectMapperResult.getJsonFactory()); - assertTrue(actualCreateObjectMapperResult - .getSerializerProviderInstance() instanceof com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.Impl); - VisibilityChecker visibilityChecker = actualCreateObjectMapperResult.getVisibilityChecker(); - assertTrue(visibilityChecker instanceof VisibilityChecker.Std); - assertNull(actualCreateObjectMapperResult.getPropertyNamingStrategy()); - assertTrue(actualCreateObjectMapperResult - .getSerializerProvider() instanceof com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.Impl); - SubtypeResolver subtypeResolver = actualCreateObjectMapperResult.getSubtypeResolver(); - assertTrue(subtypeResolver instanceof StdSubtypeResolver); - assertNull(deserializationConfig.getProblemHandlers()); - assertSame(visibilityChecker, deserializationConfig.getDefaultVisibilityChecker()); - assertTrue(deserializationConfig - .getClassIntrospector() instanceof com.fasterxml.jackson.databind.introspect.BasicClassIntrospector); - assertTrue(deserializationConfig.isAnnotationProcessingEnabled()); - assertNull(deserializationConfig.getPropertyNamingStrategy()); - TypeFactory expectedTypeFactory = actualCreateObjectMapperResult.getTypeFactory(); - assertSame(expectedTypeFactory, deserializationConfig.getTypeFactory()); - assertTrue(deserializationConfig.getAttributes() instanceof ContextAttributes.Impl); - JsonNodeFactory expectedNodeFactory = actualCreateObjectMapperResult.getNodeFactory(); - assertSame(expectedNodeFactory, deserializationConfig.getNodeFactory()); - assertNull(deserializationConfig.getDefaultMergeable()); - assertNull(deserializationConfig.getHandlerInstantiator()); - assertSame(actualCreateObjectMapperResult.getDateFormat(), deserializationConfig.getDateFormat()); - assertNull(deserializationConfig.getFullRootName()); - assertNull(deserializationConfig.getActiveView()); - assertEquals(237020288, deserializationConfig.getDeserializationFeatures()); - assertSame(subtypeResolver, deserializationConfig.getSubtypeResolver()); - assertTrue(deserializationConfig - .getAnnotationIntrospector() instanceof com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector); - assertSame(polymorphicTypeValidator, deserializationConfig.getPolymorphicTypeValidator()); + assertNotNull(actualCreateObjectMapperResult); } } From 1bda5ccc202c8dd04f95a52dc2c7a6249681d159 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 15:52:07 +0530 Subject: [PATCH 15/59] Bump jackson.version from 2.16.2 to 2.17.0 (#933) Bumps `jackson.version` from 2.16.2 to 2.17.0. Updates `com.fasterxml.jackson.core:jackson-databind` from 2.16.2 to 2.17.0 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.datatype:jackson-datatype-jsr310` from 2.16.2 to 2.17.0 Updates `com.fasterxml.jackson.datatype:jackson-datatype-jdk8` from 2.16.2 to 2.17.0 Updates `com.fasterxml.jackson.module:jackson-module-kotlin` from 2.16.2 to 2.17.0 - [Commits](https://github.com/FasterXML/jackson-module-kotlin/compare/jackson-module-kotlin-2.16.2...jackson-module-kotlin-2.17.0) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency-type: direct:development update-type: version-update:semver-minor - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jdk8 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.fasterxml.jackson.module:jackson-module-kotlin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8ee4f5df..d345ae3d 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ 11 11 UTF-8 - 2.16.2 + 2.17.0 2.0.12 1.9.3 2.2.224 From 08fbe03d0867c8087418d88792cae86ca827623b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 22:06:11 +0530 Subject: [PATCH 16/59] Bump com.google.guava:guava from 33.0.0-jre to 33.1.0-jre (#937) Bumps [com.google.guava:guava](https://github.com/google/guava) from 33.0.0-jre to 33.1.0-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d345ae3d..5110d95b 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ 4.0.2 4.0.5 1.0.2 - 33.0.0-jre + 33.1.0-jre 1.6.8 2.26.1 From 46da22c8e025f4dca3b7c35ec097fe6cf96ecbbd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 23:01:51 +0530 Subject: [PATCH 17/59] Bump org.awaitility:awaitility from 4.2.0 to 4.2.1 (#938) Bumps [org.awaitility:awaitility](https://github.com/awaitility/awaitility) from 4.2.0 to 4.2.1. - [Changelog](https://github.com/awaitility/awaitility/blob/master/changelog.txt) - [Commits](https://github.com/awaitility/awaitility/compare/awaitility-4.2.0...awaitility-4.2.1) --- updated-dependencies: - dependency-name: org.awaitility:awaitility dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5110d95b..4565f874 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ 5.11.0 8.0.1.RELEASE 2.23.1 - 4.2.0 + 4.2.1 2.12.7 2.0.3 2.2 From 0a89dd85ec93d09d11b7a934c09f41390b3d0297 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 22:43:52 +0530 Subject: [PATCH 18/59] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.0 to 3.2.1 (#939) Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.0 to 3.2.1. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.0...maven-gpg-plugin-3.2.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4565f874..77f8ebf4 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 1.23 7.0_r2 1.6.13 - 3.2.0 + 3.2.1 From 00b8e7f83d7b778d62f6c2d43392d8bd80a9fec6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Mar 2024 21:33:58 +0530 Subject: [PATCH 19/59] Bump org.apache.maven.plugins:maven-compiler-plugin (#940) Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.12.1 to 3.13.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.12.1...maven-compiler-plugin-3.13.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 77f8ebf4..c9ae246f 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ 2.26.1 0.8.11 3.2.5 - 3.12.1 + 3.13.0 3.6.3 3.3.0 1.9.20 From 904dc866a12adbe076617bfaf86b155b6ced2927 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 10:33:55 +0530 Subject: [PATCH 20/59] Bump org.projectlombok:lombok from 1.18.30 to 1.18.32 (#941) Bumps [org.projectlombok:lombok](https://github.com/projectlombok/lombok) from 1.18.30 to 1.18.32. - [Changelog](https://github.com/projectlombok/lombok/blob/master/doc/changelog.markdown) - [Commits](https://github.com/projectlombok/lombok/compare/v1.18.30...v1.18.32) --- updated-dependencies: - dependency-name: org.projectlombok:lombok dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c9ae246f..145183b4 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 2.15.1 1.9.23 1.6.3 - 1.18.30 + 1.18.32 1.18.20.0 4.13.2 5.11.0 From 827ee2c4d7db0b5e10429d70cf66af953146026a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 22:29:52 +0530 Subject: [PATCH 21/59] Bump org.rocksdb:rocksdbjni from 8.11.3 to 9.0.0 (#942) Bumps [org.rocksdb:rocksdbjni](https://github.com/facebook/rocksdb) from 8.11.3 to 9.0.0. - [Release notes](https://github.com/facebook/rocksdb/releases) - [Changelog](https://github.com/facebook/rocksdb/blob/main/HISTORY.md) - [Commits](https://github.com/facebook/rocksdb/compare/v8.11.3...v9.0.0) --- updated-dependencies: - dependency-name: org.rocksdb:rocksdbjni dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 145183b4..8dfabc50 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ 2.0.12 1.9.3 2.2.224 - 8.11.3 + 9.0.0 5.5.0 1.19.0 1.16.1 From 690de114076adeaf5ae227e505592069858298e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:17:21 +0530 Subject: [PATCH 22/59] Bump org.threeten:threetenbp from 1.6.8 to 1.6.9 (#943) Bumps [org.threeten:threetenbp](https://github.com/ThreeTen/threetenbp) from 1.6.8 to 1.6.9. - [Release notes](https://github.com/ThreeTen/threetenbp/releases) - [Changelog](https://github.com/ThreeTen/threetenbp/blob/main/RELEASE-NOTES.md) - [Commits](https://github.com/ThreeTen/threetenbp/compare/v1.6.8...v1.6.9) --- updated-dependencies: - dependency-name: org.threeten:threetenbp dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8dfabc50..075695f1 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ 4.0.5 1.0.2 33.1.0-jre - 1.6.8 + 1.6.9 2.26.1 0.8.11 From 75da91f5e3ea6834169a8a03a6367a12a394edd5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 09:17:30 +0530 Subject: [PATCH 23/59] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.1 to 3.2.2 (#944) Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.1 to 3.2.2. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.1...maven-gpg-plugin-3.2.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 075695f1..2c0d548d 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 1.23 7.0_r2 1.6.13 - 3.2.1 + 3.2.2 From 9d0c12bb79f0a973c666164b475378b0f3c492dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 20:17:18 +0530 Subject: [PATCH 24/59] Bump commons-io:commons-io from 2.15.1 to 2.16.0 (#945) Bumps commons-io:commons-io from 2.15.1 to 2.16.0. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2c0d548d..91fec80b 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 5.5.0 1.19.0 1.16.1 - 2.15.1 + 2.16.0 1.9.23 1.6.3 1.18.32 From c7de1b1c41df8e411fc1ea97f435cf77b0a82fb6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 22:33:56 +0530 Subject: [PATCH 25/59] Bump org.jacoco:jacoco-maven-plugin from 0.8.11 to 0.8.12 (#949) Bumps [org.jacoco:jacoco-maven-plugin](https://github.com/jacoco/jacoco) from 0.8.11 to 0.8.12. - [Release notes](https://github.com/jacoco/jacoco/releases) - [Commits](https://github.com/jacoco/jacoco/compare/v0.8.11...v0.8.12) --- updated-dependencies: - dependency-name: org.jacoco:jacoco-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 91fec80b..ad7571bf 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 1.6.9 2.26.1 - 0.8.11 + 0.8.12 3.2.5 3.13.0 3.6.3 From b571897823a1b6ea555c689120f1fa3dfeb773bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Apr 2024 22:45:58 +0530 Subject: [PATCH 26/59] Bump org.apache.maven.plugins:maven-source-plugin from 3.3.0 to 3.3.1 (#950) Bumps [org.apache.maven.plugins:maven-source-plugin](https://github.com/apache/maven-source-plugin) from 3.3.0 to 3.3.1. - [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.3.0...maven-source-plugin-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-source-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ad7571bf..a1eee05e 100644 --- a/pom.xml +++ b/pom.xml @@ -83,7 +83,7 @@ 3.2.5 3.13.0 3.6.3 - 3.3.0 + 3.3.1 1.9.20 1.23 7.0_r2 From f921b467fe62671643d5ed08a8c1a82b3747905d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:22:29 +0530 Subject: [PATCH 27/59] Bump org.slf4j:slf4j-api from 2.0.12 to 2.0.13 (#953) Bumps org.slf4j:slf4j-api from 2.0.12 to 2.0.13. --- updated-dependencies: - dependency-name: org.slf4j:slf4j-api dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a1eee05e..18c31168 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ 11 UTF-8 2.17.0 - 2.0.12 + 2.0.13 1.9.3 2.2.224 9.0.0 From c1e4b6b7beca601a9467a1ccbd5fb11265316637 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:22:38 +0530 Subject: [PATCH 28/59] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.2 to 3.2.3 (#952) Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.2 to 3.2.3. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.2...maven-gpg-plugin-3.2.3) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 18c31168..df8e5543 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 1.23 7.0_r2 1.6.13 - 3.2.2 + 3.2.3 From f540e0774a33eef93132356b616c6b2b748c157b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 13 Apr 2024 21:22:45 +0530 Subject: [PATCH 29/59] Bump commons-io:commons-io from 2.16.0 to 2.16.1 (#951) Bumps commons-io:commons-io from 2.16.0 to 2.16.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index df8e5543..66623dc8 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 5.5.0 1.19.0 1.16.1 - 2.16.0 + 2.16.1 1.9.23 1.6.3 1.18.32 From 493c7964144b12e69462a0cdf5441756231216e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 08:46:36 +0530 Subject: [PATCH 30/59] Bump org.rocksdb:rocksdbjni from 9.0.0 to 9.0.1 (#955) Bumps [org.rocksdb:rocksdbjni](https://github.com/facebook/rocksdb) from 9.0.0 to 9.0.1. - [Release notes](https://github.com/facebook/rocksdb/releases) - [Changelog](https://github.com/facebook/rocksdb/blob/v9.0.1/HISTORY.md) - [Commits](https://github.com/facebook/rocksdb/compare/v9.0.0...v9.0.1) --- updated-dependencies: - dependency-name: org.rocksdb:rocksdbjni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 66623dc8..7edf1b23 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ 2.0.13 1.9.3 2.2.224 - 9.0.0 + 9.0.1 5.5.0 1.19.0 1.16.1 From fcbf618bf050fc46b29896e82ffeb985cc4c8457 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 08:46:47 +0530 Subject: [PATCH 31/59] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.3 to 3.2.4 (#954) Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.3 to 3.2.4. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.3...maven-gpg-plugin-3.2.4) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7edf1b23..ce3c59c6 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 1.23 7.0_r2 1.6.13 - 3.2.3 + 3.2.4 From de5a9a304a69135775bfb850a0ba725ccfb350ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 08:45:29 +0530 Subject: [PATCH 32/59] Bump org.rocksdb:rocksdbjni from 9.0.1 to 9.1.1 (#956) Bumps [org.rocksdb:rocksdbjni](https://github.com/facebook/rocksdb) from 9.0.1 to 9.1.1. - [Release notes](https://github.com/facebook/rocksdb/releases) - [Changelog](https://github.com/facebook/rocksdb/blob/v9.1.1/HISTORY.md) - [Commits](https://github.com/facebook/rocksdb/compare/v9.0.1...v9.1.1) --- updated-dependencies: - dependency-name: org.rocksdb:rocksdbjni dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ce3c59c6..2303c035 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ 2.0.13 1.9.3 2.2.224 - 9.0.1 + 9.1.1 5.5.0 1.19.0 1.16.1 From e364c3ea605ceb26b5193b4cdb6da4d8182d0960 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 27 Apr 2024 12:38:52 +0530 Subject: [PATCH 33/59] Bump com.google.errorprone:error_prone_core from 2.26.1 to 2.27.0 (#957) Bumps [com.google.errorprone:error_prone_core](https://github.com/google/error-prone) from 2.26.1 to 2.27.0. - [Release notes](https://github.com/google/error-prone/releases) - [Commits](https://github.com/google/error-prone/compare/v2.26.1...v2.27.0) --- updated-dependencies: - dependency-name: com.google.errorprone:error_prone_core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2303c035..8a72f971 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 33.1.0-jre 1.6.9 - 2.26.1 + 2.27.0 0.8.12 3.2.5 3.13.0 From b86bf787948191ab4e24f3f31f9e0a5fb4c105f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 23:02:10 +0530 Subject: [PATCH 34/59] Bump commons-codec:commons-codec from 1.16.1 to 1.17.0 (#958) Bumps [commons-codec:commons-codec](https://github.com/apache/commons-codec) from 1.16.1 to 1.17.0. - [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-codec/compare/rel/commons-codec-1.16.1...rel/commons-codec-1.17.0) --- updated-dependencies: - dependency-name: commons-codec:commons-codec dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8a72f971..c38d7fda 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ 9.1.1 5.5.0 1.19.0 - 1.16.1 + 1.17.0 2.16.1 1.9.23 1.6.3 From 3d0b836e13386ea0c45a10193fc07e9d52ea35ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 May 2024 22:53:56 +0530 Subject: [PATCH 35/59] Bump com.google.errorprone:error_prone_core from 2.27.0 to 2.27.1 (#959) Bumps [com.google.errorprone:error_prone_core](https://github.com/google/error-prone) from 2.27.0 to 2.27.1. - [Release notes](https://github.com/google/error-prone/releases) - [Commits](https://github.com/google/error-prone/compare/v2.27.0...v2.27.1) --- updated-dependencies: - dependency-name: com.google.errorprone:error_prone_core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c38d7fda..61261331 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 33.1.0-jre 1.6.9 - 2.27.0 + 2.27.1 0.8.12 3.2.5 3.13.0 From f8a0b8d17654043f25e3fa1e62330186b4f58e70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 08:37:48 +0530 Subject: [PATCH 36/59] Bump com.google.guava:guava from 33.1.0-jre to 33.2.0-jre (#960) Bumps [com.google.guava:guava](https://github.com/google/guava) from 33.1.0-jre to 33.2.0-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 61261331..88664895 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ 4.0.2 4.0.5 1.0.2 - 33.1.0-jre + 33.2.0-jre 1.6.9 2.27.1 From f4c4644a97ca1bd545ff728010c87f03a12b959f Mon Sep 17 00:00:00 2001 From: paulovictorv <2207574+paulovictorv@users.noreply.github.com> Date: Mon, 6 May 2024 13:56:03 -0300 Subject: [PATCH 37/59] fix behavior when updating values where the value was previously null (#961) --- .../no2/collection/NitriteDocument.java | 10 ++++++++-- .../collection/CollectionUpdateTest.java | 19 +++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/nitrite/src/main/java/org/dizitart/no2/collection/NitriteDocument.java b/nitrite/src/main/java/org/dizitart/no2/collection/NitriteDocument.java index 314d0861..513b732f 100644 --- a/nitrite/src/main/java/org/dizitart/no2/collection/NitriteDocument.java +++ b/nitrite/src/main/java/org/dizitart/no2/collection/NitriteDocument.java @@ -176,8 +176,14 @@ public Document merge(Document document) { // if the value is a document, merge it recursively if (containsKey(key)) { // if the current document already contains the key, - // then merge the embedded document - get(key, Document.class).merge((Document) value); + // and the value is not null, merge it + Document pairs = get(key, Document.class); + if (pairs != null) { + pairs.merge((Document) value); + } else { + //otherwise, just set the value to whatever was provided + put(key, value); + } } else { // if the current document does not contain the key, // then put the embedded document as it is diff --git a/nitrite/src/test/java/org/dizitart/no2/integration/collection/CollectionUpdateTest.java b/nitrite/src/test/java/org/dizitart/no2/integration/collection/CollectionUpdateTest.java index 4dad5155..959a2b3c 100644 --- a/nitrite/src/test/java/org/dizitart/no2/integration/collection/CollectionUpdateTest.java +++ b/nitrite/src/test/java/org/dizitart/no2/integration/collection/CollectionUpdateTest.java @@ -17,10 +17,7 @@ package org.dizitart.no2.integration.collection; -import org.dizitart.no2.collection.Document; -import org.dizitart.no2.collection.DocumentCursor; -import org.dizitart.no2.collection.NitriteCollection; -import org.dizitart.no2.collection.UpdateOptions; +import org.dizitart.no2.collection.*; import org.dizitart.no2.common.WriteResult; import org.dizitart.no2.exceptions.NitriteIOException; import org.dizitart.no2.exceptions.NotIdentifiableException; @@ -299,4 +296,18 @@ public void testIssue151() { assertEquals(coll.find(where("fruit").eq("Apple")).size(), 1); } + + @Test + public void testUpdatePreviouslyNullObject() { + Document doc1 = createDocument().put("fruitType", null); + NitriteCollection coll = db.getCollection("test"); + + WriteResult insert = coll.insert(doc1); + NitriteId next = insert.iterator().next(); + Document doc2 = createDocument().put("_id", next.getIdValue()).put("fruitType", createDocument().put("family", "citric")); + coll.update(doc2); + + assertEquals(coll.find(where("_id").eq(next.getIdValue())).size(), 1); + assertNotNull(coll.find(where("_id").eq(next.getIdValue())).firstOrNull().get("fruitType")); + } } From 380862317ccde0a3e00e9d8b0f5132ad2cc68446 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 05:46:21 +0530 Subject: [PATCH 38/59] Bump jackson.version from 2.17.0 to 2.17.1 (#962) Bumps `jackson.version` from 2.17.0 to 2.17.1. Updates `com.fasterxml.jackson.core:jackson-databind` from 2.17.0 to 2.17.1 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.datatype:jackson-datatype-jsr310` from 2.17.0 to 2.17.1 Updates `com.fasterxml.jackson.datatype:jackson-datatype-jdk8` from 2.17.0 to 2.17.1 Updates `com.fasterxml.jackson.module:jackson-module-kotlin` from 2.17.0 to 2.17.1 - [Commits](https://github.com/FasterXML/jackson-module-kotlin/compare/jackson-module-kotlin-2.17.0...jackson-module-kotlin-2.17.1) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jdk8 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.module:jackson-module-kotlin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 88664895..2bd166f9 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ 11 11 UTF-8 - 2.17.0 + 2.17.1 2.0.13 1.9.3 2.2.224 From d20a92ee205fe61002a175282a41c64acd5b7b97 Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee Date: Tue, 7 May 2024 11:40:01 +0530 Subject: [PATCH 39/59] remove usage of Indices from test codes. Fixes #948 --- .../dizitart/no2/integration/NitriteTest.java | 17 ++++---------- .../repository/CustomFieldSeparatorTest.java | 9 +++----- .../UniversalTextTokenizerTest.java | 5 +--- .../integration/repository/data/Company.java | 5 +--- .../java/org/dizitart/no2/NitriteTest.java | 7 ++---- .../no2/integration/NitriteStressTest.java | 9 +++----- .../repository/CustomFieldSeparatorTest.java | 19 +++++++-------- .../UniversalTextTokenizerTest.java | 5 +--- .../integration/repository/data/Company.java | 5 +--- .../java/org/dizitart/no2/NitriteTest.java | 7 ++---- .../no2/integration/NitriteStressTest.java | 9 +++----- .../repository/CustomFieldSeparatorTest.java | 9 +++----- .../UniversalTextTokenizerTest.java | 5 +--- .../integration/repository/data/Company.java | 5 +--- .../dizitart/no2/support/data/Company.java | 5 +--- .../dizitart/no2/support/data/Employee.java | 11 ++++----- .../no2/repository/AnnotationScanner.java | 5 ++-- .../dizitart/no2/integration/NitriteTest.java | 5 +--- .../dizitart/no2/integration/StressTest.java | 9 +++----- .../repository/CustomFieldSeparatorTest.java | 23 ++++--------------- .../UniversalTextTokenizerTest.java | 5 +--- .../integration/repository/data/Company.java | 5 +--- .../integration/repository/data/Employee.java | 16 ++----------- .../kotlin/org/dizitart/kno2/NitriteTest.kt | 5 ++-- .../org/dizitart/kno2/ObjectFilterTest.kt | 3 +-- 25 files changed, 58 insertions(+), 150 deletions(-) diff --git a/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/NitriteTest.java b/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/NitriteTest.java index 01043be8..5790fa38 100644 --- a/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/NitriteTest.java +++ b/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/NitriteTest.java @@ -33,7 +33,6 @@ import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -264,9 +263,7 @@ public void testNoUniqueAndTextIndex() { @Data @NoArgsConstructor @AllArgsConstructor - @Indices({ - @Index(fields = "synced", type = IndexType.NON_UNIQUE) - }) + @Index(fields = "synced", type = IndexType.NON_UNIQUE) public static class Receipt { @Id private String clientRef; @@ -283,21 +280,17 @@ public enum Status { public static class EmptyClass { } - @Indices({ - @Index(fields = "value", type = IndexType.FULL_TEXT), - @Index(fields = "value") - }) @Data @NoArgsConstructor @AllArgsConstructor + @Index(fields = "value", type = IndexType.FULL_TEXT) + @Index(fields = "value") public static class EntityUniqueFullText { private String value; } - @Indices({ - @Index(fields = "value", type = IndexType.FULL_TEXT), - @Index(fields = "value", type = IndexType.NON_UNIQUE) - }) + @Index(fields = "value", type = IndexType.FULL_TEXT) + @Index(fields = "value", type = IndexType.NON_UNIQUE) @Data @NoArgsConstructor @AllArgsConstructor diff --git a/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java b/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java index 888a3155..c932c7d4 100644 --- a/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java +++ b/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java @@ -31,7 +31,6 @@ import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -113,11 +112,9 @@ public void testFindByEmbeddedField() { @ToString @EqualsAndHashCode - @Indices({ - @Index(fields = "joinDate", type = IndexType.NON_UNIQUE), - @Index(fields = "address", type = IndexType.FULL_TEXT), - @Index(fields = "employeeNote:text", type = IndexType.FULL_TEXT) - }) + @Index(fields = "joinDate", type = IndexType.NON_UNIQUE) + @Index(fields = "address", type = IndexType.FULL_TEXT) + @Index(fields = "employeeNote:text", type = IndexType.FULL_TEXT) public static class EmployeeForCustomSeparator implements Serializable { @Id @Getter diff --git a/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java b/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java index e92fa284..6aa3ab29 100644 --- a/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java +++ b/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java @@ -29,7 +29,6 @@ import org.dizitart.no2.repository.Cursor; import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -173,9 +172,7 @@ public void testUniversalFullTextIndexing() { } } - @Indices( - @Index(fields = "text", type = IndexType.FULL_TEXT) - ) + @Index(fields = "text", type = IndexType.FULL_TEXT) public static class TextData { public int id; public String text; diff --git a/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/repository/data/Company.java b/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/repository/data/Company.java index 3a6721f7..acf8c931 100644 --- a/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/repository/data/Company.java +++ b/nitrite-jackson-mapper/src/test/java/org/dizitart/no2/integration/repository/data/Company.java @@ -24,7 +24,6 @@ import lombok.ToString; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import java.io.Serializable; import java.util.Date; @@ -38,9 +37,7 @@ @Setter @ToString @EqualsAndHashCode -@Indices({ - @Index(fields = "companyName") -}) +@Index(fields = "companyName") public class Company implements Serializable { @Id(fieldName = "company_id") @JsonProperty("company_id") diff --git a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/NitriteTest.java b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/NitriteTest.java index 8fe84ef0..a4a07c3b 100644 --- a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/NitriteTest.java +++ b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/NitriteTest.java @@ -28,8 +28,8 @@ import org.dizitart.no2.common.SortOrder; import org.dizitart.no2.common.concurrent.ThreadPoolManager; import org.dizitart.no2.common.mapper.EntityConverter; -import org.dizitart.no2.common.mapper.SimpleNitriteMapper; import org.dizitart.no2.common.mapper.NitriteMapper; +import org.dizitart.no2.common.mapper.SimpleNitriteMapper; import org.dizitart.no2.exceptions.NitriteIOException; import org.dizitart.no2.exceptions.ValidationException; import org.dizitart.no2.index.IndexOptions; @@ -41,7 +41,6 @@ import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -674,9 +673,7 @@ public CompatChild fromDocument(Document document, NitriteMapper nitriteMapper) @Data @NoArgsConstructor @AllArgsConstructor - @Indices({ - @Index(fields = "synced", type = IndexType.NON_UNIQUE) - }) + @Index(fields = "synced", type = IndexType.NON_UNIQUE) public static class Receipt { @Id private String clientRef; diff --git a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/NitriteStressTest.java b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/NitriteStressTest.java index f185d2dd..c4d3db29 100644 --- a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/NitriteStressTest.java +++ b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/NitriteStressTest.java @@ -35,7 +35,6 @@ import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.junit.*; import uk.co.jemos.podam.api.PodamFactory; import uk.co.jemos.podam.api.PodamFactoryImpl; @@ -371,11 +370,9 @@ public PerfTest fromDocument(Document document, NitriteMapper nitriteMapper) { } } - @Indices({ - @Index(fields = "firstName", type = IndexType.NON_UNIQUE), - @Index(fields = "age", type = IndexType.NON_UNIQUE), - @Index(fields = "text", type = IndexType.FULL_TEXT), - }) + @Index(fields = "firstName", type = IndexType.NON_UNIQUE) + @Index(fields = "age", type = IndexType.NON_UNIQUE) + @Index(fields = "text", type = IndexType.FULL_TEXT) private static class PerfTestIndexed extends PerfTest { public static class Converter implements EntityConverter { diff --git a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java index 72886734..d25f6e91 100644 --- a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java +++ b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java @@ -21,21 +21,20 @@ import lombok.Getter; import lombok.Setter; import lombok.ToString; +import org.dizitart.no2.Nitrite; +import org.dizitart.no2.NitriteConfig; +import org.dizitart.no2.collection.Document; import org.dizitart.no2.common.mapper.EntityConverter; +import org.dizitart.no2.common.mapper.NitriteMapper; import org.dizitart.no2.common.mapper.SimpleNitriteMapper; +import org.dizitart.no2.index.IndexType; import org.dizitart.no2.integration.Retry; import org.dizitart.no2.integration.repository.data.Company; import org.dizitart.no2.integration.repository.data.Note; -import org.dizitart.no2.Nitrite; -import org.dizitart.no2.NitriteConfig; -import org.dizitart.no2.collection.Document; -import org.dizitart.no2.index.IndexType; -import org.dizitart.no2.common.mapper.NitriteMapper; import org.dizitart.no2.mvstore.MVStoreModule; import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -123,11 +122,9 @@ public void testFindByEmbeddedField() { @ToString @EqualsAndHashCode - @Indices({ - @Index(fields = "joinDate", type = IndexType.NON_UNIQUE), - @Index(fields = "address", type = IndexType.FULL_TEXT), - @Index(fields = "employeeNote:text", type = IndexType.FULL_TEXT) - }) + @Index(fields = "joinDate", type = IndexType.NON_UNIQUE) + @Index(fields = "address", type = IndexType.FULL_TEXT) + @Index(fields = "employeeNote:text", type = IndexType.FULL_TEXT) public static class EmployeeForCustomSeparator implements Serializable { @Id @Getter diff --git a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java index b49ebde0..88379703 100644 --- a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java +++ b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java @@ -32,7 +32,6 @@ import org.dizitart.no2.repository.Cursor; import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -179,9 +178,7 @@ public void testUniversalFullTextIndexing() { } } - @Indices( - @Index(fields = "text", type = IndexType.FULL_TEXT) - ) + @Index(fields = "text", type = IndexType.FULL_TEXT) public static class TextData { public Integer id; public String text; diff --git a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/repository/data/Company.java b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/repository/data/Company.java index d720ceee..86b92763 100644 --- a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/repository/data/Company.java +++ b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/repository/data/Company.java @@ -25,7 +25,6 @@ import org.dizitart.no2.common.mapper.NitriteMapper; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import java.io.Serializable; import java.util.Date; @@ -37,9 +36,7 @@ */ @Getter @EqualsAndHashCode -@Indices({ - @Index(fields = "companyName") -}) +@Index(fields = "companyName") public class Company implements Serializable { @Id(fieldName = "company_id") @Setter diff --git a/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/NitriteTest.java b/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/NitriteTest.java index c2be8275..54754934 100644 --- a/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/NitriteTest.java +++ b/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/NitriteTest.java @@ -28,8 +28,8 @@ import org.dizitart.no2.common.SortOrder; import org.dizitart.no2.common.concurrent.ThreadPoolManager; import org.dizitart.no2.common.mapper.EntityConverter; -import org.dizitart.no2.common.mapper.SimpleNitriteMapper; import org.dizitart.no2.common.mapper.NitriteMapper; +import org.dizitart.no2.common.mapper.SimpleNitriteMapper; import org.dizitart.no2.exceptions.NitriteIOException; import org.dizitart.no2.exceptions.ValidationException; import org.dizitart.no2.index.IndexOptions; @@ -40,7 +40,6 @@ import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -477,9 +476,7 @@ public CompatChild fromDocument(Document document, NitriteMapper nitriteMapper) @Data @NoArgsConstructor @AllArgsConstructor - @Indices({ - @Index(fields = "synced", type = IndexType.NON_UNIQUE) - }) + @Index(fields = "synced", type = IndexType.NON_UNIQUE) public static class Receipt { @Id private String clientRef; diff --git a/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/NitriteStressTest.java b/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/NitriteStressTest.java index 7d85df53..3bae9034 100644 --- a/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/NitriteStressTest.java +++ b/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/NitriteStressTest.java @@ -35,7 +35,6 @@ import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.junit.*; import uk.co.jemos.podam.api.PodamFactory; import uk.co.jemos.podam.api.PodamFactoryImpl; @@ -368,11 +367,9 @@ public PerfTest fromDocument(Document document, NitriteMapper nitriteMapper) { } } - @Indices({ - @Index(fields = "firstName", type = IndexType.NON_UNIQUE), - @Index(fields = "age", type = IndexType.NON_UNIQUE), - @Index(fields = "text", type = IndexType.FULL_TEXT), - }) + @Index(fields = "firstName", type = IndexType.NON_UNIQUE) + @Index(fields = "age", type = IndexType.NON_UNIQUE) + @Index(fields = "text", type = IndexType.FULL_TEXT) private static class PerfTestIndexed extends PerfTest { public static class Converter implements EntityConverter { diff --git a/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java b/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java index 80c1dd97..fa3f0da8 100644 --- a/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java +++ b/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java @@ -34,7 +34,6 @@ import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.dizitart.no2.rocksdb.RocksDBModule; import org.junit.After; import org.junit.Before; @@ -122,11 +121,9 @@ public void testFindByEmbeddedField() { @ToString @EqualsAndHashCode - @Indices({ - @Index(fields = "joinDate", type = IndexType.NON_UNIQUE), - @Index(fields = "address", type = IndexType.FULL_TEXT), - @Index(fields = "employeeNote:text", type = IndexType.FULL_TEXT) - }) + @Index(fields = "joinDate", type = IndexType.NON_UNIQUE) + @Index(fields = "address", type = IndexType.FULL_TEXT) + @Index(fields = "employeeNote:text", type = IndexType.FULL_TEXT) public static class EmployeeForCustomSeparator implements Serializable { @Id @Getter diff --git a/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java b/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java index c44e6ce6..1818909f 100644 --- a/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java +++ b/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java @@ -30,7 +30,6 @@ import org.dizitart.no2.repository.Cursor; import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.dizitart.no2.rocksdb.RocksDBModule; import org.junit.After; import org.junit.Before; @@ -165,9 +164,7 @@ public void testUniversalFullTextIndexing() { } } - @Indices( - @Index(fields = "text", type = IndexType.FULL_TEXT) - ) + @Index(fields = "text", type = IndexType.FULL_TEXT) public static class TextData { public Integer id; public String text; diff --git a/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/repository/data/Company.java b/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/repository/data/Company.java index d720ceee..86b92763 100644 --- a/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/repository/data/Company.java +++ b/nitrite-rocksdb-adapter/src/test/java/org/dizitart/no2/integration/repository/data/Company.java @@ -25,7 +25,6 @@ import org.dizitart.no2.common.mapper.NitriteMapper; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import java.io.Serializable; import java.util.Date; @@ -37,9 +36,7 @@ */ @Getter @EqualsAndHashCode -@Indices({ - @Index(fields = "companyName") -}) +@Index(fields = "companyName") public class Company implements Serializable { @Id(fieldName = "company_id") @Setter diff --git a/nitrite-support/src/test/java/org/dizitart/no2/support/data/Company.java b/nitrite-support/src/test/java/org/dizitart/no2/support/data/Company.java index f49d93e5..9bc6da10 100644 --- a/nitrite-support/src/test/java/org/dizitart/no2/support/data/Company.java +++ b/nitrite-support/src/test/java/org/dizitart/no2/support/data/Company.java @@ -22,7 +22,6 @@ import org.dizitart.no2.common.mapper.NitriteMapper; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import java.io.Serializable; import java.util.Date; @@ -33,9 +32,7 @@ * @author Anindya Chatterjee. */ @Data -@Indices({ - @Index(fields = "companyName") -}) +@Index(fields = "companyName") public class Company implements Serializable { @Id(fieldName = "company_id") private Long companyId; diff --git a/nitrite-support/src/test/java/org/dizitart/no2/support/data/Employee.java b/nitrite-support/src/test/java/org/dizitart/no2/support/data/Employee.java index 5c7ed6d4..0949904c 100644 --- a/nitrite-support/src/test/java/org/dizitart/no2/support/data/Employee.java +++ b/nitrite-support/src/test/java/org/dizitart/no2/support/data/Employee.java @@ -22,11 +22,10 @@ import lombok.ToString; import org.dizitart.no2.collection.Document; import org.dizitart.no2.common.mapper.EntityConverter; +import org.dizitart.no2.common.mapper.NitriteMapper; import org.dizitart.no2.index.IndexType; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; -import org.dizitart.no2.common.mapper.NitriteMapper; import java.io.Serializable; import java.util.Date; @@ -36,11 +35,9 @@ */ @ToString @EqualsAndHashCode -@Indices({ - @Index(fields = "joinDate", type = IndexType.NON_UNIQUE), - @Index(fields = "address", type = IndexType.FULL_TEXT), - @Index(fields = "employeeNote.text", type = IndexType.FULL_TEXT) -}) +@Index(fields = "joinDate", type = IndexType.NON_UNIQUE) +@Index(fields = "address", type = IndexType.FULL_TEXT) +@Index(fields = "employeeNote.text", type = IndexType.FULL_TEXT) public class Employee implements Serializable { @Id @Getter diff --git a/nitrite/src/main/java/org/dizitart/no2/repository/AnnotationScanner.java b/nitrite/src/main/java/org/dizitart/no2/repository/AnnotationScanner.java index ca2d78c6..ec44bad6 100644 --- a/nitrite/src/main/java/org/dizitart/no2/repository/AnnotationScanner.java +++ b/nitrite/src/main/java/org/dizitart/no2/repository/AnnotationScanner.java @@ -101,9 +101,8 @@ private void scanIndexAnnotation() { if (type.isAnnotationPresent(InheritIndices.class)) { indexList = reflector.findInheritedAnnotations(Index.class, type); } else { - indexList = new ArrayList<>(); - Index index = type.getAnnotation(Index.class); - if (index != null) indexList.add(index); + Index[] indexes = type.getAnnotationsByType(Index.class); + indexList = new ArrayList<>(Arrays.asList(indexes)); } populateIndex(indexList); } diff --git a/nitrite/src/test/java/org/dizitart/no2/integration/NitriteTest.java b/nitrite/src/test/java/org/dizitart/no2/integration/NitriteTest.java index 143bc56b..5c59a67d 100644 --- a/nitrite/src/test/java/org/dizitart/no2/integration/NitriteTest.java +++ b/nitrite/src/test/java/org/dizitart/no2/integration/NitriteTest.java @@ -38,7 +38,6 @@ import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -428,9 +427,7 @@ public CompatChild fromDocument(Document document, NitriteMapper nitriteMapper) @Data @NoArgsConstructor @AllArgsConstructor - @Indices({ - @Index(fields = "synced", type = IndexType.NON_UNIQUE) - }) + @Index(fields = "synced", type = IndexType.NON_UNIQUE) public static class Receipt { @Id private String clientRef; diff --git a/nitrite/src/test/java/org/dizitart/no2/integration/StressTest.java b/nitrite/src/test/java/org/dizitart/no2/integration/StressTest.java index f7817a1c..89542a96 100644 --- a/nitrite/src/test/java/org/dizitart/no2/integration/StressTest.java +++ b/nitrite/src/test/java/org/dizitart/no2/integration/StressTest.java @@ -30,7 +30,6 @@ import org.dizitart.no2.index.IndexType; import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -193,11 +192,9 @@ public PerfTest fromDocument(Document document, NitriteMapper nitriteMapper) { } } - @Indices({ - @Index(fields = "firstName", type = IndexType.NON_UNIQUE), - @Index(fields = "age", type = IndexType.NON_UNIQUE), - @Index(fields = "text", type = IndexType.FULL_TEXT), - }) + @Index(fields = "firstName", type = IndexType.NON_UNIQUE) + @Index(fields = "age", type = IndexType.NON_UNIQUE) + @Index(fields = "text", type = IndexType.FULL_TEXT) private static class PerfTestIndexed extends PerfTest { public static class PerfTestIndexedConverter implements EntityConverter { diff --git a/nitrite/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java b/nitrite/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java index a562a150..c354e885 100644 --- a/nitrite/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java +++ b/nitrite/src/test/java/org/dizitart/no2/integration/repository/CustomFieldSeparatorTest.java @@ -34,7 +34,6 @@ import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -110,37 +109,25 @@ public void testFindByEmbeddedField() { assertEquals(repository.find(where("company:companyName").eq("Dummy Company")).size(), 1); } + @Setter + @Getter @ToString @EqualsAndHashCode - @Indices({ - @Index(fields = "joinDate", type = IndexType.NON_UNIQUE), - @Index(fields = "address", type = IndexType.FULL_TEXT), - @Index(fields = "employeeNote:text", type = IndexType.FULL_TEXT) - }) + @Index(fields = "joinDate", type = IndexType.NON_UNIQUE) + @Index(fields = "address", type = IndexType.FULL_TEXT) + @Index(fields = "employeeNote:text", type = IndexType.FULL_TEXT) public static class EmployeeForCustomSeparator implements Serializable { @Id - @Getter - @Setter private Long empId; - @Getter - @Setter private Date joinDate; - @Getter - @Setter private String address; - @Getter - @Setter private Company company; - @Getter - @Setter private byte[] blob; - @Getter - @Setter private Note employeeNote; EmployeeForCustomSeparator() { diff --git a/nitrite/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java b/nitrite/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java index b05a998e..c0c8826c 100644 --- a/nitrite/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java +++ b/nitrite/src/test/java/org/dizitart/no2/integration/repository/UniversalTextTokenizerTest.java @@ -30,7 +30,6 @@ import org.dizitart.no2.repository.Cursor; import org.dizitart.no2.repository.ObjectRepository; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -153,9 +152,7 @@ public void testUniversalFullTextIndexing() { } } - @Indices( - @Index(fields = "text", type = IndexType.FULL_TEXT) - ) + @Index(fields = "text", type = IndexType.FULL_TEXT) public static class TextData { public Integer id; public String text; diff --git a/nitrite/src/test/java/org/dizitart/no2/integration/repository/data/Company.java b/nitrite/src/test/java/org/dizitart/no2/integration/repository/data/Company.java index d720ceee..86b92763 100644 --- a/nitrite/src/test/java/org/dizitart/no2/integration/repository/data/Company.java +++ b/nitrite/src/test/java/org/dizitart/no2/integration/repository/data/Company.java @@ -25,7 +25,6 @@ import org.dizitart.no2.common.mapper.NitriteMapper; import org.dizitart.no2.repository.annotations.Id; import org.dizitart.no2.repository.annotations.Index; -import org.dizitart.no2.repository.annotations.Indices; import java.io.Serializable; import java.util.Date; @@ -37,9 +36,7 @@ */ @Getter @EqualsAndHashCode -@Indices({ - @Index(fields = "companyName") -}) +@Index(fields = "companyName") public class Company implements Serializable { @Id(fieldName = "company_id") @Setter diff --git a/nitrite/src/test/java/org/dizitart/no2/integration/repository/data/Employee.java b/nitrite/src/test/java/org/dizitart/no2/integration/repository/data/Employee.java index 2fa4f5ae..c95dc77e 100644 --- a/nitrite/src/test/java/org/dizitart/no2/integration/repository/data/Employee.java +++ b/nitrite/src/test/java/org/dizitart/no2/integration/repository/data/Employee.java @@ -34,6 +34,8 @@ /** * @author Anindya Chatterjee. */ +@Setter +@Getter @ToString @EqualsAndHashCode @Index(fields = "joinDate", type = IndexType.NON_UNIQUE) @@ -41,32 +43,18 @@ @Index(fields = "employeeNote.text", type = IndexType.FULL_TEXT) public class Employee implements Serializable { @Id - @Getter - @Setter private Long empId; - @Getter - @Setter private Date joinDate; - @Getter - @Setter private String address; - @Getter - @Setter private String emailAddress; - @Getter - @Setter private transient Company company; - @Getter - @Setter private byte[] blob; - @Getter - @Setter private Note employeeNote; public Employee() { diff --git a/potassium-nitrite/src/test/kotlin/org/dizitart/kno2/NitriteTest.kt b/potassium-nitrite/src/test/kotlin/org/dizitart/kno2/NitriteTest.kt index e9d9182d..b3d9f014 100644 --- a/potassium-nitrite/src/test/kotlin/org/dizitart/kno2/NitriteTest.kt +++ b/potassium-nitrite/src/test/kotlin/org/dizitart/kno2/NitriteTest.kt @@ -31,7 +31,6 @@ import org.dizitart.no2.repository.EntityId import org.dizitart.no2.repository.EntityIndex import org.dizitart.no2.repository.annotations.Id import org.dizitart.no2.repository.annotations.Index -import org.dizitart.no2.repository.annotations.Indices import org.dizitart.no2.repository.annotations.InheritIndices import org.junit.Assert.* import org.junit.Before @@ -222,7 +221,7 @@ interface MyInterface { val id: UUID } -@Indices(value = [(Index(fields = ["name"], type = IndexType.NON_UNIQUE))]) +@Index(fields = ["name"], type = IndexType.NON_UNIQUE) abstract class SomeAbsClass( @Id override val id: UUID = UUID.randomUUID(), open val name: String = "abcd" @@ -249,7 +248,7 @@ data class CaObject( val name: String = "" ) -@Indices(value = [(Index(fields = ["time"], type = IndexType.UNIQUE))]) +@Index(fields = ["time"], type = IndexType.UNIQUE) data class ClassWithLocalDateTime( val name: String = "", val time: LocalDateTime = LocalDateTime.now() diff --git a/potassium-nitrite/src/test/kotlin/org/dizitart/kno2/ObjectFilterTest.kt b/potassium-nitrite/src/test/kotlin/org/dizitart/kno2/ObjectFilterTest.kt index 9657ebaf..6c3184d2 100644 --- a/potassium-nitrite/src/test/kotlin/org/dizitart/kno2/ObjectFilterTest.kt +++ b/potassium-nitrite/src/test/kotlin/org/dizitart/kno2/ObjectFilterTest.kt @@ -21,7 +21,6 @@ import org.dizitart.no2.index.IndexType import org.dizitart.no2.mvstore.MVStoreModule import org.dizitart.no2.repository.annotations.Id import org.dizitart.no2.repository.annotations.Index -import org.dizitart.no2.repository.annotations.Indices import org.dizitart.no2.spatial.SpatialIndexer import org.junit.Assert.assertEquals import org.junit.Before @@ -337,7 +336,7 @@ class ObjectFilterTest : BaseTest() { } } -@Indices(Index(fields = ["text"], type = IndexType.FULL_TEXT)) +@Index(fields = ["text"], type = IndexType.FULL_TEXT) data class TestData(@Id val id: Int = 0, val text: String = "", val list: List = listOf()) class ListData(val name: String = "", val score: Int = 0) From 8a7a8e70f94cb2bec85b116753f39f641a8f1f14 Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee Date: Tue, 7 May 2024 11:51:46 +0530 Subject: [PATCH 40/59] added some test cases from #946 --- .../dizitart/no2/filters/TextFilterTest.java | 24 +++++++++++- .../no2/migration/MigrationManagerTest.java | 36 ++++++++++++++++++ .../store/UserAuthenticationServiceTest.java | 38 +++++++++++++++++++ 3 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 nitrite/src/test/java/org/dizitart/no2/migration/MigrationManagerTest.java diff --git a/nitrite/src/test/java/org/dizitart/no2/filters/TextFilterTest.java b/nitrite/src/test/java/org/dizitart/no2/filters/TextFilterTest.java index a9066378..91323357 100644 --- a/nitrite/src/test/java/org/dizitart/no2/filters/TextFilterTest.java +++ b/nitrite/src/test/java/org/dizitart/no2/filters/TextFilterTest.java @@ -17,12 +17,18 @@ package org.dizitart.no2.filters; +import org.dizitart.no2.collection.Document; +import org.dizitart.no2.collection.NitriteId; +import org.dizitart.no2.common.tuples.Pair; import org.dizitart.no2.exceptions.FilterException; import org.dizitart.no2.index.fulltext.EnglishTextTokenizer; import org.dizitart.no2.store.memory.InMemoryMap; import org.junit.Test; +import org.mockito.Mockito; import static org.junit.Assert.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; public class TextFilterTest { @Test @@ -61,7 +67,23 @@ public void testApplyOnIndex3() { TextFilter textFilter = new TextFilter("Field", "*"); textFilter.setTextTokenizer(new EnglishTextTokenizer()); assertThrows(FilterException.class, - () -> textFilter.applyOnTextIndex(new InMemoryMap<>("Map Name", null))); + () -> textFilter.applyOnTextIndex(new InMemoryMap<>("Map Name", null))); + } + + @Test + public void applyTestWhenDocStringContainsSearchString() { + //Arrange + TextFilter textFilter = new TextFilter("fieldString", "string"); + Document docMock = mock(Document.class); + Pair pairElementMock = mock(Pair.class); + when(pairElementMock.getSecond()).thenReturn(docMock); + when(docMock.get(Mockito.anyString())).thenReturn("parent doc string"); + + //Action + var result = textFilter.apply(pairElementMock); + //Assert + assertTrue(result); + } } diff --git a/nitrite/src/test/java/org/dizitart/no2/migration/MigrationManagerTest.java b/nitrite/src/test/java/org/dizitart/no2/migration/MigrationManagerTest.java new file mode 100644 index 00000000..e79c55e3 --- /dev/null +++ b/nitrite/src/test/java/org/dizitart/no2/migration/MigrationManagerTest.java @@ -0,0 +1,36 @@ +package org.dizitart.no2.migration; + +import org.dizitart.no2.Nitrite; +import org.dizitart.no2.NitriteConfig; +import org.dizitart.no2.store.StoreMetaData; +import org.junit.Test; +import org.mockito.Mockito; + +import java.lang.reflect.Method; +import java.util.Queue; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.when; + +public class MigrationManagerTest { + + @Test + @SuppressWarnings("unchecked") + public void findMigrationPathTestWhenStartAndEndAreSame() throws Exception { + NitriteConfig nitriteConfigMock = Mockito.mock(NitriteConfig.class); + StoreMetaData storeMetaDataMock = Mockito.mock(StoreMetaData.class); + + Nitrite nitriteMock = Mockito.mock(Nitrite.class); + when(nitriteMock.getConfig()).thenReturn(nitriteConfigMock); + + MigrationManager migrationManager = new MigrationManager(nitriteMock); + + when(nitriteMock.getDatabaseMetaData()).thenReturn(storeMetaDataMock); + + Method method = MigrationManager.class.getDeclaredMethod("findMigrationPath", int.class, int.class); + method.setAccessible(true); + var result = (Queue) method.invoke(migrationManager, 1, 1); + + assertNotNull(result); + } +} diff --git a/nitrite/src/test/java/org/dizitart/no2/store/UserAuthenticationServiceTest.java b/nitrite/src/test/java/org/dizitart/no2/store/UserAuthenticationServiceTest.java index e746d73c..c0b19c9a 100644 --- a/nitrite/src/test/java/org/dizitart/no2/store/UserAuthenticationServiceTest.java +++ b/nitrite/src/test/java/org/dizitart/no2/store/UserAuthenticationServiceTest.java @@ -17,8 +17,13 @@ package org.dizitart.no2.store; +import org.dizitart.no2.exceptions.NitriteSecurityException; import org.dizitart.no2.store.memory.InMemoryStore; import org.junit.Test; +import org.mockito.Mockito; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; public class UserAuthenticationServiceTest { @Test @@ -45,5 +50,38 @@ public void testAuthenticate4() { public void testAuthenticate5() { (new UserAuthenticationService(new InMemoryStore())).authenticate("", "iloveyou"); } + + @Test(expected = NitriteSecurityException.class) + public void testAuthenticateIfUsernamePasswordAreNull() { + //region ARRANGE + NitriteStore storeMock = mock(NitriteStore.class); + when(storeMock.hasMap(Mockito.anyString())).thenReturn(true); + + UserAuthenticationService userAuthenticationService = new UserAuthenticationService(storeMock); + //endregion + + //region ACTION + userAuthenticationService.authenticate(null, null); + //endregion + } + + @Test(expected = NitriteSecurityException.class) + @SuppressWarnings({"unchecked", "rawtypes"}) + public void testAuthenticateIfHasMapIsTrueAndUserCredentialIsNull() { + //region ARRANGE + NitriteMap nitriteMapMock = mock(NitriteMap.class); + when(nitriteMapMock.get(Mockito.anyString())).thenReturn(null); + + NitriteStore storeMock = mock(NitriteStore.class); + when(storeMock.hasMap(Mockito.anyString())).thenReturn(true); + when(storeMock.openMap(Mockito.anyString(), Mockito.any(), Mockito.any())).thenReturn(nitriteMapMock); + + UserAuthenticationService userAuthenticationService = new UserAuthenticationService(storeMock); + //endregion + + //region ACTION + userAuthenticationService.authenticate("usernameString", "passwordString"); + //endregion + } } From 7737d570860ddc5dbaacfe8bd4d486324f334346 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 12 May 2024 09:54:30 +0530 Subject: [PATCH 41/59] Bump kotlin.version from 1.9.23 to 1.9.24 (#964) Bumps `kotlin.version` from 1.9.23 to 1.9.24. Updates `org.jetbrains.kotlin:kotlin-stdlib` from 1.9.23 to 1.9.24 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.9.24/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.9.23...v1.9.24) Updates `org.jetbrains.kotlin:kotlin-reflect` from 1.9.23 to 1.9.24 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.9.24/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.9.23...v1.9.24) Updates `org.jetbrains.kotlin:kotlin-test` from 1.9.23 to 1.9.24 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.9.24/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.9.23...v1.9.24) Updates `org.jetbrains.kotlin:kotlin-test-junit` from 1.9.23 to 1.9.24 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.9.24/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.9.23...v1.9.24) Updates `org.jetbrains.kotlin:kotlin-maven-serialization` from 1.9.23 to 1.9.24 Updates `org.jetbrains.kotlin:kotlin-maven-plugin` from 1.9.23 to 1.9.24 --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-stdlib dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-reflect dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-test dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-test-junit dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-maven-serialization dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2bd166f9..d27cc53f 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.19.0 1.17.0 2.16.1 - 1.9.23 + 1.9.24 1.6.3 1.18.32 1.18.20.0 From 84a1324816e8818c0b73dd020c07e164386cc6c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 11:24:44 +0530 Subject: [PATCH 42/59] Bump org.mockito:mockito-core from 5.11.0 to 5.12.0 (#965) Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.11.0 to 5.12.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.11.0...v5.12.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d27cc53f..3a0fed52 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 1.18.32 1.18.20.0 4.13.2 - 5.11.0 + 5.12.0 8.0.1.RELEASE 2.23.1 4.2.1 From e5cfd4d5ef96ef839b79a4fb33b9122770d2dcaf Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee <696662+anidotnet@users.noreply.github.com> Date: Thu, 16 May 2024 09:27:09 +0530 Subject: [PATCH 43/59] Fixes #966 (#967) * Fixes #966 Fixes #966 by introducing a boolean flag in `NitriteConfig` to disable type validation * introduced a new property instead of function --- CHANGELOG.md | 4 ++ .../java/org/dizitart/no2/NitriteBuilder.java | 23 ++++++++- .../java/org/dizitart/no2/NitriteConfig.java | 22 +++++++- .../no2/common/util/ValidationUtils.java | 22 ++++---- .../no2/repository/RepositoryFactory.java | 7 +-- .../no2/common/util/ValidationUtilsTest.java | 24 +++++---- pom.xml | 7 +++ potassium-nitrite/pom.xml | 5 ++ .../main/kotlin/org/dizitart/kno2/Builder.kt | 21 ++++++++ .../kno2/KotlinXSerializationMapperTest.kt | 50 ++++++++++++++++++- 10 files changed, 157 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b17b1a0..76adcc95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,14 @@ - Nitrite now supports JPMS. It is now modular and can be used in Java 9 or above. - Version upgrade for several dependencies +- Repository type validation can be disabled in `NitriteBuilder` as a fix for #966 ### Issue Fixes - Fix for #935 +- Fix for #948 +- Fix for #961 +- Fix for #966 ## Release 4.2.2 - Mar 5, 2024 diff --git a/nitrite/src/main/java/org/dizitart/no2/NitriteBuilder.java b/nitrite/src/main/java/org/dizitart/no2/NitriteBuilder.java index 84625e24..35373d9d 100644 --- a/nitrite/src/main/java/org/dizitart/no2/NitriteBuilder.java +++ b/nitrite/src/main/java/org/dizitart/no2/NitriteBuilder.java @@ -31,8 +31,8 @@ * @see Nitrite * @since 1.0 */ +@Getter public class NitriteBuilder { - @Getter /** * The Nitrite configuration object. */ @@ -61,6 +61,27 @@ public NitriteBuilder fieldSeparator(String separator) { return this; } + /** + * Disables the repository type validation for the Nitrite database. + *

+ * Repository type validation is a feature in Nitrite that ensures the type of the objects + * stored in the repository can be converted to and from {@link org.dizitart.no2.collection.Document}. + *

+ * By default, the repository type validation is enabled. If you disable it, and if you try to + * store an object that cannot be converted to a {@link org.dizitart.no2.collection.Document}, + * then Nitrite will throw an exception during the operation. + * + * @return the NitriteBuilder instance with repository type validation disabled + * @see org.dizitart.no2.collection.Document + * @see org.dizitart.no2.repository.ObjectRepository + * @see org.dizitart.no2.common.mapper.EntityConverter + * @since 4.3.0 + */ + public NitriteBuilder disableRepositoryTypeValidation() { + this.nitriteConfig.disableRepositoryTypeValidation(); + return this; + } + /** * Registers an {@link EntityConverter} with the Nitrite database. * An {@link EntityConverter} is used to convert between an entity and a diff --git a/nitrite/src/main/java/org/dizitart/no2/NitriteConfig.java b/nitrite/src/main/java/org/dizitart/no2/NitriteConfig.java index ae8f3ac4..0c2d043b 100644 --- a/nitrite/src/main/java/org/dizitart/no2/NitriteConfig.java +++ b/nitrite/src/main/java/org/dizitart/no2/NitriteConfig.java @@ -79,6 +79,12 @@ public class NitriteConfig implements AutoCloseable { */ private Integer schemaVersion = Constants.INITIAL_SCHEMA_VERSION; + @Getter + /** + * Indicates if repository type validation is disabled. + */ + private boolean repositoryTypeValidationDisabled = false; + /** * Instantiates a new {@link NitriteConfig}. */ @@ -103,6 +109,20 @@ public void fieldSeparator(String separator) { NitriteConfig.fieldSeparator = separator; } + /** + * Disables repository type validation. + * + * @throws InvalidOperationException if the repository type validation is attempted to be + * changed after database initialization. + */ + public void disableRepositoryTypeValidation() { + if (configured) { + throw new InvalidOperationException("Cannot change repository type validation after database" + + " initialization"); + } + this.repositoryTypeValidationDisabled = true; + } + /** * Registers an {@link EntityConverter} with the Nitrite database. * @@ -157,7 +177,7 @@ public NitriteConfig addMigration(Migration migration) { TreeMap targetMap = migrations.computeIfAbsent(start, k -> new TreeMap<>()); Migration existing = targetMap.get(end); if (existing != null) { - log.warn("Overriding migration " + existing + " with " + migration); + log.warn("Overriding migration {} with {}", existing, migration); } targetMap.put(end, migration); } diff --git a/nitrite/src/main/java/org/dizitart/no2/common/util/ValidationUtils.java b/nitrite/src/main/java/org/dizitart/no2/common/util/ValidationUtils.java index 6adfcb86..2c664eb5 100644 --- a/nitrite/src/main/java/org/dizitart/no2/common/util/ValidationUtils.java +++ b/nitrite/src/main/java/org/dizitart/no2/common/util/ValidationUtils.java @@ -16,6 +16,7 @@ package org.dizitart.no2.common.util; +import org.dizitart.no2.NitriteConfig; import org.dizitart.no2.collection.Document; import org.dizitart.no2.common.mapper.NitriteMapper; import org.dizitart.no2.exceptions.IndexingException; @@ -149,7 +150,7 @@ public static void validateProjectionType(Class type, NitriteMapper nitriteMa } } - public static void validateRepositoryType(Class type, NitriteMapper nitriteMapper) { + public static void validateRepositoryType(Class type, NitriteConfig nitriteConfig) { Object value; try { if (type.isInterface() || (Modifier.isAbstract(type.getModifiers()) && !isBuiltInValueType(type))) { @@ -157,14 +158,17 @@ public static void validateRepositoryType(Class type, NitriteMapper nitriteMa return; } - value = newInstance(type, false, nitriteMapper); - if (value == null) { - throw new ValidationException("Cannot create new instance of type " + type); - } - - Document document = (Document) nitriteMapper.tryConvert(value, Document.class); - if (document == null || document.size() == 0) { - throw new ValidationException("Cannot convert to document from type " + type); + if (!nitriteConfig.isRepositoryTypeValidationDisabled()) { + NitriteMapper nitriteMapper = nitriteConfig.nitriteMapper(); + value = newInstance(type, false, nitriteMapper); + if (value == null) { + throw new ValidationException("Cannot create new instance of type " + type); + } + + Document document = (Document) nitriteMapper.tryConvert(value, Document.class); + if (document == null || document.size() == 0) { + throw new ValidationException("Cannot convert to document from type " + type); + } } } catch (Exception e) { throw new ValidationException("Invalid repository type", e); diff --git a/nitrite/src/main/java/org/dizitart/no2/repository/RepositoryFactory.java b/nitrite/src/main/java/org/dizitart/no2/repository/RepositoryFactory.java index 06a7c302..2d2cf72f 100644 --- a/nitrite/src/main/java/org/dizitart/no2/repository/RepositoryFactory.java +++ b/nitrite/src/main/java/org/dizitart/no2/repository/RepositoryFactory.java @@ -19,7 +19,6 @@ import org.dizitart.no2.NitriteConfig; import org.dizitart.no2.collection.CollectionFactory; import org.dizitart.no2.collection.NitriteCollection; -import org.dizitart.no2.common.mapper.NitriteMapper; import org.dizitart.no2.common.util.StringUtils; import org.dizitart.no2.exceptions.NitriteIOException; import org.dizitart.no2.exceptions.ValidationException; @@ -133,10 +132,9 @@ public void clear() { private ObjectRepository createRepository(NitriteConfig nitriteConfig, Class type, String collectionName, String key) { - NitriteMapper nitriteMapper = nitriteConfig.nitriteMapper(); NitriteStore store = nitriteConfig.getNitriteStore(); - validateRepositoryType(type, nitriteMapper); + validateRepositoryType(type, nitriteConfig); if (store.getCollectionNames().contains(collectionName)) { throw new ValidationException("A collection with same entity name already exists"); @@ -154,14 +152,13 @@ private ObjectRepository createRepository(NitriteConfig nitriteConfig, Cl private ObjectRepository createRepositoryByDecorator(NitriteConfig nitriteConfig, EntityDecorator entityDecorator, String collectionName, String key) { - NitriteMapper nitriteMapper = nitriteConfig.nitriteMapper(); NitriteStore store = nitriteConfig.getNitriteStore(); if (store.getCollectionNames().contains(collectionName)) { throw new ValidationException("A collection with same entity name already exists"); } - validateRepositoryType(entityDecorator.getEntityType(), nitriteMapper); + validateRepositoryType(entityDecorator.getEntityType(), nitriteConfig); NitriteCollection nitriteCollection = collectionFactory.getCollection(collectionName, nitriteConfig, false); diff --git a/nitrite/src/test/java/org/dizitart/no2/common/util/ValidationUtilsTest.java b/nitrite/src/test/java/org/dizitart/no2/common/util/ValidationUtilsTest.java index 5a8e0b17..5cc36012 100644 --- a/nitrite/src/test/java/org/dizitart/no2/common/util/ValidationUtilsTest.java +++ b/nitrite/src/test/java/org/dizitart/no2/common/util/ValidationUtilsTest.java @@ -16,6 +16,7 @@ package org.dizitart.no2.common.util; +import org.dizitart.no2.NitriteConfig; import org.dizitart.no2.common.mapper.SimpleNitriteMapper; import org.dizitart.no2.exceptions.ValidationException; import org.dizitart.no2.integration.Retry; @@ -96,18 +97,19 @@ public void testValidateProjectionType() { @Test public void testValidateRepositoryType() { - SimpleNitriteMapper documentMapper = new SimpleNitriteMapper(); - documentMapper.registerEntityConverter(new ClassA.ClassAConverter()); - documentMapper.registerEntityConverter(new ClassBConverter()); - documentMapper.registerEntityConverter(new EmptyClass.Converter()); + NitriteConfig nitriteConfig = new NitriteConfig(); + nitriteConfig.registerEntityConverter(new ClassA.ClassAConverter()); + nitriteConfig.registerEntityConverter(new ClassBConverter()); + nitriteConfig.registerEntityConverter(new EmptyClass.Converter()); + nitriteConfig.autoConfigure(); - validateRepositoryType(ClassA.class, documentMapper); + validateRepositoryType(ClassA.class, nitriteConfig); - assertThrows(ValidationException.class, () -> validateRepositoryType(EmptyClass.class, documentMapper)); - assertThrows(ValidationException.class, () -> validateRepositoryType(ClassC.class, documentMapper)); - assertThrows(ValidationException.class, () -> validateRepositoryType(String.class, documentMapper)); - assertThrows(ValidationException.class, () -> validateRepositoryType(Number.class, documentMapper)); - assertThrows(ValidationException.class, () -> validateRepositoryType(Integer.class, documentMapper)); - assertThrows(ValidationException.class, () -> validateRepositoryType(Object.class, documentMapper)); + assertThrows(ValidationException.class, () -> validateRepositoryType(EmptyClass.class, nitriteConfig)); + assertThrows(ValidationException.class, () -> validateRepositoryType(ClassC.class, nitriteConfig)); + assertThrows(ValidationException.class, () -> validateRepositoryType(String.class, nitriteConfig)); + assertThrows(ValidationException.class, () -> validateRepositoryType(Number.class, nitriteConfig)); + assertThrows(ValidationException.class, () -> validateRepositoryType(Integer.class, nitriteConfig)); + assertThrows(ValidationException.class, () -> validateRepositoryType(Object.class, nitriteConfig)); } } diff --git a/pom.xml b/pom.xml index 3a0fed52..bcf2cc4d 100644 --- a/pom.xml +++ b/pom.xml @@ -62,6 +62,7 @@ 2.16.1 1.9.24 1.6.3 + 0.6.0-RC.2 1.18.32 1.18.20.0 4.13.2 @@ -291,6 +292,12 @@ ${kotlin.version} test + + org.jetbrains.kotlinx + kotlinx-datetime-jvm + ${kotlinx-datetime.version} + test + diff --git a/potassium-nitrite/pom.xml b/potassium-nitrite/pom.xml index f8468cfa..cea167c1 100644 --- a/potassium-nitrite/pom.xml +++ b/potassium-nitrite/pom.xml @@ -123,6 +123,11 @@ log4j-core test + + org.jetbrains.kotlinx + kotlinx-datetime-jvm + test + diff --git a/potassium-nitrite/src/main/kotlin/org/dizitart/kno2/Builder.kt b/potassium-nitrite/src/main/kotlin/org/dizitart/kno2/Builder.kt index eb14b6a4..21b8cd41 100644 --- a/potassium-nitrite/src/main/kotlin/org/dizitart/kno2/Builder.kt +++ b/potassium-nitrite/src/main/kotlin/org/dizitart/kno2/Builder.kt @@ -49,6 +49,23 @@ class Builder internal constructor() { */ var fieldSeparator: String = NitriteConfig.getFieldSeparator() + /** + * Enables/disables the repository type validation for the Nitrite database. + *

+ * Repository type validation is a feature in Nitrite that ensures the type of the objects + * stored in the repository can be converted to and from [org.dizitart.no2.collection.Document]. + *

+ * By default, the repository type validation is enabled. If you disable it, and if you try to + * store an object that cannot be converted to a [org.dizitart.no2.collection.Document], + * then Nitrite will throw an exception during the operation. + * + * @see org.dizitart.no2.collection.Document + * @see org.dizitart.no2.repository.ObjectRepository + * @see org.dizitart.no2.common.mapper.EntityConverter + * @since 4.3.0 + */ + var enableRepositoryValidation = true + /** * Loads a [NitriteModule] into the Nitrite database. The module can be used to extend the * functionality of Nitrite. @@ -88,6 +105,10 @@ class Builder internal constructor() { builder.schemaVersion(schemaVersion) } + if (!enableRepositoryValidation) { + builder.disableRepositoryTypeValidation() + } + if (entityConverters.isNotEmpty()) { entityConverters.forEach { builder.registerEntityConverter(it) } } diff --git a/potassium-nitrite/src/test/kotlin/org/dizitart/kno2/KotlinXSerializationMapperTest.kt b/potassium-nitrite/src/test/kotlin/org/dizitart/kno2/KotlinXSerializationMapperTest.kt index 57c8b367..b098fbe9 100644 --- a/potassium-nitrite/src/test/kotlin/org/dizitart/kno2/KotlinXSerializationMapperTest.kt +++ b/potassium-nitrite/src/test/kotlin/org/dizitart/kno2/KotlinXSerializationMapperTest.kt @@ -23,6 +23,7 @@ import org.dizitart.kno2.filters.eq import org.dizitart.kno2.serialization.KotlinXSerializationMapper import org.dizitart.no2.collection.Document import org.dizitart.no2.common.module.NitriteModule.module +import org.dizitart.no2.exceptions.ValidationException import org.dizitart.no2.mvstore.MVStoreModule import org.junit.Test import org.slf4j.LoggerFactory @@ -180,4 +181,51 @@ class KotlinXSerializationMapperTest { testData.someArray.forEachIndexed { index, s -> assertEquals(decodedObject.someArray[index], s) } assertEquals(testData, decodedObject.copy(someArray = testData.someArray)) } -} \ No newline at end of file + + @Test(expected = ValidationException::class) + fun testRepositoryValidationEnabled() { + val db = nitrite { + loadModule(MVStoreModule(dbPath)) + loadModule(module(KotlinXSerializationMapper())) + } + + val repo = db.getRepository() + repo.insert(CacheEntry("sha256", kotlinx.datetime.Clock.System.now())) + repo.find(CacheEntry::sha256 eq "sha256").firstOrNull().also { + assertEquals(it?.sha256, "sha256") + } + db.close() + try { + Files.delete(Paths.get(dbPath)) + } catch (e: Exception) { + log.error("Failed to delete db file", e) + } + } + + @Test + fun testRepositoryValidationDisabled() { + val db = nitrite { + enableRepositoryValidation = false + loadModule(MVStoreModule(dbPath)) + loadModule(module(KotlinXSerializationMapper())) + } + + val repo = db.getRepository() + repo.insert(CacheEntry("sha256", kotlinx.datetime.Clock.System.now())) + repo.find(CacheEntry::sha256 eq "sha256").firstOrNull().also { + assertEquals(it?.sha256, "sha256") + } + db.close() + try { + Files.delete(Paths.get(dbPath)) + } catch (e: Exception) { + log.error("Failed to delete db file", e) + } + } +} + +@Serializable +data class CacheEntry( + val sha256: String, + val lastUpdated: kotlinx.datetime.Instant +) \ No newline at end of file From 42912056c46c28039a1eb19015e05d59e41aad18 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 May 2024 22:50:53 +0530 Subject: [PATCH 44/59] Bump org.jetbrains.kotlinx:kotlinx-datetime-jvm from 0.6.0-RC.2 to 0.6.0 (#974) Bumps [org.jetbrains.kotlinx:kotlinx-datetime-jvm](https://github.com/Kotlin/kotlinx-datetime) from 0.6.0-RC.2 to 0.6.0. - [Release notes](https://github.com/Kotlin/kotlinx-datetime/releases) - [Changelog](https://github.com/Kotlin/kotlinx-datetime/blob/master/CHANGELOG.md) - [Commits](https://github.com/Kotlin/kotlinx-datetime/compare/v0.6.0-RC.2...v0.6.0) --- updated-dependencies: - dependency-name: org.jetbrains.kotlinx:kotlinx-datetime-jvm dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bcf2cc4d..562beba1 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 2.16.1 1.9.24 1.6.3 - 0.6.0-RC.2 + 0.6.0 1.18.32 1.18.20.0 4.13.2 From 32aa8b36c025e785acc9ee23f1601190f47a6633 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 May 2024 21:14:49 +0530 Subject: [PATCH 45/59] --- (#975) updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-stdlib dependency-type: direct:production update-type: version-update:semver-major - dependency-name: org.jetbrains.kotlin:kotlin-reflect dependency-type: direct:production update-type: version-update:semver-major - dependency-name: org.jetbrains.kotlin:kotlin-test dependency-type: direct:development update-type: version-update:semver-major - dependency-name: org.jetbrains.kotlin:kotlin-test-junit dependency-type: direct:production update-type: version-update:semver-major - dependency-name: org.jetbrains.kotlin:kotlin-maven-serialization dependency-type: direct:production update-type: version-update:semver-major - dependency-name: org.jetbrains.kotlin:kotlin-maven-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 562beba1..2c2ae219 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.19.0 1.17.0 2.16.1 - 1.9.24 + 2.0.0 1.6.3 0.6.0 1.18.32 From 4af6d11a2eec974aab15c2ff27015ed5883d9fe1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 May 2024 08:08:53 +0530 Subject: [PATCH 46/59] Bump org.rocksdb:rocksdbjni from 9.1.1 to 9.2.1 (#976) Bumps [org.rocksdb:rocksdbjni](https://github.com/facebook/rocksdb) from 9.1.1 to 9.2.1. - [Release notes](https://github.com/facebook/rocksdb/releases) - [Changelog](https://github.com/facebook/rocksdb/blob/v9.2.1/HISTORY.md) - [Commits](https://github.com/facebook/rocksdb/compare/v9.1.1...v9.2.1) --- updated-dependencies: - dependency-name: org.rocksdb:rocksdbjni dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2c2ae219..317c2022 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ 2.0.13 1.9.3 2.2.224 - 9.1.1 + 9.2.1 5.5.0 1.19.0 1.17.0 From db94633519f681ae8fdf3157c168e57c4f898e23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 22:27:08 +0530 Subject: [PATCH 47/59] Bump org.sonatype.plugins:nexus-staging-maven-plugin (#978) Bumps org.sonatype.plugins:nexus-staging-maven-plugin from 1.6.13 to 1.7.0. --- updated-dependencies: - dependency-name: org.sonatype.plugins:nexus-staging-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 317c2022..3d91d780 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 1.9.20 1.23 7.0_r2 - 1.6.13 + 1.7.0 3.2.4 From a4f351f3e62b9bd6e64bf92fe8cbb7182d54c72d Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee <696662+anidotnet@users.noreply.github.com> Date: Fri, 31 May 2024 09:05:45 +0530 Subject: [PATCH 48/59] Handle mvstore file corruption gracefully (#979) * safe openMVMap introduced * handling mvstore file corruption gracefully * Update CHANGELOG.md --- CHANGELOG.md | 1 + .../dizitart/no2/mvstore/NitriteMVStore.java | 49 +++++++++++++++++-- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76adcc95..25c11267 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Fix for #948 - Fix for #961 - Fix for #966 +- Fix for #977 ## Release 4.2.2 - Mar 5, 2024 diff --git a/nitrite-mvstore-adapter/src/main/java/org/dizitart/no2/mvstore/NitriteMVStore.java b/nitrite-mvstore-adapter/src/main/java/org/dizitart/no2/mvstore/NitriteMVStore.java index 8834cc83..e4b80e62 100644 --- a/nitrite-mvstore-adapter/src/main/java/org/dizitart/no2/mvstore/NitriteMVStore.java +++ b/nitrite-mvstore-adapter/src/main/java/org/dizitart/no2/mvstore/NitriteMVStore.java @@ -17,7 +17,9 @@ package org.dizitart.no2.mvstore; +import lombok.extern.slf4j.Slf4j; import org.dizitart.no2.common.util.StringUtils; +import org.dizitart.no2.exceptions.NitriteIOException; import org.dizitart.no2.index.BoundingBox; import org.dizitart.no2.store.AbstractNitriteStore; import org.dizitart.no2.store.NitriteMap; @@ -26,15 +28,19 @@ import org.dizitart.no2.store.events.StoreEvents; import org.h2.mvstore.MVMap; import org.h2.mvstore.MVStore; +import org.h2.mvstore.MVStoreException; import org.h2.mvstore.rtree.MVRTreeMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import static org.h2.mvstore.DataUtils.*; + /** * @since 1.0 * @author Anindya Chatterjee */ +@Slf4j public class NitriteMVStore extends AbstractNitriteStore { private MVStore mvStore; private final Map> nitriteMapRegistry; @@ -109,7 +115,7 @@ public NitriteMap openMap(String mapName, Class keyT return (NitriteMVMap) nitriteMapRegistry.get(mapName); } - MVMap mvMap = mvStore.openMap(mapName); + MVMap mvMap = openMVMap(mapName, null); NitriteMVMap nitriteMVMap = new NitriteMVMap<>(mvMap, this); nitriteMapRegistry.put(mapName, nitriteMVMap); return nitriteMVMap; @@ -131,7 +137,7 @@ public void closeRTree(String rTreeName) { @Override public void removeMap(String name) { - MVMap mvMap = mvStore.openMap(name); + MVMap mvMap = openMVMap(name, null); mvStore.removeMap(mvMap); getCatalog().remove(name); nitriteMapRegistry.remove(name); @@ -140,7 +146,7 @@ public void removeMap(String name) { @Override @SuppressWarnings({"rawtypes"}) public void removeRTree(String rTreeName) { - MVMap mvMap = mvStore.openMap(rTreeName, new MVRTreeMap.Builder<>()); + MVMap mvMap = openMVMap(rTreeName, new MVRTreeMap.Builder<>()); mvStore.removeMap(mvMap); getCatalog().remove(rTreeName); nitriteRTreeMapRegistry.remove(rTreeName); @@ -153,7 +159,7 @@ public NitriteRTree openRTree(Strin return (NitriteMVRTreeMap) nitriteRTreeMapRegistry.get(mapName); } - MVRTreeMap map = mvStore.openMap(mapName, new MVRTreeMap.Builder<>()); + MVRTreeMap map = (MVRTreeMap) openMVMap(mapName, new MVRTreeMap.Builder<>()); NitriteMVRTreeMap nitriteMVRTreeMap = new NitriteMVRTreeMap(map, this); nitriteRTreeMapRegistry.put(mapName, nitriteMVRTreeMap); return nitriteMVRTreeMap; @@ -171,4 +177,39 @@ private void initEventBus() { } } } + + @SuppressWarnings({"rawtypes", "unchecked"}) + private MVMap openMVMap(String mapName, MVMap.MapBuilder builder) { + Exception exception = null; + try { + MVMap.MapBuilder mapBuilder = builder == null ? new MVMap.Builder<>() : builder; + long version = mvStore.getCurrentVersion(); + + while (version >= 0) { + try { + return mvStore.openMap(mapName, mapBuilder); + } catch (MVStoreException me) { + if (version == 0) { + throw me; + } + + log.warn("Error opening map {} with version {}, retrying with previous version", mapName, version, me); + if (me.getErrorCode() == ERROR_READING_FAILED || me.getErrorCode() == ERROR_WRITING_FAILED + || me.getErrorCode() == ERROR_FILE_CORRUPT || me.getErrorCode() == ERROR_SERIALIZATION + || me.getErrorCode() == ERROR_CHUNK_NOT_FOUND || me.getErrorCode() == ERROR_BLOCK_NOT_FOUND) { + // open map with earlier version + mvStore.rollbackTo(version - 1); + version = mvStore.getCurrentVersion(); + } else { + throw me; + } + exception = me; + } + } + } catch (Exception e) { + exception = e; + } + + throw new NitriteIOException("Unable to open map " + mapName, exception); + } } From 700528cd40b11099ecfeaabff9f08d9d149ac490 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 10:17:43 +0530 Subject: [PATCH 49/59] Bump com.google.guava:guava from 33.2.0-jre to 33.2.1-jre (#982) Bumps [com.google.guava:guava](https://github.com/google/guava) from 33.2.0-jre to 33.2.1-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3d91d780..cf667bd0 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ 4.0.2 4.0.5 1.0.2 - 33.2.0-jre + 33.2.1-jre 1.6.9 2.27.1 From 8e4eb1c6072343ffcc7ea989239ba59b0db87bab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 10:17:54 +0530 Subject: [PATCH 50/59] Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.3 to 3.7.0 (#981) Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.6.3 to 3.7.0. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.6.3...maven-javadoc-plugin-3.7.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cf667bd0..58b6700a 100644 --- a/pom.xml +++ b/pom.xml @@ -83,7 +83,7 @@ 0.8.12 3.2.5 3.13.0 - 3.6.3 + 3.7.0 3.3.1 1.9.20 1.23 From 71485a746a36faa25e4d19616f8685847fcca234 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 10:18:02 +0530 Subject: [PATCH 51/59] Bump com.google.errorprone:error_prone_core from 2.27.1 to 2.28.0 (#980) Bumps [com.google.errorprone:error_prone_core](https://github.com/google/error-prone) from 2.27.1 to 2.28.0. - [Release notes](https://github.com/google/error-prone/releases) - [Commits](https://github.com/google/error-prone/compare/v2.27.1...v2.28.0) --- updated-dependencies: - dependency-name: com.google.errorprone:error_prone_core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 58b6700a..4ea417b7 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 33.2.1-jre 1.6.9 - 2.27.1 + 2.28.0 0.8.12 3.2.5 3.13.0 From 471c32fc26e3dadd38d2ea8ec587361c6a2d88dd Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee <696662+anidotnet@users.noreply.github.com> Date: Sun, 9 Jun 2024 10:41:10 +0530 Subject: [PATCH 52/59] Update pom.xml (#984) removed kotlin.version from potassium nitrite --- potassium-nitrite/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/potassium-nitrite/pom.xml b/potassium-nitrite/pom.xml index cea167c1..ae883527 100644 --- a/potassium-nitrite/pom.xml +++ b/potassium-nitrite/pom.xml @@ -15,7 +15,6 @@ UTF-8 - 1.9.0 true From 7ebb91e85dd0db6ab33b74b5a850499f94707cea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 9 Jun 2024 12:01:55 +0530 Subject: [PATCH 53/59] Bump org.jetbrains.kotlinx:kotlinx-serialization-json (#983) Bumps [org.jetbrains.kotlinx:kotlinx-serialization-json](https://github.com/Kotlin/kotlinx.serialization) from 1.6.3 to 1.7.0. - [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases) - [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md) - [Commits](https://github.com/Kotlin/kotlinx.serialization/compare/v1.6.3...v1.7.0) --- updated-dependencies: - dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-json dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4ea417b7..f269569b 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.17.0 2.16.1 2.0.0 - 1.6.3 + 1.7.0 0.6.0 1.18.32 1.18.20.0 From bfb33182bf30872be9169a3776232bf55316700f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 16 Jun 2024 13:30:10 +0530 Subject: [PATCH 54/59] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.5 to 3.3.0 (#985) Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.5 to 3.3.0. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.5...surefire-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f269569b..b94d8507 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ 2.28.0 0.8.12 - 3.2.5 + 3.3.0 3.13.0 3.7.0 3.3.1 From b349650f86b70337e4c01cb12d1924b2883385a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 20:42:10 +0530 Subject: [PATCH 55/59] Bump uk.co.jemos.podam:podam from 8.0.1.RELEASE to 8.0.2.RELEASE (#987) Bumps [uk.co.jemos.podam:podam](https://github.com/mtedone/podam) from 8.0.1.RELEASE to 8.0.2.RELEASE. - [Release notes](https://github.com/mtedone/podam/releases) - [Commits](https://github.com/mtedone/podam/compare/8.0.1.RELEASE...8.0.2.RELEASE) --- updated-dependencies: - dependency-name: uk.co.jemos.podam:podam dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b94d8507..7d4679d2 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 1.18.20.0 4.13.2 5.12.0 - 8.0.1.RELEASE + 8.0.2.RELEASE 2.23.1 4.2.1 2.12.7 From 1cfddb660d68eec1ea6ad1d9af1f058de23043b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 20:42:22 +0530 Subject: [PATCH 56/59] Bump org.jetbrains.kotlinx:kotlinx-serialization-json (#986) Bumps [org.jetbrains.kotlinx:kotlinx-serialization-json](https://github.com/Kotlin/kotlinx.serialization) from 1.7.0 to 1.7.1. - [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases) - [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md) - [Commits](https://github.com/Kotlin/kotlinx.serialization/compare/v1.7.0...v1.7.1) --- updated-dependencies: - dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7d4679d2..fe909f00 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.17.0 2.16.1 2.0.0 - 1.7.0 + 1.7.1 0.6.0 1.18.32 1.18.20.0 From c0404b5b433f9bd2cf6deebecbdd2fb5f6372af0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 29 Jun 2024 13:16:31 +0530 Subject: [PATCH 57/59] Bump org.projectlombok:lombok from 1.18.32 to 1.18.34 (#989) Bumps [org.projectlombok:lombok](https://github.com/projectlombok/lombok) from 1.18.32 to 1.18.34. - [Changelog](https://github.com/projectlombok/lombok/blob/master/doc/changelog.markdown) - [Commits](https://github.com/projectlombok/lombok/compare/v1.18.32...v1.18.34) --- updated-dependencies: - dependency-name: org.projectlombok:lombok dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fe909f00..6cc83295 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 2.0.0 1.7.1 0.6.0 - 1.18.32 + 1.18.34 1.18.20.0 4.13.2 5.12.0 From 2e0b69e2fc7d9b72c66e63b479052211a8cb45c9 Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee <696662+anidotnet@users.noreply.github.com> Date: Sun, 30 Jun 2024 14:14:46 +0530 Subject: [PATCH 58/59] Fix for #990 (#991) * #990 is fixed * test case updated * remove migration test for in-memory mvstore adapter * test cases fixed --- .gitignore | 1 + .../dizitart/no2/mvstore/MVStoreUtils.java | 45 ++++++++++-------- .../no2/mvstore/compat/v1/UpgradeUtil.java | 7 ++- .../java/org/dizitart/no2/NitriteTest.java | 44 ++++++++++++++++- .../collection/BaseCollectionTest.java | 2 +- .../CollectionCompoundIndexNegativeTest.java | 2 +- .../no2/mvstore/MVStoreUtilsTest.java | 8 ++-- .../no2/mvstore/NitriteMVStoreTest.java | 2 +- .../src/test/resources/no2-v3.db | Bin 0 -> 16384 bytes 9 files changed, 82 insertions(+), 29 deletions(-) create mode 100644 nitrite-mvstore-adapter/src/test/resources/no2-v3.db diff --git a/.gitignore b/.gitignore index 6c74eda3..0eb46726 100644 --- a/.gitignore +++ b/.gitignore @@ -451,6 +451,7 @@ captures/ test.log /build !no2-old.db +!no2-v3.db .diffblue infer-out secring.gpg \ No newline at end of file diff --git a/nitrite-mvstore-adapter/src/main/java/org/dizitart/no2/mvstore/MVStoreUtils.java b/nitrite-mvstore-adapter/src/main/java/org/dizitart/no2/mvstore/MVStoreUtils.java index 93cd5f56..2bd30c13 100644 --- a/nitrite-mvstore-adapter/src/main/java/org/dizitart/no2/mvstore/MVStoreUtils.java +++ b/nitrite-mvstore-adapter/src/main/java/org/dizitart/no2/mvstore/MVStoreUtils.java @@ -17,18 +17,15 @@ package org.dizitart.no2.mvstore; import lombok.extern.slf4j.Slf4j; -import org.dizitart.no2.common.meta.Attributes; import org.dizitart.no2.exceptions.InvalidOperationException; import org.dizitart.no2.exceptions.NitriteIOException; import org.dizitart.no2.mvstore.compat.v1.UpgradeUtil; -import org.h2.mvstore.MVMap; import org.h2.mvstore.MVStore; import org.h2.mvstore.MVStoreException; import java.io.File; +import java.util.Map; -import static org.dizitart.no2.common.Constants.META_MAP_NAME; -import static org.dizitart.no2.common.Constants.STORE_INFO; import static org.dizitart.no2.common.util.StringUtils.isNullOrEmpty; /** @@ -38,6 +35,10 @@ @Slf4j(topic = "nitrite-mvstore") @SuppressWarnings("ALL") class MVStoreUtils { + private static final String OLD_DATABASE_FORMAT = "Old database format detected."; + private static final String OLD_STORE_FORMAT = "The write format 1 is smaller than the supported format"; + private static final Integer OLD_DATABASE_FORMAT_VERSION = 29062024; + private MVStoreUtils() { } @@ -48,7 +49,10 @@ static MVStore openOrCreate(MVStoreConfig storeConfig) { File dbFile = !isNullOrEmpty(storeConfig.filePath()) ? new File(storeConfig.filePath()) : null; try { store = builder.open(); - testForMigration(store); + if (dbFile != null) { + // if the store is file based, test for migration + testForMigration(store); + } } catch (MVStoreException me) { if (me.getMessage().contains("file is locked")) { throw new NitriteIOException("Database is already opened in other process"); @@ -105,7 +109,7 @@ static MVStore openOrCreate(MVStoreConfig storeConfig) { } private static boolean isCompatibilityError(Exception e) { - return e.getMessage().contains("The write format 1 is smaller than the supported format"); + return e.getMessage().contains(OLD_DATABASE_FORMAT) || e.getMessage().contains(OLD_STORE_FORMAT); } private static MVStore.Builder createBuilder(MVStoreConfig mvStoreConfig) { @@ -210,22 +214,23 @@ private static void switchFiles(File newFile, File orgFile) { private static void testForMigration(MVStore store) { if (store != null) { - if (store.hasMap(STORE_INFO)) { - return; + Map storeHeader = store.getStoreHeader(); + if (storeHeader == null || storeHeader.isEmpty()) { + throw new MVStoreException(OLD_DATABASE_FORMAT_VERSION, OLD_DATABASE_FORMAT); } - MVStore.TxCounter txCounter = store.registerVersionUsage(); - MVMap metaMap = store.openMap(META_MAP_NAME); - try { - // fire one operation to trigger compatibility issue - // if no exception thrown, then the database is compatible - metaMap.remove("MigrationTest"); - } catch (IllegalStateException e) { - store.close(); - throw e; - } finally { - if (!store.isClosed()) { - store.deregisterVersionUsage(txCounter); + if (storeHeader.containsKey("format")) { + Object rawFormatValue = storeHeader.get("format"); + if (rawFormatValue instanceof Integer) { + int format = (int) rawFormatValue; + if (format < 3) { + throw new MVStoreException(OLD_DATABASE_FORMAT_VERSION, OLD_DATABASE_FORMAT); + } + } else { + int format = Integer.parseInt((String) storeHeader.get("format")); + if (format < 3) { + throw new MVStoreException(OLD_DATABASE_FORMAT_VERSION, OLD_DATABASE_FORMAT); + } } } } diff --git a/nitrite-mvstore-adapter/src/main/java/org/dizitart/no2/mvstore/compat/v1/UpgradeUtil.java b/nitrite-mvstore-adapter/src/main/java/org/dizitart/no2/mvstore/compat/v1/UpgradeUtil.java index 5099915a..827ba376 100644 --- a/nitrite-mvstore-adapter/src/main/java/org/dizitart/no2/mvstore/compat/v1/UpgradeUtil.java +++ b/nitrite-mvstore-adapter/src/main/java/org/dizitart/no2/mvstore/compat/v1/UpgradeUtil.java @@ -190,7 +190,12 @@ private static Document document(Compat.Document value) { Document document = Document.createDocument(); for (Map.Entry entry : value.entrySet()) { Object val = entry.getValue(); - Object migratedVal = migrateValue(val); + Object migratedVal; + if (DOC_ID.equals(entry.getKey())) { + migratedVal = String.valueOf(val); + } else { + migratedVal = migrateValue(val); + } document.put(entry.getKey(), migratedVal); } return document; diff --git a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/NitriteTest.java b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/NitriteTest.java index a4a07c3b..1a3d2652 100644 --- a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/NitriteTest.java +++ b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/NitriteTest.java @@ -436,6 +436,44 @@ public void testIssue193() throws InterruptedException { pool.shutdown(); } + @Test + public void testUpdateDocumentsFromVersion3() throws IOException { + if (Files.exists(Paths.get(System.getProperty("java.io.tmpdir") + File.separator + "no2-v3.db"))) { + Files.delete(Paths.get(System.getProperty("java.io.tmpdir") + File.separator + "no2-v3.db")); + } + + InputStream stream = ClassLoader.getSystemResourceAsStream("no2-v3.db"); + if (stream == null) { + stream = ClassLoader.getSystemClassLoader().getResourceAsStream("no2-v3.db"); + } + assert stream != null; + + Files.copy(stream, Paths.get(System.getProperty("java.io.tmpdir") + File.separator + "no2-v3.db")); + + String oldDbFile = System.getProperty("java.io.tmpdir") + File.separator + "no2-v3.db"; + Nitrite db = TestUtil.createDb(oldDbFile); + NitriteCollection testCollection = db.getCollection("test"); + Document document = testCollection.find().firstOrNull(); + document.put("name", "new-name"); + + boolean exception = false; + try { + testCollection.update(document); + } catch (Exception e) { + exception = true; + log.error("Error while updating document", e); + } + assertFalse(exception); + + db.close(); + + try { + Files.deleteIfExists(Paths.get(oldDbFile)); + } catch (IOException e) { + log.error("Error while deleting db", e); + } + } + @Test public void testReadCompatibility() throws IOException { // ******* Old DB Creation Code Start ********* @@ -531,7 +569,11 @@ public void testReadCompatibility() throws IOException { db.close(); - //TODO: CHeck reopen with repo. That should also fails too. + try { + Files.deleteIfExists(Paths.get(oldDbFile)); + } catch (IOException e) { + log.error("Error while deleting db", e); + } } @Test diff --git a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/collection/BaseCollectionTest.java b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/collection/BaseCollectionTest.java index 200d7c87..033a279e 100644 --- a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/collection/BaseCollectionTest.java +++ b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/collection/BaseCollectionTest.java @@ -64,7 +64,7 @@ public abstract class BaseCollectionTest { public Retry retry = new Retry(3); @Parameterized.Parameters(name = "InMemory = {0}, Secured = {1}, " + - "Compressed = {2}, AutoCommit = {3}, AutoCompact = {4}") + "Compressed = {2}, AutoCommit = {3}") public static Collection data() { return Arrays.asList(new Object[][]{ {false, false, false, false}, diff --git a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/collection/CollectionCompoundIndexNegativeTest.java b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/collection/CollectionCompoundIndexNegativeTest.java index 746fe397..b9e62725 100644 --- a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/collection/CollectionCompoundIndexNegativeTest.java +++ b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/integration/collection/CollectionCompoundIndexNegativeTest.java @@ -57,7 +57,7 @@ public void testCreateUniqueMultiKeyIndexOnArray() { public void testCreateOnInvalidField() { insert(); // multiple null value will be created - collection.createIndex( "my-value", "lastName"); + collection.createIndex("my-value", "lastName"); } @Test(expected = IndexingException.class) diff --git a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/mvstore/MVStoreUtilsTest.java b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/mvstore/MVStoreUtilsTest.java index 78f61ef9..0873e21a 100644 --- a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/mvstore/MVStoreUtilsTest.java +++ b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/mvstore/MVStoreUtilsTest.java @@ -33,9 +33,9 @@ public void testOpenOrCreate() { assertEquals(0, actualOpenOrCreateResult.getUnsavedMemory()); assertEquals(0, actualOpenOrCreateResult.getStoreVersion()); assertEquals(0, actualOpenOrCreateResult.getRetentionTime()); - assertEquals(2, actualOpenOrCreateResult.getMetaMap().size()); + assertEquals(0, actualOpenOrCreateResult.getMetaMap().size()); assertEquals(Long.MAX_VALUE, actualOpenOrCreateResult.getMaxPageSize()); - assertEquals(1, actualOpenOrCreateResult.getMapNames().size()); + assertEquals(0, actualOpenOrCreateResult.getMapNames().size()); assertEquals(48, actualOpenOrCreateResult.getKeysPerPage()); assertEquals(0, actualOpenOrCreateResult.getAutoCommitMemory()); } @@ -50,9 +50,9 @@ public void testOpenOrCreate2() { assertEquals(0, actualOpenOrCreateResult.getUnsavedMemory()); assertEquals(0, actualOpenOrCreateResult.getStoreVersion()); assertEquals(0, actualOpenOrCreateResult.getRetentionTime()); - assertEquals(2, actualOpenOrCreateResult.getMetaMap().size()); + assertEquals(0, actualOpenOrCreateResult.getMetaMap().size()); assertEquals(Long.MAX_VALUE, actualOpenOrCreateResult.getMaxPageSize()); - assertEquals(1, actualOpenOrCreateResult.getMapNames().size()); + assertEquals(0, actualOpenOrCreateResult.getMapNames().size()); assertEquals(48, actualOpenOrCreateResult.getKeysPerPage()); assertEquals(0, actualOpenOrCreateResult.getAutoCommitMemory()); } diff --git a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/mvstore/NitriteMVStoreTest.java b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/mvstore/NitriteMVStoreTest.java index 99968fe4..955748e2 100644 --- a/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/mvstore/NitriteMVStoreTest.java +++ b/nitrite-mvstore-adapter/src/test/java/org/dizitart/no2/mvstore/NitriteMVStoreTest.java @@ -38,7 +38,7 @@ public void testOpenOrCreate() { nitriteMVStore.openOrCreate(); assertFalse(nitriteMVStore.isReadOnly()); assertFalse(nitriteMVStore.isClosed()); - assertTrue(nitriteMVStore.hasUnsavedChanges()); + assertFalse(nitriteMVStore.hasUnsavedChanges()); } @Test diff --git a/nitrite-mvstore-adapter/src/test/resources/no2-v3.db b/nitrite-mvstore-adapter/src/test/resources/no2-v3.db new file mode 100644 index 0000000000000000000000000000000000000000..c9ace3b5daf359adf68444dbca7b09944fbcabc4 GIT binary patch literal 16384 zcmeI3Piz!b9LIk%+u47GS}3%FmVH$c4{n#)KW%pxjZ;8uH%m1_Kn$__cIIt6Fgvr( zzAXz;LsdXR3>@@=HLk>qO1NP{j7bp>9z4jwix;=*&3MyDq7mPlZdSxNyETl5QiWj2nYg#fFK|U2m*qD zARq_`0)l`bAPC%70wW^--&g*kb3s555CjAPK|l}?1Ox#=KoAfF1OY+dUJ#i7kw4z5 z0Z2qG!hh;7;|i+>DC2rIsjE?&)G7P3f+t9oon6PF*%Ye~P*o$P<0v)DtYVnd8R^`wpj2I0@3<2&!#r$K?9!O+Bw}MGbrqA6 zQ3DV}Ug#X1kU`2rz%+Jat41hv=J(?%yvf4$#HPIB*b|%U74!^rXlo$GAB8pklRuyS z=G3DtCfqyJ$CNh-u8EzCuM+o1t4n+|@reKKf(&cpCi;qnF-ndl_DXFuDkm_GGZ^7-q>NMpau2A+*MS znn3@BI$ybe$)CuQyf(6rk}B=GwlGU*`7Eu7l?lbMVM<-ISVND4H&?m$x5yC4L3^v} zWEWdxIS7+_#dHtt!5t>eL8pbQbcgp3G$Ep`4(&W->%_=Gu!@3_JS%F+Ls)k#i|CY% ziNfmZrh6x%53>2rLtCw88hl6+pFqhQ06N})!UOPGV?`4{rqG7YM<|7jr9@^R9#_-- zgN9z}Pi0EDzgS8b{VFLH14D@ceW<9W+1TIkU4fuH>{r-Eip3R8fkZ)xBztXKCb5k+ zTb689j+?eY>f?O$uW&})O{G`sfpPQ%gbLjn^85Kti^Y%l+0{Le)p`nP$Tng3Y`Rcx zO5II=IVdHigcJ{_R1JIyV?b?$eVGAWr+A$8>~)vDS$B(<@{P=|Wv%doU(e@H9D;x# zAP5Kof`A|(2nYg#fFN+E2`taw3w8AIr8@d_%217g(%@Z*(hEiY3-R#T*v|C2)o&MZ2B#Jz9;UrSX=zLJrhJf?K44vEp#%CJxkEZ&1=j)4iIxe0&u=aSzFIB>iW_bu1itKR z34sf@5(0BG)8NO`!$;@#Prv^0@YcDJ>9(#(XHTzf@Pvu2qRKOm};Cy=X7NR1-p>CGAx>%i{Xk!et)U=VmV#u6l9( zYM_<5)7qW(mXbPG0=FID=Xavl+ERdD(nm~Jt>Tg^<|(I^Z2CWw zv>=kaZ#yQE*qJ}BS4qsCah1fZ3R6j*Tw<>j8v&;S4c literal 0 HcmV?d00001 From e81c6c52fc086280b95cf1c9fffb8e07e50d01ab Mon Sep 17 00:00:00 2001 From: Anindya Chatterjee Date: Mon, 1 Jul 2024 10:41:13 +0530 Subject: [PATCH 59/59] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25c11267..b721d5a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Fix for #961 - Fix for #966 - Fix for #977 +- Fix for #990 ## Release 4.2.2 - Mar 5, 2024