From 2baa50f7959d56592727ecfc3038c835d4ce3a6e Mon Sep 17 00:00:00 2001 From: Nicolas Barithel Date: Mon, 12 Oct 2020 19:04:38 +0200 Subject: [PATCH 1/2] Fix MNT-21968 catch NumberFormatException on parseInt --- .../java/org/alfresco/repo/virtual/ref/ZeroReferenceParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/alfresco/repo/virtual/ref/ZeroReferenceParser.java b/src/main/java/org/alfresco/repo/virtual/ref/ZeroReferenceParser.java index 732f787568..bec1cb9662 100644 --- a/src/main/java/org/alfresco/repo/virtual/ref/ZeroReferenceParser.java +++ b/src/main/java/org/alfresco/repo/virtual/ref/ZeroReferenceParser.java @@ -113,7 +113,7 @@ else if ((protocolResourceEncoding - NODE_PROTOCOL_CODE) < VIRTUAL_PROTOCOL_CODE parameters); return reference; } - catch (ArrayIndexOutOfBoundsException e) + catch (ArrayIndexOutOfBoundsException | NumberFormatException e) { throw new ReferenceParseException("Invalid reference", e); From 765209f6e4279524f80d02e090a74f89d6b8b762 Mon Sep 17 00:00:00 2001 From: Nicolas Barithel Date: Mon, 12 Oct 2020 19:29:36 +0200 Subject: [PATCH 2/2] Fix MNT-21968 test case "v00Draft.pdf" --- .../org/alfresco/repo/virtual/store/VirtualStoreImplTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/java/org/alfresco/repo/virtual/store/VirtualStoreImplTest.java b/src/test/java/org/alfresco/repo/virtual/store/VirtualStoreImplTest.java index 7d0550f18d..fec857dfe3 100644 --- a/src/test/java/org/alfresco/repo/virtual/store/VirtualStoreImplTest.java +++ b/src/test/java/org/alfresco/repo/virtual/store/VirtualStoreImplTest.java @@ -265,6 +265,9 @@ public void testCanExistNodeIDwithV() // vp... createAndCheckNodeId("v"+Encodings.PLAIN.encoding.token+"file", "specialFile5.txt"); + // MNT-21968 + createAndCheckNodeId("v"+Encodings.ZERO.encoding.token+"0Draft.pdf", "specialFile6.txt"); + NodeRef virtualFolder = createVirtualizedFolder(testRootFolder.getNodeRef(), VIRTUAL_FOLDER_3_NAME, TEST_TEMPLATE_4_JSON_SYS_PATH); assertTrue(smartStore.canVirtualize(virtualFolder));