Skip to content

Commit ab27826

Browse files
committed
update clusterless-commons-core to vers 0.14
1 parent 0b2b65d commit ab27826

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

tessellate-main/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ val jupiter = "5.10.3"
5959

6060
dependencies {
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")

tessellate-main/src/main/java/io/clusterless/tessellate/parser/FieldsParser.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)