Skip to content

Commit c80f3ae

Browse files
committed
Reorder these conditions
1 parent 4b97c8c commit c80f3ae

File tree

1 file changed

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

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,15 +415,15 @@ private static Map<String, String> parseExtensions(String extensionString) {
415415

416416
private Object convertValueToType(String value, DataType type) {
417417
return switch (type) {
418+
case StringType -> value;
419+
case IntegerType -> Integer.parseInt(value);
418420
case LongType -> Long.parseLong(value);
419-
case DoubleType -> Double.parseDouble(value);
420421
case FloatType -> Float.parseFloat(value);
421-
case IntegerType -> Integer.parseInt(value);
422+
case DoubleType -> Double.parseDouble(value);
423+
case BooleanType -> Boolean.valueOf(value);
422424
case TimestampType -> toTimestamp(value);
423425
case MACAddressType -> toMACAddress(value);
424426
case IPType -> toIP(value);
425-
case BooleanType -> Boolean.valueOf(value);
426-
case StringType -> value;
427427
case null -> value; // default to string if extension is not defined
428428
};
429429
}

0 commit comments

Comments
 (0)