You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/02/21 16:46:44 UTC
[commons-lang] branch master updated: Clarify local var names.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new 5f8c016 Clarify local var names.
5f8c016 is described below
commit 5f8c0167071d8f7e287739fc302aa663f0b657f1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 21 11:46:40 2021 -0500
Clarify local var names.
---
.../commons/lang3/time/FastDateParserTest.java | 24 +++++++++++-----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java b/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
index 314f401..8281581 100644
--- a/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
@@ -525,8 +525,8 @@ public class FastDateParserTest {
cal.set(Calendar.DAY_OF_MONTH, 10);
final Date in = cal.getTime();
- final FastDateParser fdp = new FastDateParser(format, tz, locale, centuryStart);
- validateSdfFormatFdpParseEquality(format, locale, tz, fdp, in, year, centuryStart);
+ final FastDateParser fastDateParser = new FastDateParser(format, tz, locale, centuryStart);
+ validateSdfFormatFdpParseEquality(format, locale, tz, fastDateParser, in, year, centuryStart);
}
}
}
@@ -683,18 +683,18 @@ public class FastDateParserTest {
}
}
- private void validateSdfFormatFdpParseEquality(final String format, final Locale locale, final TimeZone tz,
- final DateParser fdp, final Date in, final int year, final Date cs) throws ParseException {
- final SimpleDateFormat sdf = new SimpleDateFormat(format, locale);
- sdf.setTimeZone(tz);
- if (format.equals(SHORT_FORMAT)) {
- sdf.set2DigitYearStart(cs);
+ private void validateSdfFormatFdpParseEquality(final String formatStr, final Locale locale, final TimeZone timeZone,
+ final DateParser dateParser, final Date inDate, final int year, final Date csDate) throws ParseException {
+ final SimpleDateFormat sdf = new SimpleDateFormat(formatStr, locale);
+ sdf.setTimeZone(timeZone);
+ if (formatStr.equals(SHORT_FORMAT)) {
+ sdf.set2DigitYearStart(csDate);
}
- final String fmt = sdf.format(in);
+ final String fmt = sdf.format(inDate);
try {
- final Date out = fdp.parse(fmt);
- assertEquals(in, out,
- "Locale: " + locale + ", date: " + in + ", format: '" + format + "', time zone: " + tz.getID());
+ final Date out = dateParser.parse(fmt);
+ assertEquals(inDate, out, "Locale: '" + locale + "', parse: '" + fmt + "', format: '" + formatStr
+ + "', time zone: '" + timeZone.getID() + "'");
} catch (final ParseException pe) {
if (year >= 1868 || !locale.getCountry().equals("JP")) {
// LANG-978