Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -165,9 +165,9 @@ public abstract class ScriptUtils {
|
||||
* @param statements the list that will contain the individual statements
|
||||
* @throws ScriptException if an error occurred while splitting the SQL script
|
||||
*/
|
||||
public static void splitSqlScript(@Nullable EncodedResource resource, String script, String separator, String commentPrefix,
|
||||
String blockCommentStartDelimiter, String blockCommentEndDelimiter, List<String> statements)
|
||||
throws ScriptException {
|
||||
public static void splitSqlScript(@Nullable EncodedResource resource, String script,
|
||||
String separator, String commentPrefix, String blockCommentStartDelimiter,
|
||||
String blockCommentEndDelimiter, List<String> statements) throws ScriptException {
|
||||
|
||||
Assert.hasText(script, "'script' must not be null or empty");
|
||||
Assert.notNull(separator, "'separator' must not be null");
|
||||
@@ -179,6 +179,7 @@ public abstract class ScriptUtils {
|
||||
boolean inSingleQuote = false;
|
||||
boolean inDoubleQuote = false;
|
||||
boolean inEscape = false;
|
||||
|
||||
for (int i = 0; i < script.length(); i++) {
|
||||
char c = script.charAt(i);
|
||||
if (inEscape) {
|
||||
@@ -244,6 +245,7 @@ public abstract class ScriptUtils {
|
||||
}
|
||||
sb.append(c);
|
||||
}
|
||||
|
||||
if (StringUtils.hasText(sb)) {
|
||||
statements.add(sb.toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user