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/18 07:57:44 UTC

[jackrabbit-filevault] branch bugfix/JCRVLT-638-import-empty-mv-property created (now f97be470)

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

kwin pushed a change to branch bugfix/JCRVLT-638-import-empty-mv-property
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git


      at f97be470 JCRVLT-638 fix import of empty mv property

This branch includes the following new commits:

     new f97be470 JCRVLT-638 fix import of empty mv property

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[jackrabbit-filevault] 01/01: JCRVLT-638 fix import of empty mv property

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch bugfix/JCRVLT-638-import-empty-mv-property
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git

commit f97be4705e12b55e7cfb378c0121c3ce584d2039
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Sat Jun 18 09:54:19 2022 +0200

    JCRVLT-638 fix import of empty mv property
---
 .../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>