From 5f8c0167071d8f7e287739fc302aa663f0b657f1 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 21 Feb 2021 11:46:40 -0500 Subject: [PATCH] Clarify local var names. --- .../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 314f40182..828158123 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