From ea87ae91bc33166bb148512f1c5e2749f02fdc1c Mon Sep 17 00:00:00 2001 From: Frank Sanders Date: Thu, 24 Oct 2019 12:57:50 +0200 Subject: [PATCH] script line handling log update --- .../orcas/diff/OrcasScriptRunner.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/orcas_core/build_source/orcas_diff/src/main/java/de/opitzconsulting/orcas/diff/OrcasScriptRunner.java b/orcas_core/build_source/orcas_diff/src/main/java/de/opitzconsulting/orcas/diff/OrcasScriptRunner.java index 13d8c24b..78532180 100644 --- a/orcas_core/build_source/orcas_diff/src/main/java/de/opitzconsulting/orcas/diff/OrcasScriptRunner.java +++ b/orcas_core/build_source/orcas_diff/src/main/java/de/opitzconsulting/orcas/diff/OrcasScriptRunner.java @@ -343,7 +343,7 @@ public void handleCommand(String pLine, File pCurrentFile) throws Exception { Supplier lLineReferenceProvider = - () -> pFile + "(" + lStartLineIndex[0] + (lStartLineIndex[0] != lCurrentLineIndex[0] ? "-" + lCurrentLineIndex[0] : "") + ")"; + () -> pFile + "(" + (lStartLineIndex[0] + 1) + (lStartLineIndex[0] != lCurrentLineIndex[0] ? "-" + (lCurrentLineIndex[0] + 1) : "") + ")"; for (String lLine : pLines) { boolean lCurrentEnd = false; @@ -454,8 +454,11 @@ protected void useCallableStatement(CallableStatement pCallableStatement) throws lCurrentLineIndex[0]++; } - if (lCurrent != null && !lCurrent.toString().trim().equals("")) { - _log.error(lLineReferenceProvider.get() + ": statemmet not terminated correctly: " + lCurrent.toString()); + if (lCurrent != null) { + String lTrim = lCurrent.toString().replace("\n", "").trim(); + if (!lTrim.equals("") && !lTrim.equals("/")) { + _log.error(lLineReferenceProvider.get() + ": statemmet not terminated correctly: " + lCurrent.toString()); + } } lSpoolHandler.spoolHandleFileEnd(); @@ -472,7 +475,11 @@ protected SpoolHandler createSpoolHandler(Parameters pParameters) { return new SpoolHandler(pParameters); } - private void executeSql(String pSql, CallableStatementProvider pCallableStatementProvider, Parameters pParameters, Supplier pLineReferenceProvider) { + private void executeSql( + String pSql, + CallableStatementProvider pCallableStatementProvider, + Parameters pParameters, + Supplier pLineReferenceProvider) { try { new WrapperExecuteUpdate(pSql, pCallableStatementProvider).execute(); } catch (RuntimeException e) {