Merge pull request #23720 from izeye

* pr/23720:
  Polish

Closes gh-23720
pull/23737/head
Stephane Nicoll 4 years ago
commit 995c0c827b

@ -33,8 +33,7 @@ class ConfigDataNotFoundFailureAnalyzer extends AbstractFailureAnalyzer<ConfigDa
protected FailureAnalysis analyze(Throwable rootFailure, ConfigDataNotFoundException cause) { protected FailureAnalysis analyze(Throwable rootFailure, ConfigDataNotFoundException cause) {
ConfigDataLocation location = getLocation(cause); ConfigDataLocation location = getLocation(cause);
Origin origin = Origin.from(location); Origin origin = Origin.from(location);
StringBuilder message = new StringBuilder( String message = String.format("Config data %s does not exist", cause.getReferenceDescription());
String.format("Config data %s does not exist", cause.getReferenceDescription()));
StringBuilder action = new StringBuilder("Check that the value "); StringBuilder action = new StringBuilder("Check that the value ");
if (location != null) { if (location != null) {
action.append(String.format("'%s' ", location)); action.append(String.format("'%s' ", location));
@ -46,7 +45,7 @@ class ConfigDataNotFoundFailureAnalyzer extends AbstractFailureAnalyzer<ConfigDa
if (location != null && !location.isOptional()) { if (location != null && !location.isOptional()) {
action.append(String.format(", or prefix it with '%s'", ConfigDataLocation.OPTIONAL_PREFIX)); action.append(String.format(", or prefix it with '%s'", ConfigDataLocation.OPTIONAL_PREFIX));
} }
return new FailureAnalysis(message.toString(), action.toString(), cause); return new FailureAnalysis(message, action.toString(), cause);
} }
private ConfigDataLocation getLocation(ConfigDataNotFoundException cause) { private ConfigDataLocation getLocation(ConfigDataNotFoundException cause) {

@ -71,6 +71,7 @@ public enum EmbeddedDatabaseConnection {
/** /**
* HSQL Database Connection. * HSQL Database Connection.
* @since 2.4.0
*/ */
HSQLDB(EmbeddedDatabaseType.HSQL, DatabaseDriver.HSQLDB.getDriverClassName(), "org.hsqldb.jdbcDriver", HSQLDB(EmbeddedDatabaseType.HSQL, DatabaseDriver.HSQLDB.getDriverClassName(), "org.hsqldb.jdbcDriver",
"jdbc:hsqldb:mem:%s", (url) -> url.contains(":hsqldb:mem:")); "jdbc:hsqldb:mem:%s", (url) -> url.contains(":hsqldb:mem:"));

@ -287,7 +287,7 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac
} }
/** /**
* Return where the request path should be preserved on forward. * Return whether the request path should be preserved on forward.
* @return {@code true} if the path should be preserved when a request is forwarded, * @return {@code true} if the path should be preserved when a request is forwarded,
* otherwise {@code false}. * otherwise {@code false}.
* @since 2.4.0 * @since 2.4.0

@ -24,7 +24,7 @@ import org.springframework.boot.origin.Origin;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link ConfigDataNotFoundFailureAnalyzer} * Tests for {@link ConfigDataNotFoundFailureAnalyzer}.
* *
* @author Michal Mlak * @author Michal Mlak
* @author Phillip Webb * @author Phillip Webb

Loading…
Cancel
Save