diff --git a/metadata-integration/java/datahub-protobuf/src/main/java/datahub/protobuf/ProtobufUtils.java b/metadata-integration/java/datahub-protobuf/src/main/java/datahub/protobuf/ProtobufUtils.java index ef5bc52aaee7a..8420512624368 100644 --- a/metadata-integration/java/datahub-protobuf/src/main/java/datahub/protobuf/ProtobufUtils.java +++ b/metadata-integration/java/datahub-protobuf/src/main/java/datahub/protobuf/ProtobufUtils.java @@ -7,7 +7,6 @@ import com.linkedin.util.Pair; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; @@ -22,8 +21,7 @@ public class ProtobufUtils { private ProtobufUtils() {} public static String collapseLocationComments(DescriptorProtos.SourceCodeInfo.Location location) { - String orig = - Stream.concat( + return Stream.concat( location.getLeadingDetachedCommentsList().stream(), Stream.of(location.getLeadingComments(), location.getTrailingComments())) .filter(Objects::nonNull) @@ -31,14 +29,6 @@ public static String collapseLocationComments(DescriptorProtos.SourceCodeInfo.Lo .map(line -> line.replaceFirst("^[*/ ]+", "")) .collect(Collectors.joining("\n")) .trim(); - - /* - * Sometimes DataHub doesn't like these strings. Not sure if its DataHub - * or protobuf issue: https://github.com/protocolbuffers/protobuf/issues/4691 - * - * We essentially smash utf8 chars to ascii here - */ - return new String(orig.getBytes(StandardCharsets.ISO_8859_1)); } /*