This is an automated email from the ASF dual-hosted git repository.
garydgregory 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 9cc209799 Sort members
9cc209799 is described below
commit 9cc2097993629b87f0505fab3612386807a20845
Author: Gary Gregory <[email protected]>
AuthorDate: Tue Jul 7 06:35:53 2026 -0400
Sort members
---
.../lang3/text/ExtendedMessageFormatTest.java | 26 +++++++++++-----------
.../commons/lang3/time/FastDateParserTest.java | 26 +++++++++++-----------
2 files changed, 26 insertions(+), 26 deletions(-)
diff --git
a/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
b/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
index c5f6b90f3..16bd98864 100644
--- a/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
+++ b/src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
@@ -344,19 +344,6 @@ void testEmbeddedPatternInChoice() {
assertEquals(emf.format(new Object[] {"there", 3, "great"}), "Hi
there, got 3, GREAT!");
}
- /**
- * A format element whose format style ends with a quoted literal
immediately before the closing brace is a valid
- * pattern (accepted by {@link MessageFormat} and by this class when no
registry is supplied), but the registry
- * parsing path rejected it with "Unterminated format element".
- */
- @Test
- void testQuotedLiteralAtEndOfFormatElement() {
- assertEquals("ABC", new ExtendedMessageFormat("{0,upper,'x'}",
registry).format(new Object[] {"abc"}));
- assertEquals("ABC", new ExtendedMessageFormat("{0,upper,'}'}",
registry).format(new Object[] {"abc"}));
- // a built-in format style ending in a quote only reaches the registry
parser because the registry is non-null
- assertEquals("5%", new ExtendedMessageFormat("{0,number,0'%'}",
registry).format(new Object[] {Integer.valueOf(5)}));
- }
-
/**
* Test equals() and hashCode().
*/
@@ -531,6 +518,19 @@ void testOverriddenBuiltinFormat2(final Locale locale) {
assertEquals(pattern, dateShort.toPattern(), "overridden date,short
pattern");
}
+ /**
+ * A format element whose format style ends with a quoted literal
immediately before the closing brace is a valid
+ * pattern (accepted by {@link MessageFormat} and by this class when no
registry is supplied), but the registry
+ * parsing path rejected it with "Unterminated format element".
+ */
+ @Test
+ void testQuotedLiteralAtEndOfFormatElement() {
+ assertEquals("ABC", new ExtendedMessageFormat("{0,upper,'x'}",
registry).format(new Object[] {"abc"}));
+ assertEquals("ABC", new ExtendedMessageFormat("{0,upper,'}'}",
registry).format(new Object[] {"abc"}));
+ // a built-in format style ending in a quote only reaches the registry
parser because the registry is non-null
+ assertEquals("5%", new ExtendedMessageFormat("{0,number,0'%'}",
registry).format(new Object[] {Integer.valueOf(5)}));
+ }
+
@Test
void testTruncatedFormatElementWithRegistry() {
// Sanity check to match JRE
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 ab3cf2b3c..97f4b26be 100644
--- a/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
@@ -426,19 +426,6 @@ void testLang1359(final TriFunction<String, TimeZone,
Locale, DateParser> dpProv
assertEquals(0, pos.getIndex());
}
- @ParameterizedTest
- @MethodSource(DATE_PARSER_PARAMETERS)
- void testParseErrorMessageJapaneseImperial(final TriFunction<String,
TimeZone, Locale, DateParser> dpProvider) {
- // The Japanese imperial branch of parse(String) must keep the
"Unparseable date" diagnostic
- // (source text and parse position), not drop it and emit a message
starting with a stray ';'.
- final DateParser fdp = getInstance(dpProvider, "yyyy", TimeZones.GMT,
FastDateParser.JAPANESE_IMPERIAL);
- final String source = "not-a-date";
- final ParseException e = assertThrows(ParseException.class, () ->
fdp.parse(source));
- final String message = e.getMessage();
- assertTrue(message.startsWith("Unparseable date: '" + source + "'"),
message);
- assertTrue(message.contains("does not support dates before
1868-01-01."), message);
- }
-
@ParameterizedTest
@MethodSource(DATE_PARSER_PARAMETERS)
void testLang1380(final TriFunction<String, TimeZone, Locale, DateParser>
dpProvider) throws ParseException {
@@ -524,6 +511,19 @@ void testMilleniumBug() throws ParseException {
assertEquals(cal.getTime(), parser.parse("01.01.1000"));
}
+ @ParameterizedTest
+ @MethodSource(DATE_PARSER_PARAMETERS)
+ void testParseErrorMessageJapaneseImperial(final TriFunction<String,
TimeZone, Locale, DateParser> dpProvider) {
+ // The Japanese imperial branch of parse(String) must keep the
"Unparseable date" diagnostic
+ // (source text and parse position), not drop it and emit a message
starting with a stray ';'.
+ final DateParser fdp = getInstance(dpProvider, "yyyy", TimeZones.GMT,
FastDateParser.JAPANESE_IMPERIAL);
+ final String source = "not-a-date";
+ final ParseException e = assertThrows(ParseException.class, () ->
fdp.parse(source));
+ final String message = e.getMessage();
+ assertTrue(message.startsWith("Unparseable date: '" + source + "'"),
message);
+ assertTrue(message.contains("does not support dates before
1868-01-01."), message);
+ }
+
@ParameterizedTest
@MethodSource(DATE_PARSER_PARAMETERS)
void testParseLongShort(final TriFunction<String, TimeZone, Locale,
DateParser> dpProvider)