File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
src/main/java/io/clusterless/tessellate/parser Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ val jupiter = "5.10.3"
5959
6060dependencies {
6161
62- val commons = " 0.12 "
62+ val commons = " 0.14 "
6363 implementation(" io.clusterless:clusterless-commons-core:$commons " )
6464
6565 implementation(" com.google.guava:guava:33.4.0-jre" )
Original file line number Diff line number Diff line change @@ -199,12 +199,10 @@ private static DateTimeFormatter createPattern(String splitType) {
199199 .withZone (ZoneId .of ("UTC" ));
200200 }
201201
202- private static TemporalUnit getUnit (String s ) {
203- try {
204- return IntervalUnits .find (s .toUpperCase (Locale .ROOT ));
205- } catch (IllegalArgumentException e ) {
206- return null ;
207- }
202+ private static TemporalUnit getUnit (String value ) {
203+ return IntervalUnits .findSafe (value .toUpperCase (Locale .ROOT )) // lookup unit by name
204+ .or (() -> IntervalUnits .findDurationWithin (value )) // use duration string if present
205+ .orElse (null );
208206 }
209207
210208 public static Comparable <?> parseInt (String fieldName ) {
You can’t perform that action at this time.
0 commit comments