Skip to content

Commit 3c6bf14

Browse files
committed
Polish
1 parent f3d4fdb commit 3c6bf14

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Diff for: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceBuilder.java

+14-14
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ private void set(DataSourceProperty property, String value) {
168168
*/
169169
public T build() {
170170
DataSourceProperties<T> properties = DataSourceProperties.forType(this.classLoader, this.type);
171-
DataSourceProperties<T> derriveFromProperties = (this.deriveFrom != null)
171+
DataSourceProperties<T> deriveFromProperties = (this.deriveFrom != null)
172172
? DataSourceProperties.forType(this.classLoader, this.type) : null;
173173
Class<? extends T> instanceType = (this.type != null) ? this.type : properties.getDataSourceInstanceType();
174174
T dataSource = BeanUtils.instantiateClass(instanceType);
@@ -179,8 +179,8 @@ public T build() {
179179
properties.set(dataSource, property, value);
180180
applied.add(property);
181181
}
182-
else if (derriveFromProperties != null && properties.canSet(property)) {
183-
String value = derriveFromProperties.get(this.deriveFrom, property);
182+
else if (deriveFromProperties != null && properties.canSet(property)) {
183+
String value = deriveFromProperties.get(this.deriveFrom, property);
184184
if (value != null) {
185185
properties.set(dataSource, property, value);
186186
applied.add(property);
@@ -230,7 +230,7 @@ public static DataSourceBuilder<?> derivedFrom(DataSource dataSource) {
230230
dataSource = dataSource.unwrap(DataSource.class);
231231
}
232232
catch (SQLException ex) {
233-
throw new IllegalStateException("Unable to unwap embedded database", ex);
233+
throw new IllegalStateException("Unable to unwrap embedded database", ex);
234234
}
235235
}
236236
return new DataSourceBuilder<>(dataSource);
@@ -475,7 +475,7 @@ private static class ReflectionDataSourceProperties<T extends DataSource> implem
475475

476476
private final Map<DataSourceProperty, Method> setters;
477477

478-
private Class<T> dataSourceType;
478+
private final Class<T> dataSourceType;
479479

480480
ReflectionDataSourceProperties(Class<T> dataSourceType) {
481481
Assert.state(dataSourceType != null, "No supported DataSource type found");
@@ -521,7 +521,7 @@ public String get(T dataSource, DataSourceProperty property) {
521521
private Method getMethod(DataSourceProperty property, Map<DataSourceProperty, Method> setters2) {
522522
Method method = setters2.get(property);
523523
UnsupportedDataSourcePropertyException.throwIf(method == null,
524-
() -> "Unable to find sutable method for " + property);
524+
() -> "Unable to find suitable method for " + property);
525525
ReflectionUtils.makeAccessible(method);
526526
return method;
527527
}
@@ -543,7 +543,7 @@ private interface Setter<T, V> {
543543
}
544544

545545
/**
546-
* {@link MappedDataSource} for Hikari.
546+
* {@link DataSourceProperties} for Hikari.
547547
*/
548548
private static class HikariDataSourceProperties extends MappedDataSourceProperties<HikariDataSource> {
549549

@@ -558,7 +558,7 @@ private static class HikariDataSourceProperties extends MappedDataSourceProperti
558558
}
559559

560560
/**
561-
* {@link MappedDataSource} for Tomcat Pool.
561+
* {@link DataSourceProperties} for Tomcat Pool.
562562
*/
563563
private static class TomcatPoolDataSourceProperties
564564
extends MappedDataSourceProperties<org.apache.tomcat.jdbc.pool.DataSource> {
@@ -577,7 +577,7 @@ private static class TomcatPoolDataSourceProperties
577577
}
578578

579579
/**
580-
* {@link MappedDataSource} for DBCP2.
580+
* {@link DataSourceProperties} for DBCP2.
581581
*/
582582
private static class MappedDbcp2DataSource extends MappedDataSourceProperties<BasicDataSource> {
583583

@@ -592,7 +592,7 @@ private static class MappedDbcp2DataSource extends MappedDataSourceProperties<Ba
592592
}
593593

594594
/**
595-
* {@link MappedDataSource} for Oracle Pool.
595+
* {@link DataSourceProperties} for Oracle Pool.
596596
*/
597597
private static class OraclePoolDataSourceProperties extends MappedDataSourceProperties<PoolDataSource> {
598598

@@ -612,7 +612,7 @@ public Class<? extends PoolDataSource> getDataSourceInstanceType() {
612612
}
613613

614614
/**
615-
* {@link MappedDataSource} for Spring's {@link SimpleDriverDataSource}.
615+
* {@link DataSourceProperties} for Spring's {@link SimpleDriverDataSource}.
616616
*/
617617
private static class SimpleDataSourceProperties extends MappedDataSourceProperties<SimpleDriverDataSource> {
618618

@@ -628,7 +628,7 @@ private static class SimpleDataSourceProperties extends MappedDataSourceProperti
628628
}
629629

630630
/**
631-
* {@link MappedDataSource} for Oracle.
631+
* {@link DataSourceProperties} for Oracle.
632632
*/
633633
private static class OracleDataSourceProperties extends MappedDataSourceProperties<OracleDataSource> {
634634

@@ -641,7 +641,7 @@ private static class OracleDataSourceProperties extends MappedDataSourceProperti
641641
}
642642

643643
/**
644-
* {@link MappedDataSource} for H2.
644+
* {@link DataSourceProperties} for H2.
645645
*/
646646
private static class H2DataSourceProperties extends MappedDataSourceProperties<JdbcDataSource> {
647647

@@ -654,7 +654,7 @@ private static class H2DataSourceProperties extends MappedDataSourceProperties<J
654654
}
655655

656656
/**
657-
* {@link MappedDataSource} for Postgres.
657+
* {@link DataSourceProperties} for Postgres.
658658
*/
659659
private static class PostgresDataSourceProperties extends MappedDataSourceProperties<PGSimpleDataSource> {
660660

0 commit comments

Comments
 (0)