Skip to content

Commit 1392b0f

Browse files
committed
Merge branch '5.3.x'
2 parents 4db2f8e + 9fbf5dc commit 1392b0f

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ boolean hasAnyExternallyManagedInitMethod(String initMethod) {
508508
}
509509
if (this.externallyManagedInitMethods != null) {
510510
for (String candidate : this.externallyManagedInitMethods) {
511-
int indexOfDot = candidate.lastIndexOf(".");
511+
int indexOfDot = candidate.lastIndexOf('.');
512512
if (indexOfDot >= 0) {
513513
String methodName = candidate.substring(indexOfDot + 1);
514514
if (methodName.equals(initMethod)) {
@@ -585,7 +585,7 @@ boolean hasAnyExternallyManagedDestroyMethod(String destroyMethod) {
585585
}
586586
if (this.externallyManagedDestroyMethods != null) {
587587
for (String candidate : this.externallyManagedDestroyMethods) {
588-
int indexOfDot = candidate.lastIndexOf(".");
588+
int indexOfDot = candidate.lastIndexOf('.');
589589
if (indexOfDot >= 0) {
590590
String methodName = candidate.substring(indexOfDot + 1);
591591
if (methodName.equals(destroyMethod)) {

spring-core/src/main/java/org/springframework/util/StringUtils.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 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.
@@ -65,6 +65,8 @@ public abstract class StringUtils {
6565

6666
private static final String FOLDER_SEPARATOR = "/";
6767

68+
private static final char FOLDER_SEPARATOR_CHAR = '/';
69+
6870
private static final String WINDOWS_FOLDER_SEPARATOR = "\\";
6971

7072
private static final String TOP_PATH = "..";
@@ -568,7 +570,7 @@ public static String getFilename(@Nullable String path) {
568570
return null;
569571
}
570572

571-
int separatorIndex = path.lastIndexOf(FOLDER_SEPARATOR);
573+
int separatorIndex = path.lastIndexOf(FOLDER_SEPARATOR_CHAR);
572574
return (separatorIndex != -1 ? path.substring(separatorIndex + 1) : path);
573575
}
574576

@@ -589,7 +591,7 @@ public static String getFilenameExtension(@Nullable String path) {
589591
return null;
590592
}
591593

592-
int folderIndex = path.lastIndexOf(FOLDER_SEPARATOR);
594+
int folderIndex = path.lastIndexOf(FOLDER_SEPARATOR_CHAR);
593595
if (folderIndex > extIndex) {
594596
return null;
595597
}
@@ -609,7 +611,7 @@ public static String stripFilenameExtension(String path) {
609611
return path;
610612
}
611613

612-
int folderIndex = path.lastIndexOf(FOLDER_SEPARATOR);
614+
int folderIndex = path.lastIndexOf(FOLDER_SEPARATOR_CHAR);
613615
if (folderIndex > extIndex) {
614616
return path;
615617
}
@@ -626,11 +628,11 @@ public static String stripFilenameExtension(String path) {
626628
* @return the full file path that results from applying the relative path
627629
*/
628630
public static String applyRelativePath(String path, String relativePath) {
629-
int separatorIndex = path.lastIndexOf(FOLDER_SEPARATOR);
631+
int separatorIndex = path.lastIndexOf(FOLDER_SEPARATOR_CHAR);
630632
if (separatorIndex != -1) {
631633
String newPath = path.substring(0, separatorIndex);
632634
if (!relativePath.startsWith(FOLDER_SEPARATOR)) {
633-
newPath += FOLDER_SEPARATOR;
635+
newPath += FOLDER_SEPARATOR_CHAR;
634636
}
635637
return newPath + relativePath;
636638
}

spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/AbstractHtmlElementTagTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2022 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.
@@ -135,7 +135,7 @@ protected final void assertAttributeNotPresent(String output, String attributeNa
135135
}
136136

137137
protected final void assertBlockTagContains(String output, String desiredContents) {
138-
String contents = output.substring(output.indexOf(">") + 1, output.lastIndexOf("<"));
138+
String contents = output.substring(output.indexOf(">") + 1, output.lastIndexOf('<'));
139139
assertThat(contents.contains(desiredContents)).as("Expected to find '" + desiredContents + "' in the contents of block tag '" + output + "'").isTrue();
140140
}
141141

0 commit comments

Comments
 (0)