Skip to content

Commit cbd1915

Browse files
committed
Polishing
1 parent 6357c51 commit cbd1915

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

spring-context/src/test/java/org/springframework/context/annotation/Spr15275Tests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public Foo getObject() {
216216
public Class<?> getObjectType() {
217217
return FooInterface.class;
218218
}
219-
};
219+
}
220220

221221

222222
protected interface FooInterface {

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

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -518,22 +518,20 @@ private static String changeFirstCharacterCase(String str, boolean capitalize) {
518518
if (!hasLength(str)) {
519519
return str;
520520
}
521+
char baseChar = str.charAt(0);
522+
char updatedChar;
523+
if (capitalize) {
524+
updatedChar = Character.toUpperCase(baseChar);
525+
}
521526
else {
522-
char baseChar = str.charAt(0);
523-
char updatedChar;
524-
if (capitalize) {
525-
updatedChar = Character.toUpperCase(baseChar);
526-
}
527-
else {
528-
updatedChar = Character.toLowerCase(baseChar);
529-
}
530-
if (baseChar == updatedChar) {
531-
return str;
532-
}
533-
char[] chars = str.toCharArray();
534-
chars[0] = updatedChar;
535-
return new String(chars, 0, chars.length);
527+
updatedChar = Character.toLowerCase(baseChar);
528+
}
529+
if (baseChar == updatedChar) {
530+
return str;
536531
}
532+
char[] chars = str.toCharArray();
533+
chars[0] = updatedChar;
534+
return new String(chars, 0, chars.length);
537535
}
538536

539537
/**

spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-20167the original author or authors.
2+
* Copyright 2002-2017 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.
@@ -1985,7 +1985,6 @@ static class SimpleConfigTestCase {
19851985
static class GroupOfCharsClass {
19861986
}
19871987

1988-
19891988
@Retention(RetentionPolicy.RUNTIME)
19901989
@interface AliasForWithMissingAttributeDeclaration {
19911990

0 commit comments

Comments
 (0)