Skip to content

Commit 6ad0a9e

Browse files
matteo-mara-sonarsourcesonartech
authored andcommitted
SONAR-27395 Move away from deprecated lz4 methods
1 parent 4dd71b9 commit 6ad0a9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/sonar-db-dao/src/main/java/org/sonar/db/source/FileSourceDto.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public DbFileSources.Data decodeSourceData(byte[] binaryData) {
107107
}
108108

109109
private static DbFileSources.Data decodeRegularSourceData(byte[] binaryData) throws IOException {
110-
try (LZ4BlockInputStream lz4Input = new LZ4BlockInputStream(new ByteArrayInputStream(binaryData))) {
110+
try (LZ4BlockInputStream lz4Input = LZ4BlockInputStream.newBuilder().build(new ByteArrayInputStream(binaryData))) {
111111
return DbFileSources.Data.parseFrom(lz4Input);
112112
} catch (InvalidProtocolBufferException e) {
113113
if (SIZE_LIMIT_EXCEEDED_EXCEPTION_MESSAGE.equals(e.getMessage())) {
@@ -118,7 +118,7 @@ private static DbFileSources.Data decodeRegularSourceData(byte[] binaryData) thr
118118
}
119119

120120
private static DbFileSources.Data decodeHugeSourceData(byte[] binaryData) throws IOException {
121-
try (LZ4BlockInputStream lz4Input = new LZ4BlockInputStream(new ByteArrayInputStream(binaryData))) {
121+
try (LZ4BlockInputStream lz4Input = LZ4BlockInputStream.newBuilder().build(new ByteArrayInputStream(binaryData))) {
122122
CodedInputStream input = CodedInputStream.newInstance(lz4Input);
123123
input.setSizeLimit(Integer.MAX_VALUE);
124124
return DbFileSources.Data.parseFrom(input);

0 commit comments

Comments
 (0)