diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/StringSequenceTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/StringSequenceTests.java index d61f59f1d89..fddd5ee72a2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/StringSequenceTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/StringSequenceTests.java @@ -127,9 +127,9 @@ class StringSequenceTests { @Test void indexOfStringShouldReturnIndexOf() { StringSequence sequence = new StringSequence("aabbaacc"); - assertThat(sequence.indexOf("a")).isEqualTo(0); - assertThat(sequence.indexOf("b")).isEqualTo(2); - assertThat(sequence.subSequence(2).indexOf("a")).isEqualTo(2); + assertThat(sequence.indexOf('a')).isEqualTo(0); + assertThat(sequence.indexOf('b')).isEqualTo(2); + assertThat(sequence.subSequence(2).indexOf('a')).isEqualTo(2); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/src/main/java/org/test/SampleApplication.java index 67f8135ee35..e2dd8264196 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/src/main/java/org/test/SampleApplication.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/src/main/java/org/test/SampleApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2019 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. @@ -28,7 +28,7 @@ public class SampleApplication { if (!argument.startsWith("--spring.profiles.active=")) { throw new IllegalArgumentException("Invalid argument " + argument); } - int index = args[0].indexOf("="); + int index = args[0].indexOf('='); String profile = argument.substring(index + 1); System.out.println("I haz been run with profile(s) '" + profile + "'"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/src/main/java/org/test/SampleApplication.java index 67f8135ee35..e2dd8264196 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/src/main/java/org/test/SampleApplication.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/src/main/java/org/test/SampleApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2019 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. @@ -28,7 +28,7 @@ public class SampleApplication { if (!argument.startsWith("--spring.profiles.active=")) { throw new IllegalArgumentException("Invalid argument " + argument); } - int index = args[0].indexOf("="); + int index = args[0].indexOf('='); String profile = argument.substring(index + 1); System.out.println("I haz been run with profile(s) '" + profile + "'"); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java index 5a450063940..2d7ad180d3e 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindFailureAnalyzerTests.java @@ -108,7 +108,7 @@ class BindFailureAnalyzerTests { MutablePropertySources sources = context.getEnvironment().getPropertySources(); Map map = new HashMap<>(); for (String pair : environment) { - int index = pair.indexOf("="); + int index = pair.indexOf('='); String key = (index > 0) ? pair.substring(0, index) : pair; String value = (index > 0) ? pair.substring(index + 1) : ""; map.put(key.trim(), value.trim()); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java index c7740cb0665..d5a5714ea86 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java @@ -119,7 +119,7 @@ class BindValidationFailureAnalyzerTests { MutablePropertySources sources = context.getEnvironment().getPropertySources(); Map map = new HashMap<>(); for (String pair : environment) { - int index = pair.indexOf("="); + int index = pair.indexOf('='); String key = (index > 0) ? pair.substring(0, index) : pair; String value = (index > 0) ? pair.substring(index + 1) : ""; map.put(key.trim(), value.trim()); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/UnboundConfigurationPropertyFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/UnboundConfigurationPropertyFailureAnalyzerTests.java index 95edaed6dfa..0ea6eeb5620 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/UnboundConfigurationPropertyFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/UnboundConfigurationPropertyFailureAnalyzerTests.java @@ -91,7 +91,7 @@ class UnboundConfigurationPropertyFailureAnalyzerTests { MutablePropertySources sources = context.getEnvironment().getPropertySources(); Map map = new HashMap<>(); for (String pair : environment) { - int index = pair.indexOf("="); + int index = pair.indexOf('='); String key = (index > 0) ? pair.substring(0, index) : pair; String value = (index > 0) ? pair.substring(index + 1) : ""; map.put(key.trim(), value.trim()); diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/service/CityServiceImpl.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/service/CityServiceImpl.java index 7eaf4142959..1a9bc45de22 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/service/CityServiceImpl.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/src/main/java/smoketest/data/jpa/service/CityServiceImpl.java @@ -50,7 +50,7 @@ class CityServiceImpl implements CityService { } String country = ""; - int splitPos = name.lastIndexOf(","); + int splitPos = name.lastIndexOf(','); if (splitPos >= 0) { country = name.substring(splitPos + 1);