Skip to content

Commit 9708c4e

Browse files
committed
fix: remove extra code
1 parent dfb2999 commit 9708c4e

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/main/java/io/odpf/depot/message/field/FieldUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public static String convertToString(Object value) {
3434

3535
public static String convertToStringForSpecialTypes(Object value, Function<Object, String> toStringFunc) {
3636
if (value instanceof Collection<?>) {
37-
return "[" + ((Collection<?>) value)
37+
return GSON.toJson(((Collection<?>) value)
3838
.stream()
39-
.map(o -> ("\"" + toStringFunc.apply(o) + "\""))
40-
.collect(Collectors.joining(",")) + "]";
39+
.map(toStringFunc)
40+
.collect(Collectors.toList()));
4141
}
4242
return toStringFunc.apply(value);
4343
}

src/main/java/io/odpf/depot/message/proto/converter/fields/ProtoFieldFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ public static ProtoField getField(Descriptors.FieldDescriptor descriptor, Object
1212
List<ProtoField> protoFields = Arrays.asList(
1313
new DurationProtoField(descriptor, fieldValue),
1414
new TimestampProtoField(descriptor, fieldValue),
15+
new MapProtoField(descriptor, fieldValue),
1516
new EnumProtoField(descriptor, fieldValue),
1617
new ByteProtoField(descriptor, fieldValue),
1718
new StructProtoField(descriptor, fieldValue),
18-
new MessageProtoField(descriptor, fieldValue),
19-
new MapProtoField(descriptor, fieldValue)
19+
new MessageProtoField(descriptor, fieldValue)
2020
);
2121
Optional<ProtoField> first = protoFields
2222
.stream()

0 commit comments

Comments
 (0)