Polishing

This commit is contained in:
Juergen Hoeller 2018-03-16 18:49:12 +01:00
parent 914b2470dc
commit 4fef1fe820
2 changed files with 7 additions and 5 deletions

View File

@ -285,7 +285,7 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
configCandidates.sort((bd1, bd2) -> { configCandidates.sort((bd1, bd2) -> {
int i1 = ConfigurationClassUtils.getOrder(bd1.getBeanDefinition()); int i1 = ConfigurationClassUtils.getOrder(bd1.getBeanDefinition());
int i2 = ConfigurationClassUtils.getOrder(bd2.getBeanDefinition()); int i2 = ConfigurationClassUtils.getOrder(bd2.getBeanDefinition());
return (i1 < i2) ? -1 : (i1 > i2) ? 1 : 0; return Integer.compare(i1, i2);
}); });
// Detect any custom bean name generation strategy supplied through the enclosing application context // Detect any custom bean name generation strategy supplied through the enclosing application context

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * @param statements the list that will contain the individual statements
* @throws ScriptException if an error occurred while splitting the SQL script * @throws ScriptException if an error occurred while splitting the SQL script
*/ */
public static void splitSqlScript(@Nullable EncodedResource resource, String script, String separator, String commentPrefix, public static void splitSqlScript(@Nullable EncodedResource resource, String script,
String blockCommentStartDelimiter, String blockCommentEndDelimiter, List<String> statements) String separator, String commentPrefix, String blockCommentStartDelimiter,
throws ScriptException { String blockCommentEndDelimiter, List<String> statements) throws ScriptException {
Assert.hasText(script, "'script' must not be null or empty"); Assert.hasText(script, "'script' must not be null or empty");
Assert.notNull(separator, "'separator' must not be null"); Assert.notNull(separator, "'separator' must not be null");
@ -179,6 +179,7 @@ public abstract class ScriptUtils {
boolean inSingleQuote = false; boolean inSingleQuote = false;
boolean inDoubleQuote = false; boolean inDoubleQuote = false;
boolean inEscape = false; boolean inEscape = false;
for (int i = 0; i < script.length(); i++) { for (int i = 0; i < script.length(); i++) {
char c = script.charAt(i); char c = script.charAt(i);
if (inEscape) { if (inEscape) {
@ -244,6 +245,7 @@ public abstract class ScriptUtils {
} }
sb.append(c); sb.append(c);
} }
if (StringUtils.hasText(sb)) { if (StringUtils.hasText(sb)) {
statements.add(sb.toString()); statements.add(sb.toString());
} }