Skip to content

Commit 19d3007

Browse files
committed
Polish
1 parent f87b247 commit 19d3007

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/r2dbc/EmbeddedDatabaseConnection.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,10 @@ public static EmbeddedDatabaseConnection get(ClassLoader classLoader) {
9999
*/
100100
public static boolean isEmbedded(ConnectionFactory connectionFactory) {
101101
OptionsCapableConnectionFactory optionsCapable = OptionsCapableConnectionFactory.unwrapFrom(connectionFactory);
102-
if (optionsCapable == null) {
103-
throw new IllegalArgumentException(
104-
"Cannot determine database's type as ConnectionFactory is not options-capable. To be "
105-
+ "options-capable, a ConnectionFactory should be created with "
106-
+ ConnectionFactoryBuilder.class.getName());
107-
}
102+
Assert.notNull(optionsCapable,
103+
() -> "Cannot determine database's type as ConnectionFactory is not options-capable. To be "
104+
+ "options-capable, a ConnectionFactory should be created with "
105+
+ ConnectionFactoryBuilder.class.getName());
108106
ConnectionFactoryOptions options = optionsCapable.getOptions();
109107
for (EmbeddedDatabaseConnection candidate : values()) {
110108
if (candidate.embedded.test(options)) {

0 commit comments

Comments
 (0)