From 03fe304d7e9f845ebd3a1ae8debbc6027f636ac4 Mon Sep 17 00:00:00 2001 From: hieplq Date: Thu, 14 Nov 2019 19:40:38 +0700 Subject: [PATCH] IDEMPIERE-4105:add "comment" to 2pack file refine pack from Carlos --- .../src/org/adempiere/pipo/srv/PipoDictionaryService.java | 3 +++ .../org/adempiere/plugin/utils/Incremental2PackActivator.java | 2 ++ .../src/org/adempiere/plugin/utils/Version2PackActivator.java | 2 ++ 3 files changed, 7 insertions(+) diff --git a/org.adempiere.pipo/src/org/adempiere/pipo/srv/PipoDictionaryService.java b/org.adempiere.pipo/src/org/adempiere/pipo/srv/PipoDictionaryService.java index fd56861c4e..c44f5058c6 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo/srv/PipoDictionaryService.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo/srv/PipoDictionaryService.java @@ -71,6 +71,9 @@ public class PipoDictionaryService implements IDictionaryService { if (versionSeparatorPos > 0) { int dotPos = fileName.lastIndexOf("."); if (dotPos > 0 && dotPos > versionSeparatorPos) { + if (fileName.indexOf("_") != fileName.lastIndexOf("_")) + dotPos=fileName.lastIndexOf("_"); + String version = fileName.substring(versionSeparatorPos+"2Pack_".length(), dotPos); if (version.split("[.]").length == 3) { packageVersion = version; diff --git a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/Incremental2PackActivator.java b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/Incremental2PackActivator.java index 5bb74f5aad..558073d2b0 100644 --- a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/Incremental2PackActivator.java +++ b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/Incremental2PackActivator.java @@ -201,6 +201,8 @@ public class Incremental2PackActivator extends AbstractActivator { String p = u.getPath(); int upos=p.lastIndexOf("2Pack_"); int dpos=p.lastIndexOf("."); + if (p.indexOf("_") != p.lastIndexOf("_")) + dpos=p.lastIndexOf("_"); String v = p.substring(upos+"2Pack_".length(), dpos); return v; } diff --git a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/Version2PackActivator.java b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/Version2PackActivator.java index 028293e864..18271dadc3 100644 --- a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/Version2PackActivator.java +++ b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/Version2PackActivator.java @@ -170,6 +170,8 @@ public class Version2PackActivator extends AbstractActivator{ String p = u.getPath(); int upos=p.lastIndexOf("_"); int dpos=p.lastIndexOf("."); + if (p.indexOf("_") != p.lastIndexOf("_")) + dpos=p.lastIndexOf("_"); String v = p.substring(upos+1, dpos); return v; }