You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ro...@apache.org on 2020/12/17 22:54:41 UTC

[jackrabbit-filevault] branch issue/JCRVLT-488 updated (bdfcdd1 -> e360e53)

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

rombert pushed a change to branch issue/JCRVLT-488
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git.


 discard bdfcdd1  JCRVLT-488 - PlatformNameFormat incorrectly sets repository names for nodes with double colons
 discard 19b1ff5  JCRVLT-488 - PlatformNameFormat incorrectly sets repository names for nodes with double colons
 discard 8758f95  JCRVLT-488 - PlatformNameFormat incorrectly sets repository names for nodes with double colons
     new 971147e  JCRVLT-488 - PlatformNameFormat incorrectly sets repository names for nodes with double colons
     new f02a551  JCRVLT-488 - PlatformNameFormat incorrectly sets repository names for nodes with double colons
     new e360e53  JCRVLT-488 - PlatformNameFormat incorrectly sets repository names for nodes with double colons

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (bdfcdd1)
            \
             N -- N -- N   refs/heads/issue/JCRVLT-488 (e360e53)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 3 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.


Summary of changes:


[jackrabbit-filevault] 02/03: JCRVLT-488 - PlatformNameFormat incorrectly sets repository names for nodes with double colons

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

rombert pushed a commit to branch issue/JCRVLT-488
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git

commit f02a55142d028be91d19bddaed8468ca003f98db
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Dec 17 23:44:09 2020 +0100

    JCRVLT-488 - PlatformNameFormat incorrectly sets repository names for nodes with double colons
    
    Replace StringBuffer with StringBuilder
---
 .../java/org/apache/jackrabbit/vault/util/PlatformNameFormat.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vault-core/src/main/java/org/apache/jackrabbit/vault/util/PlatformNameFormat.java b/vault-core/src/main/java/org/apache/jackrabbit/vault/util/PlatformNameFormat.java
