You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by kw...@apache.org on 2022/06/20 07:08:17 UTC
[jackrabbit-filevault] branch master updated: JCRVLT-638 fix import of empty mv property (#230)
This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git
The following commit(s) were added to refs/heads/master by this push:
new bca8d147 JCRVLT-638 fix import of empty mv property (#230)
bca8d147 is described below
commit bca8d14756298e43af8292e2d897e86684beb623
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Mon Jun 20 09:08:13 2022 +0200
JCRVLT-638 fix import of empty mv property (#230)
---
.../main/java/org/apache/jackrabbit/vault/util/DocViewProperty2.java | 2 +-
.../org/apache/jackrabbit/vault/packaging/integration/ImportIT.java | 1 +
.../protected_properties.zip/META-INF/vault/nodetypes.cnd | 2 +-
.../protected_properties.zip/jcr_root/testroot/.content.xml | 3 ++-
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/vault-core/src/main/java/org/apache/jackrabbit/vault/util/DocViewProperty2.java b/vault-core/src/main/java/org/apache/jackrabbit/vault/util/DocViewProperty2.java
index 8779993d..4d9fecd9 100644
--- a/vault-core/src/main/java/org/apache/jackrabbit/vault/util/DocViewProperty2.java
+++ b/vault-core/src/main/java/org/apache/jackrabbit/vault/util/DocViewProperty2.java
@@ -530,7 +530,7 @@ public class DocViewProperty2 {
}
}
if (isMultiValue) {
- Value[] vs = prop == null ? new Value[0] : prop.getValues();
+ Value[] vs = prop == null ? null : prop.getValues();
if (type == PropertyType.BINARY) {
return applyBinary(node, vs);
}
diff --git a/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/ImportIT.java b/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/ImportIT.java
index ed5b045e..f439f8c5 100644
--- a/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/ImportIT.java
+++ b/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/ImportIT.java
@@ -368,6 +368,7 @@ public class ImportIT extends IntegrationTestBase {
assertProperty("/testroot/jcr:createdBy", "admin"); // must have a different value than in the .content.xml as it is protected and set automatically
assertPropertyMissing("/testroot/someProtectedBooleanProperty"); // is protected and skipped in the import
assertProperty("/testroot/someUnprotectedStringProperty", "foo"); // is not protected and must be there
+ assertProperty("/testroot/someUnprotectedStringMvProperty", new String[0]);
}
@Test
diff --git a/vault-core/src/test/resources/test-packages/protected_properties.zip/META-INF/vault/nodetypes.cnd b/vault-core/src/test/resources/test-packages/protected_properties.zip/META-INF/vault/nodetypes.cnd
index cd948ef1..f9a356be 100644
--- a/vault-core/src/test/resources/test-packages/protected_properties.zip/META-INF/vault/nodetypes.cnd
+++ b/vault-core/src/test/resources/test-packages/protected_properties.zip/META-INF/vault/nodetypes.cnd
@@ -7,6 +7,6 @@
[my:Folder] > nt:hierarchyNode
- * (boolean) protected
- * (string)
-
+ - * (string) multiple
[my:mixin]
MIXIN
\ No newline at end of file
diff --git a/vault-core/src/test/resources/test-packages/protected_properties.zip/jcr_root/testroot/.content.xml b/vault-core/src/test/resources/test-packages/protected_properties.zip/jcr_root/testroot/.content.xml
index a0dc2502..44715fb7 100644
--- a/vault-core/src/test/resources/test-packages/protected_properties.zip/jcr_root/testroot/.content.xml
+++ b/vault-core/src/test/resources/test-packages/protected_properties.zip/jcr_root/testroot/.content.xml
@@ -3,5 +3,6 @@
jcr:primaryType="my:Folder"
jcr:createdBy="myself"
someProtectedBooleanProperty="{Boolean}true"
- someUnprotectedStringProperty="{String}foo">
+ someUnprotectedStringProperty="{String}foo"
+ someUnprotectedStringMvProperty="{String}[]">
</jcr:root>