From e68b9e8322f361c611dee1c18e029d0c8735f1f3 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Tue, 2 Oct 2018 18:04:57 +0200 Subject: [PATCH] Remove unnecessary parameters for String.substring Closes gh-14661 --- .../org/springframework/boot/loader/PropertiesLauncher.java | 2 +- .../boot/context/properties/ConfigurationPropertiesTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java index 1d9c62933e..6cf92c691f 100755 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java @@ -521,7 +521,7 @@ public class PropertiesLauncher extends Launcher { file = new File(root.substring("jar:file:".length(), index)); } parent = new JarFileArchive(file); - root = root.substring(index + 1, root.length()); + root = root.substring(index + 1); while (root.startsWith("/")) { root = root.substring(1); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java index c9ad543023..dc6bf7afe1 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java @@ -1084,7 +1084,7 @@ public class ConfigurationPropertiesTests { @Override public Resource resolve(String location, ResourceLoader resourceLoader) { if (location.startsWith(PREFIX)) { - String path = location.substring(PREFIX.length(), location.length()); + String path = location.substring(PREFIX.length()); return new ClassPathResource(path); } return null;