From 8ec239644ff9ef04cb7fc01277b9f79d7fb0aa8d Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 11 Dec 2018 10:42:31 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-13402=20=E3=80=90=E9=98=BB=E5=A1=9E?= =?UTF-8?q?=E3=80=91=E3=80=9010.0.2=E5=9B=9E=E5=BD=92=E3=80=91=E5=85=AC?= =?UTF-8?q?=E5=BC=8F=E9=9D=A2=E6=9D=BF=E7=82=B9=E4=B8=8D=E5=BC=80=3D>?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/formula/FunctionConstants.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FunctionConstants.java b/designer-base/src/main/java/com/fr/design/formula/FunctionConstants.java index 9df15fd8f..0166c269b 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FunctionConstants.java +++ b/designer-base/src/main/java/com/fr/design/formula/FunctionConstants.java @@ -102,11 +102,18 @@ public final class FunctionConstants { } private static boolean isCustomFormulaPath(String classFilePath) { - // 除非是代码启动,否则不读取 WEB-INF/classes/com/fr/function 目录下的类 - return !classFilePath.contains("!/") && GeneralUtils.readBuildNO().contains("-"); + return !isJarPath(classFilePath) && isDebugMode(); } - /** + private static boolean isDebugMode() { + return !GeneralUtils.readBuildNO().contains("-"); + } + + private static boolean isJarPath(String classFilePath) { + return classFilePath.contains("!/"); + } + + /** * 将函数分组插件中的函数添加到对应的列表中 * @param listModel */ @@ -152,7 +159,7 @@ public final class FunctionConstants { * alex:如果是jar包中的class文件 * file:/D:/opt/FineReport6.5/WebReport/WEB-INF/lib/fr-server-6.5.jar!/com/fr/rpt/script/function */ - if (filePath.contains("!/")) { + if (isJarPath(filePath)) { String[] arr = filePath.split("!/"); String jarPath = arr[0].substring(6); // alex:substring(6)去掉前面的file:/这六个字符 String classPath = arr[1];