Skip to content

Commit

Permalink
script line handling log update
Browse files Browse the repository at this point in the history
  • Loading branch information
llsand committed Oct 24, 2019
1 parent 8a98363 commit ea87ae9
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public void handleCommand(String pLine, File pCurrentFile) throws Exception {

Supplier<String>
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;
Expand Down Expand Up @@ -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();
Expand All @@ -472,7 +475,11 @@ protected SpoolHandler createSpoolHandler(Parameters pParameters) {
return new SpoolHandler(pParameters);
}

private void executeSql(String pSql, CallableStatementProvider pCallableStatementProvider, Parameters pParameters, Supplier<String> pLineReferenceProvider) {
private void executeSql(
String pSql,
CallableStatementProvider pCallableStatementProvider,
Parameters pParameters,
Supplier<String> pLineReferenceProvider) {
try {
new WrapperExecuteUpdate(pSql, pCallableStatementProvider).execute();
} catch (RuntimeException e) {
Expand Down

0 comments on commit ea87ae9

Please sign in to comment.