3232import java .util .stream .IntStream ;
3333import java .util .stream .Stream ;
3434import org .apache .logging .log4j .core .time .MutableInstant ;
35- import org .apache .logging .log4j .core .util .internal .instant .InstantPatternDynamicFormatter .DateTimeFormatterPatternSequence ;
35+ import org .apache .logging .log4j .core .util .internal .instant .InstantPatternDynamicFormatter .DynamicPatternSequence ;
3636import org .apache .logging .log4j .core .util .internal .instant .InstantPatternDynamicFormatter .PatternSequence ;
3737import org .apache .logging .log4j .core .util .internal .instant .InstantPatternDynamicFormatter .SecondPatternSequence ;
3838import org .apache .logging .log4j .core .util .internal .instant .InstantPatternDynamicFormatter .StaticPatternSequence ;
@@ -59,56 +59,56 @@ static List<Arguments> sequencingTestCases() {
5959 testCases .add (Arguments .of (":'foo'," , ChronoUnit .DAYS , singletonList (new StaticPatternSequence (":foo," ))));
6060
6161 // `SSSX` should be treated constant for daily updates
62- testCases .add (Arguments .of ("SSSX" , ChronoUnit .DAYS , asList (pMilliSec (), pDtf ("X" ))));
62+ testCases .add (Arguments .of ("SSSX" , ChronoUnit .DAYS , asList (pMilliSec (), pDyn ("X" ))));
6363
6464 // `yyyyMMddHHmmssSSSX` instant cache updated hourly
6565 testCases .add (Arguments .of (
6666 "yyyyMMddHHmmssSSSX" ,
6767 ChronoUnit .HOURS ,
68- asList (pDtf ("yyyyMMddHH" , ChronoUnit .HOURS ), pDtf ("mm" ), pSec ("" , 3 ), pDtf ("X" ))));
68+ asList (pDyn ("yyyyMMddHH" , ChronoUnit .HOURS ), pDyn ("mm" ), pSec ("" , 3 ), pDyn ("X" ))));
6969
7070 // `yyyyMMddHHmmssSSSX` instant cache updated per minute
7171 testCases .add (Arguments .of (
7272 "yyyyMMddHHmmssSSSX" ,
7373 ChronoUnit .MINUTES ,
74- asList (pDtf ("yyyyMMddHHmm" , ChronoUnit .MINUTES ), pSec ("" , 3 ), pDtf ("X" ))));
74+ asList (pDyn ("yyyyMMddHHmm" , ChronoUnit .MINUTES ), pSec ("" , 3 ), pDyn ("X" ))));
7575
7676 // ISO9601 instant cache updated daily
7777 final String iso8601InstantPattern = "yyyy-MM-dd'T'HH:mm:ss.SSSX" ;
7878 testCases .add (Arguments .of (
7979 iso8601InstantPattern ,
8080 ChronoUnit .DAYS ,
8181 asList (
82- pDtf ("yyyy'-'MM'-'dd'T'" , ChronoUnit .DAYS ),
83- pDtf ("HH':'mm':'" , ChronoUnit .MINUTES ),
82+ pDyn ("yyyy'-'MM'-'dd'T'" , ChronoUnit .DAYS ),
83+ pDyn ("HH':'mm':'" , ChronoUnit .MINUTES ),
8484 pSec ("." , 3 ),
85- pDtf ("X" ))));
85+ pDyn ("X" ))));
8686
8787 // ISO9601 instant cache updated per minute
8888 testCases .add (Arguments .of (
8989 iso8601InstantPattern ,
9090 ChronoUnit .MINUTES ,
91- asList (pDtf ("yyyy'-'MM'-'dd'T'HH':'mm':'" , ChronoUnit .MINUTES ), pSec ("." , 3 ), pDtf ("X" ))));
91+ asList (pDyn ("yyyy'-'MM'-'dd'T'HH':'mm':'" , ChronoUnit .MINUTES ), pSec ("." , 3 ), pDyn ("X" ))));
9292
9393 // ISO9601 instant cache updated per second
9494 testCases .add (Arguments .of (
9595 iso8601InstantPattern ,
9696 ChronoUnit .SECONDS ,
97- asList (pDtf ("yyyy'-'MM'-'dd'T'HH':'mm':'" , ChronoUnit .MINUTES ), pSec ("." , 3 ), pDtf ("X" ))));
97+ asList (pDyn ("yyyy'-'MM'-'dd'T'HH':'mm':'" , ChronoUnit .MINUTES ), pSec ("." , 3 ), pDyn ("X" ))));
9898
9999 // Seconds and micros
100100 testCases .add (Arguments .of (
101- "HH:mm:ss.SSSSSS" , ChronoUnit .MINUTES , asList (pDtf ("HH':'mm':'" , ChronoUnit .MINUTES ), pSec ("." , 6 ))));
101+ "HH:mm:ss.SSSSSS" , ChronoUnit .MINUTES , asList (pDyn ("HH':'mm':'" , ChronoUnit .MINUTES ), pSec ("." , 6 ))));
102102
103103 return testCases ;
104104 }
105105
106- private static DateTimeFormatterPatternSequence pDtf (final String singlePattern ) {
107- return new DateTimeFormatterPatternSequence (singlePattern );
106+ private static DynamicPatternSequence pDyn (final String singlePattern ) {
107+ return new DynamicPatternSequence (singlePattern );
108108 }
109109
110- private static DateTimeFormatterPatternSequence pDtf (final String pattern , final ChronoUnit precision ) {
111- return new DateTimeFormatterPatternSequence (pattern , precision );
110+ private static DynamicPatternSequence pDyn (final String pattern , final ChronoUnit precision ) {
111+ return new DynamicPatternSequence (pattern , precision );
112112 }
113113
114114 private static SecondPatternSequence pSec (String separator , int fractionalDigits ) {
0 commit comments