From a7bf867f1516f9ada93c3252753f250652009f8b Mon Sep 17 00:00:00 2001 From: Bart Louwers Date: Sat, 22 Nov 2025 13:05:14 +0100 Subject: [PATCH 1/2] Fix Java build warnings --- .../maplibre/mlt/decoder/StringDecoder.java | 16 +++++++++------- .../org/maplibre/mlt/vector/FeatureTable.java | 18 +++++++----------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/java/mlt-core/src/main/java/org/maplibre/mlt/decoder/StringDecoder.java b/java/mlt-core/src/main/java/org/maplibre/mlt/decoder/StringDecoder.java index 760f9e61a..e9ff3d367 100644 --- a/java/mlt-core/src/main/java/org/maplibre/mlt/decoder/StringDecoder.java +++ b/java/mlt-core/src/main/java/org/maplibre/mlt/decoder/StringDecoder.java @@ -87,12 +87,13 @@ public static HashMap> resolve( List dictionary = null; if (symbolLengthStream != null && symbolTableStream != null && dictionaryLengthStream != null) { - @SuppressWarnings("deprecation") + var decompressedLength = dictionaryLengthStream.stream().mapToInt(i -> i).sum(); var utf8Values = FsstEncoder.decode( symbolTableStream, symbolLengthStream.stream().mapToInt(i -> i).toArray(), - dictionaryStream); + dictionaryStream, + decompressedLength); dictionary = decodeDictionary(dictionaryLengthStream, utf8Values); } else if (dictionaryLengthStream != null) { dictionary = decodeDictionary(dictionaryLengthStream, dictionaryStream); @@ -208,11 +209,13 @@ public static Triple> decode( } if (symbolTableStream != null && symbolLengthStream != null && dictionaryLengthStream != null) { + var decompressedLength = dictionaryLengthStream.stream().mapToInt(i -> i).sum(); var utf8Values = FsstEncoder.decode( symbolTableStream, symbolLengthStream.stream().mapToInt(i -> i).toArray(), - dictionaryStream); + dictionaryStream, + decompressedLength); return Triple.of( numValues, presentStream, @@ -316,12 +319,11 @@ public static List decodeFsstDictionaryEncodedStringColumn(byte[] data, compressedCorpusOffset.get(), compressedCorpusOffset.get() + compressedCorpusMetadata.byteLength()); - @SuppressWarnings("deprecation") + var length = IntegerDecoder.decodeIntStream(data, lengthOffset, lengthMetadata, false); + var decompressedLength = length.stream().mapToInt(i -> i).sum(); var values = FsstEncoder.decode( - symbols, symbolLength.stream().mapToInt(i -> i).toArray(), compressedCorpus); - - var length = IntegerDecoder.decodeIntStream(data, lengthOffset, lengthMetadata, false); + symbols, symbolLength.stream().mapToInt(i -> i).toArray(), compressedCorpus, decompressedLength); var decodedData = IntegerDecoder.decodeIntStream(data, dataOffset, dataMetadata, false); var decodedDictionary = new ArrayList(); diff --git a/java/mlt-core/src/main/java/org/maplibre/mlt/vector/FeatureTable.java b/java/mlt-core/src/main/java/org/maplibre/mlt/vector/FeatureTable.java index ee76fe7b1..197298812 100644 --- a/java/mlt-core/src/main/java/org/maplibre/mlt/vector/FeatureTable.java +++ b/java/mlt-core/src/main/java/org/maplibre/mlt/vector/FeatureTable.java @@ -14,26 +14,24 @@ public class FeatureTable implements Iterable { private final String name; - @SuppressWarnings("rawtypes") - private final Vector idColumn; + private final Vector idColumn; private final GeometryVector geometryColumn; - @SuppressWarnings("rawtypes") - private final Vector[] propertyColumns; + private final Vector[] propertyColumns; public FeatureTable( String name, GeometryVector geometryVector, - @SuppressWarnings("rawtypes") Vector[] properties) { + Vector[] properties) { this(name, null, geometryVector, properties); } public FeatureTable( String name, - @SuppressWarnings("rawtypes") Vector idColumn, + Vector idColumn, GeometryVector geometryVector, - @SuppressWarnings("rawtypes") Vector[] properties) { + Vector[] properties) { this.name = name; this.idColumn = idColumn; this.geometryColumn = geometryVector; @@ -87,8 +85,7 @@ public String getName() { return name; } - @SuppressWarnings("rawtypes") - public Vector getIdColumn() { + public Vector getIdColumn() { return idColumn; } @@ -96,8 +93,7 @@ public GeometryVector getGeometryColumn() { return geometryColumn; } - @SuppressWarnings("rawtypes") - public Vector[] getPropertyColumns() { + public Vector[] getPropertyColumns() { return propertyColumns; } } From 077efa06bd9d018792bb258d9910b683cb845e47 Mon Sep 17 00:00:00 2001 From: Bart Louwers Date: Sat, 22 Nov 2025 13:08:09 +0100 Subject: [PATCH 2/2] run spotlessApply --- .../main/java/org/maplibre/mlt/decoder/StringDecoder.java | 5 ++++- .../src/main/java/org/maplibre/mlt/vector/FeatureTable.java | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/java/mlt-core/src/main/java/org/maplibre/mlt/decoder/StringDecoder.java b/java/mlt-core/src/main/java/org/maplibre/mlt/decoder/StringDecoder.java index e9ff3d367..629561694 100644 --- a/java/mlt-core/src/main/java/org/maplibre/mlt/decoder/StringDecoder.java +++ b/java/mlt-core/src/main/java/org/maplibre/mlt/decoder/StringDecoder.java @@ -323,7 +323,10 @@ public static List decodeFsstDictionaryEncodedStringColumn(byte[] data, var decompressedLength = length.stream().mapToInt(i -> i).sum(); var values = FsstEncoder.decode( - symbols, symbolLength.stream().mapToInt(i -> i).toArray(), compressedCorpus, decompressedLength); + symbols, + symbolLength.stream().mapToInt(i -> i).toArray(), + compressedCorpus, + decompressedLength); var decodedData = IntegerDecoder.decodeIntStream(data, dataOffset, dataMetadata, false); var decodedDictionary = new ArrayList(); diff --git a/java/mlt-core/src/main/java/org/maplibre/mlt/vector/FeatureTable.java b/java/mlt-core/src/main/java/org/maplibre/mlt/vector/FeatureTable.java index 197298812..76615d8cb 100644 --- a/java/mlt-core/src/main/java/org/maplibre/mlt/vector/FeatureTable.java +++ b/java/mlt-core/src/main/java/org/maplibre/mlt/vector/FeatureTable.java @@ -20,10 +20,7 @@ public class FeatureTable implements Iterable { private final Vector[] propertyColumns; - public FeatureTable( - String name, - GeometryVector geometryVector, - Vector[] properties) { + public FeatureTable(String name, GeometryVector geometryVector, Vector[] properties) { this(name, null, geometryVector, properties); }