Skip to content

Commit 49039c3

Browse files
committed
Polish
1 parent d87f271 commit 49039c3

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheConfigFileCondition.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,29 @@
2828
*
2929
* @author Stephane Nicoll
3030
* @author Phillip Webb
31-
* @since 1.3.0
3231
*/
3332
abstract class CacheConfigFileCondition extends SpringBootCondition {
3433

3534
private final String name;
3635

37-
private final String configPrefix;
36+
private final String prefix;
3837

3938
private final String[] resourceLocations;
4039

41-
public CacheConfigFileCondition(String name, String configPrefix,
40+
public CacheConfigFileCondition(String name, String prefix,
4241
String... resourceLocations) {
4342
this.name = name;
44-
this.configPrefix = (configPrefix.endsWith(".") ? configPrefix : configPrefix + ".");
43+
this.prefix = (prefix.endsWith(".") ? prefix : prefix + ".");
4544
this.resourceLocations = resourceLocations;
4645
}
4746

4847
@Override
4948
public ConditionOutcome getMatchOutcome(ConditionContext context,
5049
AnnotatedTypeMetadata metadata) {
5150
RelaxedPropertyResolver resolver = new RelaxedPropertyResolver(
52-
context.getEnvironment(), this.configPrefix);
51+
context.getEnvironment(), this.prefix);
5352
if (resolver.containsProperty("config")) {
54-
return ConditionOutcome.match("A '" + this.configPrefix + ".config' "
53+
return ConditionOutcome.match("A '" + this.prefix + ".config' "
5554
+ "property is specified");
5655
}
5756
return getResourceOutcome(context, metadata);

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheConfigFileConditionTests.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import org.junit.After;
2020
import org.junit.Test;
21-
2221
import org.springframework.boot.test.EnvironmentTestUtils;
2322
import org.springframework.context.ConfigurableApplicationContext;
2423
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@@ -63,16 +62,14 @@ public void noDefaultFileAndExplicitKeyToResource() {
6362
assertTrue(this.context.containsBean("foo"));
6463
}
6564

66-
private void load(Class<?> config,
67-
String... environment) {
65+
private void load(Class<?> config, String... environment) {
6866
AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
6967
EnvironmentTestUtils.addEnvironment(applicationContext, environment);
7068
applicationContext.register(config);
7169
applicationContext.refresh();
7270
this.context = applicationContext;
7371
}
7472

75-
7673
@Configuration
7774
@Conditional(CacheConfigFileDefaultFileCondition.class)
7875
static class DefaultFileConfiguration {
@@ -93,16 +90,19 @@ public String foo() {
9390
}
9491
}
9592

96-
private static class CacheConfigFileDefaultFileCondition extends CacheConfigFileCondition {
93+
private static class CacheConfigFileDefaultFileCondition extends
94+
CacheConfigFileCondition {
9795

9896
public CacheConfigFileDefaultFileCondition() {
9997
super("test", "spring.cache.test.", "classpath:/ehcache.xml");
10098
}
10199
}
102100

103-
private static class CacheConfigFileNoDefaultFileCondition extends CacheConfigFileCondition {
101+
private static class CacheConfigFileNoDefaultFileCondition extends
102+
CacheConfigFileCondition {
104103
public CacheConfigFileNoDefaultFileCondition() {
105-
super("test", "spring.cache.test", "classpath:/this-cache-file-does-not-exist.xml");
104+
super("test", "spring.cache.test",
105+
"classpath:/this-cache-file-does-not-exist.xml");
106106
}
107107

108108
}

spring-boot-cli/samples/retry.groovy

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ class Example implements CommandLineRunner {
88
private MyService myService
99

1010
void run(String... args) {
11-
println "Hello ${this.myService.sayWorld()} From ${getClass().getClassLoader().getResource('samples/retry.groovy')}"
11+
println "Hello ${this.myService.sayWorld()} From ${getClass().getClassLoader().getResource('samples/retry.groovy')}"
1212
}
1313
}
1414

1515

1616
@Service
1717
class MyService {
18-
18+
1919
static int count = 0
2020

2121
@Retryable
@@ -26,5 +26,3 @@ class MyService {
2626
return "World!"
2727
}
2828
}
29-
30-

spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/SpringRetryCompilerAutoConfiguration.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2013 the original author or authors.
2+
* Copyright 2012-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@
2626
* {@link CompilerAutoConfiguration} for Spring Retry.
2727
*
2828
* @author Dave Syer
29+
* @since 1.3.0
2930
*/
3031
public class SpringRetryCompilerAutoConfiguration extends CompilerAutoConfiguration {
3132

0 commit comments

Comments
 (0)