Skip to content

Commit 90c16e5

Browse files
Fix whitespace handling in ScriptSplitter
Changed the logic from `isNotEmpty and doesNotEndInSpace` to `isEmpty or doesNotEndInSpace` to align with previous implementation behavior.
1 parent 9a15c77 commit 90c16e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/database-commons/src/main/java/org/testcontainers/ext/ScriptSplitter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void split() {
3636
//skip
3737
break;
3838
case WHITESPACE:
39-
if (sb.length() != 0 && sb.charAt(sb.length() - 1) != ' ') {
39+
if (sb.length() == 0 || sb.charAt(sb.length() - 1) != ' ') {
4040
sb.append(' ');
4141
}
4242
break;

0 commit comments

Comments
 (0)