index 673c00f..55d1683 100644
--- a/vault-core/src/main/java/org/apache/jackrabbit/vault/util/PlatformNameFormat.java
+++ b/vault-core/src/main/java/org/apache/jackrabbit/vault/util/PlatformNameFormat.java
@@ -64,7 +64,7 @@ public class PlatformNameFormat {
      * @return the (escaped) platform name.
      */
     public static String getPlatformName(String repositoryName) {
-        StringBuffer buf = new StringBuffer("_");
+        StringBuilder buf = new StringBuilder("_");
         boolean escapeColon = false;
         boolean useUnderscore = false;
         int numUnderscore = 0;
@@ -135,7 +135,7 @@ public class PlatformNameFormat {
      * @return the (unescaped) repository name.
      */
     public static String getRepositoryName(String platformName) {
-        StringBuffer buffer = new StringBuffer("_");
+        StringBuilder buffer = new StringBuilder("_");
         boolean firstUnderscore = false;
         for (int i=0; i<platformName.length(); i++) {
             char c = platformName.charAt(i);


[jackrabbit-filevault] 01/03: JCRVLT-488 - PlatformNameFormat incorrectly sets repository names for nodes with double colons

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

rombert pushed a commit to branch issue/JCRVLT-488
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git

commit 971147eb5368a164e25430314d883e4955f58260
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Dec 17 23:41:16 2020 +0100

    JCRVLT-488 - PlatformNameFormat incorrectly sets repository names for nodes with double colons
    
    Convert PlatformNameTest to Junit 4
---
 .../jackrabbit/vault/util/PlatformNameTest.java    | 74 ++++++++++++----------
 1 file changed, 40 insertions(+), 34 deletions(-)

diff --git a/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PlatformNameTest.java b/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PlatformNameTest.java
index fb5d547..94a9f60 100644
--- a/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PlatformNameTest.java
+++ b/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PlatformNameTest.java
@@ -17,48 +17,54 @@
 
 package org.apache.jackrabbit.vault.util;
 
-import java.util.HashMap;
-import java.util.Map;
+import static org.junit.Assert.assertEquals;
 
-import junit.framework.TestCase;
+import java.util.Arrays;
+import java.util.Collection;
 
-/**
- * {@code PlatformNameTest}...
- *
- */
-public class PlatformNameTest extends TestCase {
-
-    private Map<String, String> names = new HashMap<String, String>();
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
 
+@RunWith(Parameterized.class)
+public class PlatformNameTest {
+    
+    @Parameters(name = "platform: {0}, repo: {1}")
+    public static Collection<Object[]> data() {
+        return Arrays.asList(new Object[][] {     
+             { "test.jpg", "test.jpg" },
+             {"cq:content", "_cq_content"},
+             {"cq:test_image.jpg", "_cq_test_image.jpg"},
+             {"test_image.jpg", "test_image.jpg"},
+             {"_testimage.jpg", "_testimage.jpg"},
+             {"_test_image.jpg", "__test_image.jpg"},
+             {"cq:test:image.jpg", "_cq_test%3aimage.jpg"},
+             {"_cq_:test.jpg", "__cq_%3atest.jpg"},
+             {"_cq:test.jpg", "_cq%3atest.jpg"},
+             {"cq_:test.jpg", "cq_%3atest.jpg"},
+             {"_", "_"},
+             {":", "%3a"},
+             {":test", "%3atest"}
+       });
+    }
 
-    protected void setUp() throws Exception {
-        names.put("test.jpg", "test.jpg");
-        names.put("cq:content", "_cq_content");
-        names.put("cq:test_image.jpg", "_cq_test_image.jpg");
-        names.put("test_image.jpg", "test_image.jpg");
-        names.put("_testimage.jpg", "_testimage.jpg");
-        names.put("_test_image.jpg", "__test_image.jpg");
-        names.put("cq:test:image.jpg", "_cq_test%3aimage.jpg");
-        names.put("_cq_:test.jpg", "__cq_%3atest.jpg");
-        names.put("_cq:test.jpg", "_cq%3atest.jpg");
-        names.put("cq_:test.jpg", "cq_%3atest.jpg");
-        names.put("_", "_");
-        names.put(":", "%3a");
-        names.put(":test", "%3atest");
+    private final String repoName;
+    private final String platformName;
+    
+    public PlatformNameTest(String repoName, String platformName) {
+        this.repoName = repoName;
+        this.platformName = platformName;
     }
 
-    public void testToPlatform() {
-        for (String repName: names.keySet()) {
-            String pfName = names.get(repName);
-            assertEquals("Repo("+repName+")->Platform", pfName, PlatformNameFormat.getPlatformName(repName));
-        }
+    @Test
+    public void toPlatform() {
+        assertEquals(platformName, PlatformNameFormat.getPlatformName(repoName));
     }
 
-    public void testToRepo() {
-        for (String repName: names.keySet()) {
-            String pfName = names.get(repName);
-            assertEquals("Platform("+pfName+")->Repo", repName, PlatformNameFormat.getRepositoryName(pfName));
-        }
+    @Test
+    public void toRepo() {
+        assertEquals(repoName, PlatformNameFormat.getRepositoryName(platformName));
     }
 
 }
\ No newline at end of file


[jackrabbit-filevault] 03/03: JCRVLT-488 - PlatformNameFormat incorrectly sets repository names for nodes with double colons

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

rombert pushed a commit to branch issue/JCRVLT-488
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git

commit e360e5317d41c51d5968ecb2d3dbb78ddd0fb2a6
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Dec 17 23:50:49 2020 +0100

    JCRVLT-488 - PlatformNameFormat incorrectly sets repository names for nodes with double colons
    
    Add failing test.
---
 .../test/java/org/apache/jackrabbit/vault/util/PlatformNameTest.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PlatformNameTest.java b/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PlatformNameTest.java
index 94a9f60..65cb208 100644
--- a/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PlatformNameTest.java
+++ b/vault-core/src/test/java/org/apache/jackrabbit/vault/util/PlatformNameTest.java
@@ -45,7 +45,8 @@ public class PlatformNameTest {
              {"cq_:test.jpg", "cq_%3atest.jpg"},
              {"_", "_"},
              {":", "%3a"},
-             {":test", "%3atest"}
+             {":test", "%3atest"},
+             {":oak:mount-libs-nodetype", "%3aoak%3amount-libs-nodetype"}
        });
     }