Skip to content

Commit f96dea7

Browse files
committed
Polish
1 parent 35efb25 commit f96dea7

File tree

7 files changed

+16
-14
lines changed

7 files changed

+16
-14
lines changed

spring-boot/src/main/java/org/springframework/boot/Banner.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ enum Mode {
5757
* Print the banner to the log file.
5858
*/
5959
LOG
60+
6061
}
6162

6263
}

spring-boot/src/main/java/org/springframework/boot/BeanDefinitionLoader.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,8 @@ private int load(Package source) {
183183
}
184184

185185
private int load(CharSequence source) {
186-
187186
String resolvedSource = this.xmlReader.getEnvironment()
188187
.resolvePlaceholders(source.toString());
189-
190188
// Attempt as a Class
191189
try {
192190
return load(ClassUtils.forName(resolvedSource, null));
@@ -197,7 +195,6 @@ private int load(CharSequence source) {
197195
catch (ClassNotFoundException ex) {
198196
// swallow exception and continue
199197
}
200-
201198
// Attempt as resources
202199
Resource[] resources = findResources(resolvedSource);
203200
int loadCount = 0;
@@ -211,13 +208,11 @@ private int load(CharSequence source) {
211208
if (atLeastOneResourceExists) {
212209
return loadCount;
213210
}
214-
215211
// Attempt as package
216212
Package packageResource = findPackage(resolvedSource);
217213
if (packageResource != null) {
218214
return load(packageResource);
219215
}
220-
221216
throw new IllegalArgumentException("Invalid source '" + resolvedSource + "'");
222217
}
223218

spring-boot/src/main/java/org/springframework/boot/SpringApplication.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -383,17 +383,23 @@ private <T> Collection<? extends T> getSpringFactoriesInstances(Class<T> type) {
383383
return getSpringFactoriesInstances(type, new Class<?>[] {});
384384
}
385385

386-
@SuppressWarnings("unchecked")
387386
private <T> Collection<? extends T> getSpringFactoriesInstances(Class<T> type,
388387
Class<?>[] parameterTypes, Object... args) {
389388
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
390-
391389
// Use names and ensure unique to protect against duplicates
392390
Set<String> names = new LinkedHashSet<String>(
393391
SpringFactoriesLoader.loadFactoryNames(type, classLoader));
394-
List<T> instances = new ArrayList<T>(names.size());
392+
List<T> instances = createSpringFactoriesInstances(type, parameterTypes,
393+
classLoader, args, names);
394+
AnnotationAwareOrderComparator.sort(instances);
395+
return instances;
396+
}
395397

396-
// Create instances from the names
398+
@SuppressWarnings("unchecked")
399+
private <T> List<T> createSpringFactoriesInstances(Class<T> type,
400+
Class<?>[] parameterTypes, ClassLoader classLoader, Object[] args,
401+
Set<String> names) {
402+
List<T> instances = new ArrayList<T>(names.size());
397403
for (String name : names) {
398404
try {
399405
Class<?> instanceClass = ClassUtils.forName(name, classLoader);
@@ -407,8 +413,6 @@ private <T> Collection<? extends T> getSpringFactoriesInstances(Class<T> type,
407413
"Cannot instantiate " + type + " : " + name, ex);
408414
}
409415
}
410-
411-
AnnotationAwareOrderComparator.sort(instances);
412416
return instances;
413417
}
414418

@@ -420,7 +424,6 @@ private ConfigurableEnvironment getOrCreateEnvironment() {
420424
return new StandardServletEnvironment();
421425
}
422426
return new StandardEnvironment();
423-
424427
}
425428

426429
/**
@@ -608,7 +611,6 @@ protected void postProcessApplicationContext(ConfigurableApplicationContext cont
608611
}
609612
}
610613
}
611-
612614
if (this.resourceLoader != null) {
613615
if (context instanceof GenericApplicationContext) {
614616
((GenericApplicationContext) context)

spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public void shutdown() {
122122
logger.info("Application shutdown requested.");
123123
SpringApplicationAdminMXBeanRegistrar.this.applicationContext.close();
124124
}
125+
125126
}
126127

127128
}

spring-boot/src/main/java/org/springframework/boot/bind/RelaxedConversionService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ public T convert(String source) {
140140
throw new IllegalArgumentException("No enum constant "
141141
+ this.enumType.getCanonicalName() + "." + source);
142142
}
143+
143144
}
144145

145146
}
147+
146148
}

spring-boot/src/main/java/org/springframework/boot/bind/RelaxedDataBinder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ private static class MapIndexNode extends PathNode {
629629
public String toString() {
630630
return "[" + this.name + "]";
631631
}
632+
632633
}
633634

634635
private static class PropertyNode extends PathNode {
@@ -645,6 +646,7 @@ public MapIndexNode mapIndex() {
645646
public String toString() {
646647
return "." + this.name;
647648
}
649+
648650
}
649651

650652
}

spring-boot/src/main/java/org/springframework/boot/bind/YamlJavaBeanPropertyConstructor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public YamlJavaBeanPropertyConstructor(Class<?> theRoot,
6565
*/
6666
protected final void addPropertyAlias(String alias, Class<?> type, String name) {
6767
Map<String, Property> typeMap = this.properties.get(type);
68-
6968
if (typeMap == null) {
7069
typeMap = new HashMap<String, Property>();
7170
this.properties.put(type, typeMap);

0 commit comments

Comments
 (0)