Skip to content

Commit 5c3ee2b

Browse files
committed
The dataType is never null
1 parent 4bdae8e commit 5c3ee2b

File tree

1 file changed

+6
-2
lines changed
  • modules/ingest-common/src/main/java/org/elasticsearch/ingest/common

1 file changed

+6
-2
lines changed

modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/CefParser.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ private Object convertValueToType(String value, DataType type) {
422422
case TimestampType -> toTimestamp(value);
423423
case MACAddressType -> toMACAddress(value);
424424
case IPType -> toIP(value);
425-
case null -> value; // default to string if extension is not defined
426425
};
427426
}
428427

@@ -559,5 +558,10 @@ public void close() {
559558
}
560559
}
561560

562-
private record ExtensionMapping(String key, DataType dataType, @Nullable String ecsKey) {}
561+
private record ExtensionMapping(String key, DataType dataType, @Nullable String ecsKey) {
562+
ExtensionMapping {
563+
Objects.requireNonNull(key);
564+
Objects.requireNonNull(dataType);
565+
}
566+
}
563567
}

0 commit comments

Comments
 (0)