Skip to content

Commit a9645a3

Browse files
committed
Polish
1 parent e3f0a70 commit a9645a3

File tree

8 files changed

+20
-25
lines changed

8 files changed

+20
-25
lines changed

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private Map<String, Object> extract(ApplicationContext context, ObjectMapper map
115115
String beanName = entry.getKey();
116116
Object bean = entry.getValue();
117117
Map<String, Object> root = new HashMap<String, Object>();
118-
String prefix = extractPrefix(context, beanFactoryMetaData, beanName, bean);
118+
String prefix = extractPrefix(context, beanFactoryMetaData, beanName);
119119
root.put("prefix", prefix);
120120
root.put("properties", sanitize(prefix, safeSerialize(mapper, bean, prefix)));
121121
result.put(beanName, root);
@@ -204,12 +204,10 @@ private void applyConfigurationPropertiesFilter(ObjectMapper mapper) {
204204
* @param context the application context
205205
* @param beanFactoryMetaData the bean factory meta-data
206206
* @param beanName the bean name
207-
* @param bean the bean
208207
* @return the prefix
209208
*/
210209
private String extractPrefix(ApplicationContext context,
211-
ConfigurationBeanFactoryMetaData beanFactoryMetaData, String beanName,
212-
Object bean) {
210+
ConfigurationBeanFactoryMetaData beanFactoryMetaData, String beanName) {
213211
ConfigurationProperties annotation = context.findAnnotationOnBean(beanName,
214212
ConfigurationProperties.class);
215213
if (beanFactoryMetaData != null) {

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisMultiMetricRepository.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2015 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -80,7 +80,7 @@ public Iterable<Metric<?>> findAll(String group) {
8080
List<String> values = this.redisOperations.opsForValue().multiGet(keys);
8181
for (String v : values) {
8282
String key = keysIt.next();
83-
result.add(deserialize(group, key, v, zSetOperations.score(key)));
83+
result.add(deserialize(key, v, zSetOperations.score(key)));
8484
}
8585
return result;
8686

@@ -143,7 +143,7 @@ public void reset(String group) {
143143
this.zSetOperations.remove(groupKey);
144144
}
145145

146-
private Metric<?> deserialize(String group, String redisKey, String v, Double value) {
146+
private Metric<?> deserialize(String redisKey, String v, Double value) {
147147
Date timestamp = new Date(Long.valueOf(v));
148148
return new Metric<Double>(nameFor(redisKey), value, timestamp);
149149
}

spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestCommand.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2016 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -51,8 +51,7 @@ protected ExitStatus run(OptionSet options) throws Exception {
5151
SourceOptions sourceOptions = new SourceOptions(options);
5252
TestRunnerConfiguration configuration = new TestRunnerConfigurationAdapter(
5353
options, this);
54-
this.runner = new TestRunner(configuration, sourceOptions.getSourcesArray(),
55-
sourceOptions.getArgsArray());
54+
this.runner = new TestRunner(configuration, sourceOptions.getSourcesArray());
5655
this.runner.compileAndRunTests();
5756
return ExitStatus.OK.hangup();
5857
}

spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestRunner.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2016 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -46,9 +46,8 @@ public class TestRunner {
4646
* Create a new {@link TestRunner} instance.
4747
* @param configuration the configuration
4848
* @param sources the sources
49-
* @param args the args
5049
*/
51-
TestRunner(TestRunnerConfiguration configuration, String[] sources, String[] args) {
50+
TestRunner(TestRunnerConfiguration configuration, String[] sources) {
5251
this.sources = sources.clone();
5352
this.compiler = new GroovyCompiler(configuration);
5453
}
@@ -97,12 +96,11 @@ private class RunThread extends Thread {
9796
if (sources.length != 0 && sources[0] instanceof Class) {
9897
setContextClassLoader(((Class<?>) sources[0]).getClassLoader());
9998
}
100-
this.spockSpecificationClass = loadSpockSpecificationClass(
101-
getContextClassLoader());
99+
this.spockSpecificationClass = loadSpockSpecificationClass();
102100
this.testClasses = getTestClasses(sources);
103101
}
104102

105-
private Class<?> loadSpockSpecificationClass(ClassLoader contextClassLoader) {
103+
private Class<?> loadSpockSpecificationClass() {
106104
try {
107105
return getContextClassLoader().loadClass("spock.lang.Specification");
108106
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private URL[] getGroovyJars(final ClassLoader parent) {
186186
Set<URL> urls = new HashSet<URL>();
187187
findGroovyJarsDirectly(parent, urls);
188188
if (urls.isEmpty()) {
189-
findGroovyJarsFromClassPath(parent, urls);
189+
findGroovyJarsFromClassPath(urls);
190190
}
191191
Assert.state(!urls.isEmpty(), "Unable to find groovy JAR");
192192
return new ArrayList<URL>(urls).toArray(new URL[urls.size()]);
@@ -205,7 +205,7 @@ private void findGroovyJarsDirectly(ClassLoader classLoader, Set<URL> urls) {
205205
}
206206
}
207207

208-
private void findGroovyJarsFromClassPath(ClassLoader parent, Set<URL> urls) {
208+
private void findGroovyJarsFromClassPath(Set<URL> urls) {
209209
String classpath = System.getProperty("java.class.path");
210210
String[] entries = classpath.split(System.getProperty("path.separator"));
211211
for (String entry : entries) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class SpringApplicationBannerPrinter {
5656
}
5757

5858
public Banner print(Environment environment, Class<?> sourceClass, Log logger) {
59-
Banner banner = getBanner(environment, this.fallbackBanner);
59+
Banner banner = getBanner(environment);
6060
try {
6161
logger.info(createStringFromBanner(banner, environment, sourceClass));
6262
}
@@ -67,12 +67,12 @@ public Banner print(Environment environment, Class<?> sourceClass, Log logger) {
6767
}
6868

6969
public Banner print(Environment environment, Class<?> sourceClass, PrintStream out) {
70-
Banner banner = getBanner(environment, this.fallbackBanner);
70+
Banner banner = getBanner(environment);
7171
banner.printBanner(environment, sourceClass, out);
7272
return new PrintedBanner(banner, sourceClass);
7373
}
7474

75-
private Banner getBanner(Environment environment, Banner definedBanner) {
75+
private Banner getBanner(Environment environment) {
7676
Banners banners = new Banners();
7777
banners.addIfNotNull(getImageBanner(environment));
7878
banners.addIfNotNull(getTextBanner(environment));

spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatErrorPage.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2016 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -50,10 +50,10 @@ class TomcatErrorPage {
5050
this.location = errorPage.getPath();
5151
this.exceptionType = errorPage.getExceptionName();
5252
this.errorCode = errorPage.getStatusCode();
53-
this.nativePage = createNativePage(errorPage);
53+
this.nativePage = createNativePage();
5454
}
5555

56-
private Object createNativePage(ErrorPage errorPage) {
56+
private Object createNativePage() {
5757
try {
5858
if (ClassUtils.isPresent(ERROR_PAGE_CLASS, null)) {
5959
return BeanUtils.instantiate(ClassUtils.forName(ERROR_PAGE_CLASS, null));

spring-boot/src/test/java/org/springframework/boot/bind/RelaxedConversionServiceTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void conversionServiceShouldAlwaysUseLocaleEnglish() {
4141
Locale.setDefault(new Locale("tr"));
4242
TestEnum result = this.conversionService
4343
.convert("accept-case-insensitive-properties", TestEnum.class);
44-
assertThat(result.equals(TestEnum.ACCEPT_CASE_INSENSITIVE_PROPERTIES));
44+
assertThat(result).isEqualTo(TestEnum.ACCEPT_CASE_INSENSITIVE_PROPERTIES);
4545
}
4646
finally {
4747
Locale.setDefault(defaultLocale);

0 commit comments

Comments
 (0)