diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java index 162f0bf641..0bc35b8d63 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java @@ -115,7 +115,7 @@ public class ConfigurationPropertiesReportEndpoint String beanName = entry.getKey(); Object bean = entry.getValue(); Map root = new HashMap(); - String prefix = extractPrefix(context, beanFactoryMetaData, beanName, bean); + String prefix = extractPrefix(context, beanFactoryMetaData, beanName); root.put("prefix", prefix); root.put("properties", sanitize(prefix, safeSerialize(mapper, bean, prefix))); result.put(beanName, root); @@ -204,12 +204,10 @@ public class ConfigurationPropertiesReportEndpoint * @param context the application context * @param beanFactoryMetaData the bean factory meta-data * @param beanName the bean name - * @param bean the bean * @return the prefix */ private String extractPrefix(ApplicationContext context, - ConfigurationBeanFactoryMetaData beanFactoryMetaData, String beanName, - Object bean) { + ConfigurationBeanFactoryMetaData beanFactoryMetaData, String beanName) { ConfigurationProperties annotation = context.findAnnotationOnBean(beanName, ConfigurationProperties.class); if (beanFactoryMetaData != null) { diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisMultiMetricRepository.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisMultiMetricRepository.java index c12e5ca042..712cf2e634 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisMultiMetricRepository.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisMultiMetricRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,7 +80,7 @@ public class RedisMultiMetricRepository implements MultiMetricRepository { List values = this.redisOperations.opsForValue().multiGet(keys); for (String v : values) { String key = keysIt.next(); - result.add(deserialize(group, key, v, zSetOperations.score(key))); + result.add(deserialize(key, v, zSetOperations.score(key))); } return result; @@ -143,7 +143,7 @@ public class RedisMultiMetricRepository implements MultiMetricRepository { this.zSetOperations.remove(groupKey); } - private Metric deserialize(String group, String redisKey, String v, Double value) { + private Metric deserialize(String redisKey, String v, Double value) { Date timestamp = new Date(Long.valueOf(v)); return new Metric(nameFor(redisKey), value, timestamp); } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestCommand.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestCommand.java index 9a4cdf2ab8..f5d8bf05e0 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestCommand.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestCommand.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,8 +51,7 @@ public class TestCommand extends OptionParsingCommand { SourceOptions sourceOptions = new SourceOptions(options); TestRunnerConfiguration configuration = new TestRunnerConfigurationAdapter( options, this); - this.runner = new TestRunner(configuration, sourceOptions.getSourcesArray(), - sourceOptions.getArgsArray()); + this.runner = new TestRunner(configuration, sourceOptions.getSourcesArray()); this.runner.compileAndRunTests(); return ExitStatus.OK.hangup(); } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestRunner.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestRunner.java index aeab1d3a3f..2fad09af67 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestRunner.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/test/TestRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,9 +46,8 @@ public class TestRunner { * Create a new {@link TestRunner} instance. * @param configuration the configuration * @param sources the sources - * @param args the args */ - TestRunner(TestRunnerConfiguration configuration, String[] sources, String[] args) { + TestRunner(TestRunnerConfiguration configuration, String[] sources) { this.sources = sources.clone(); this.compiler = new GroovyCompiler(configuration); } @@ -97,12 +96,11 @@ public class TestRunner { if (sources.length != 0 && sources[0] instanceof Class) { setContextClassLoader(((Class) sources[0]).getClassLoader()); } - this.spockSpecificationClass = loadSpockSpecificationClass( - getContextClassLoader()); + this.spockSpecificationClass = loadSpockSpecificationClass(); this.testClasses = getTestClasses(sources); } - private Class loadSpockSpecificationClass(ClassLoader contextClassLoader) { + private Class loadSpockSpecificationClass() { try { return getContextClassLoader().loadClass("spock.lang.Specification"); } diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java index 55346d771e..50d98d33ac 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java @@ -186,7 +186,7 @@ public class ExtendedGroovyClassLoader extends GroovyClassLoader { Set urls = new HashSet(); findGroovyJarsDirectly(parent, urls); if (urls.isEmpty()) { - findGroovyJarsFromClassPath(parent, urls); + findGroovyJarsFromClassPath(urls); } Assert.state(!urls.isEmpty(), "Unable to find groovy JAR"); return new ArrayList(urls).toArray(new URL[urls.size()]); @@ -205,7 +205,7 @@ public class ExtendedGroovyClassLoader extends GroovyClassLoader { } } - private void findGroovyJarsFromClassPath(ClassLoader parent, Set urls) { + private void findGroovyJarsFromClassPath(Set urls) { String classpath = System.getProperty("java.class.path"); String[] entries = classpath.split(System.getProperty("path.separator")); for (String entry : entries) { diff --git a/spring-boot/src/main/java/org/springframework/boot/SpringApplicationBannerPrinter.java b/spring-boot/src/main/java/org/springframework/boot/SpringApplicationBannerPrinter.java index 0800b2c8b7..9cabc1e667 100644 --- a/spring-boot/src/main/java/org/springframework/boot/SpringApplicationBannerPrinter.java +++ b/spring-boot/src/main/java/org/springframework/boot/SpringApplicationBannerPrinter.java @@ -56,7 +56,7 @@ class SpringApplicationBannerPrinter { } public Banner print(Environment environment, Class sourceClass, Log logger) { - Banner banner = getBanner(environment, this.fallbackBanner); + Banner banner = getBanner(environment); try { logger.info(createStringFromBanner(banner, environment, sourceClass)); } @@ -67,12 +67,12 @@ class SpringApplicationBannerPrinter { } public Banner print(Environment environment, Class sourceClass, PrintStream out) { - Banner banner = getBanner(environment, this.fallbackBanner); + Banner banner = getBanner(environment); banner.printBanner(environment, sourceClass, out); return new PrintedBanner(banner, sourceClass); } - private Banner getBanner(Environment environment, Banner definedBanner) { + private Banner getBanner(Environment environment) { Banners banners = new Banners(); banners.addIfNotNull(getImageBanner(environment)); banners.addIfNotNull(getTextBanner(environment)); diff --git a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatErrorPage.java b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatErrorPage.java index aec6a27877..f2fbb1a0e6 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatErrorPage.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatErrorPage.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,10 +50,10 @@ class TomcatErrorPage { this.location = errorPage.getPath(); this.exceptionType = errorPage.getExceptionName(); this.errorCode = errorPage.getStatusCode(); - this.nativePage = createNativePage(errorPage); + this.nativePage = createNativePage(); } - private Object createNativePage(ErrorPage errorPage) { + private Object createNativePage() { try { if (ClassUtils.isPresent(ERROR_PAGE_CLASS, null)) { return BeanUtils.instantiate(ClassUtils.forName(ERROR_PAGE_CLASS, null)); diff --git a/spring-boot/src/test/java/org/springframework/boot/bind/RelaxedConversionServiceTests.java b/spring-boot/src/test/java/org/springframework/boot/bind/RelaxedConversionServiceTests.java index 7d51d2e17a..2358248880 100644 --- a/spring-boot/src/test/java/org/springframework/boot/bind/RelaxedConversionServiceTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/bind/RelaxedConversionServiceTests.java @@ -41,7 +41,7 @@ public class RelaxedConversionServiceTests { Locale.setDefault(new Locale("tr")); TestEnum result = this.conversionService .convert("accept-case-insensitive-properties", TestEnum.class); - assertThat(result.equals(TestEnum.ACCEPT_CASE_INSENSITIVE_PROPERTIES)); + assertThat(result).isEqualTo(TestEnum.ACCEPT_CASE_INSENSITIVE_PROPERTIES); } finally { Locale.setDefault(defaultLocale);