Skip to content

Commit f1fed9c

Browse files
committed
Polishing
(cherry picked from commit 20dea0d)
1 parent d2e7cf4 commit f1fed9c

File tree

4 files changed

+71
-74
lines changed

4 files changed

+71
-74
lines changed

Diff for: spring-context/src/main/java/org/springframework/format/datetime/standard/InstantFormatter.java

+3-3
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-2024 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.
@@ -41,12 +41,12 @@ public class InstantFormatter implements Formatter<Instant> {
4141

4242
@Override
4343
public Instant parse(String text, Locale locale) throws ParseException {
44-
if (text.length() > 0 && Character.isAlphabetic(text.charAt(0))) {
44+
if (!text.isEmpty() && Character.isAlphabetic(text.charAt(0))) {
4545
// assuming RFC-1123 value a la "Tue, 3 Jun 2008 11:05:30 GMT"
4646
return Instant.from(DateTimeFormatter.RFC_1123_DATE_TIME.parse(text));
4747
}
4848
else {
49-
// assuming UTC instant a la "2007-12-03T10:15:30.00Z"
49+
// assuming UTC instant a la "2007-12-03T10:15:30.000Z"
5050
return Instant.parse(text);
5151
}
5252
}

Diff for: spring-context/src/test/java/org/springframework/format/datetime/DateFormattingTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -52,7 +52,7 @@
5252
* @author Juergen Hoeller
5353
* @author Sam Brannen
5454
*/
55-
public class DateFormattingTests {
55+
class DateFormattingTests {
5656

5757
private final FormattingConversionService conversionService = new FormattingConversionService();
5858

0 commit comments

Comments
 (0)