Skip to content

Commit aee2bfe

Browse files
committed
remove java 8 incompatible Map.of
1 parent f66cf2d commit aee2bfe

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
</scm>
3131

3232
<properties>
33-
<maven.compiler.source>8</maven.compiler.source>
34-
<maven.compiler.target>8</maven.compiler.target>
33+
<maven.compiler.release>8</maven.compiler.release>
3534
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3635
<jackson.version>2.14.2</jackson.version>
3736
<aws.version>1.12.477</aws.version>
@@ -136,7 +135,7 @@
136135
<artifactId>maven-compiler-plugin</artifactId>
137136
<version>3.13.0</version>
138137
<configuration>
139-
<release>8</release>
138+
<release>${maven.compiler.release}</release>
140139
<encoding>UTF-8</encoding>
141140
<excludes>
142141
<exclude>.gitignore</exclude>

src/test/java/dev/zarr/zarrjava/ZarrTest.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import dev.zarr.zarrjava.v3.*;
1515
import dev.zarr.zarrjava.v3.codec.CodecBuilder;
1616
import dev.zarr.zarrjava.v3.codec.core.TransposeCodec;
17-
import jdk.jshell.spi.ExecutionControl;
1817
import org.junit.jupiter.api.Assertions;
1918
import org.junit.jupiter.api.BeforeAll;
2019
import org.junit.jupiter.api.Test;
@@ -30,6 +29,7 @@
3029
import java.nio.file.Paths;
3130
import java.util.Arrays;
3231
import java.util.Comparator;
32+
import java.util.HashMap;
3333
import java.util.Map;
3434
import java.util.stream.Stream;
3535

@@ -150,13 +150,16 @@ public void testWriteReadWithZarrita(String codec, String codecParam) throws Exc
150150
int[] testData = new int[16 * 16 * 16];
151151
Arrays.setAll(testData, p -> p);
152152

153+
Map<String, Object> attributes = new HashMap<>();
154+
attributes.put("test_key", "test_value");
155+
153156
StoreHandle storeHandle = new FilesystemStore(TESTOUTPUT).resolve("write_to_zarrita", codec, codecParam);
154157
ArrayMetadataBuilder builder = Array.metadataBuilder()
155158
.withShape(16, 16, 16)
156159
.withDataType(DataType.UINT32)
157160
.withChunkShape(2, 4, 8)
158161
.withFillValue(0)
159-
.withAttributes(Map.of("test_key", "test_value"));
162+
.withAttributes(attributes);
160163

161164
switch (codec) {
162165
case "blosc":
@@ -425,8 +428,11 @@ public void testV3FillValue() throws ZarrException {
425428
public void testV3Group() throws IOException, ZarrException {
426429
FilesystemStore fsStore = new FilesystemStore(TESTOUTPUT);
427430

431+
Map<String, Object> attributes = new HashMap<>();
432+
attributes.put("hello", "world");
433+
428434
Group group = Group.create(fsStore.resolve("testgroup"));
429-
Group group2 = group.createGroup("test2", Map.of("hello", "world"));
435+
Group group2 = group.createGroup("test2", attributes);
430436
Array array = group2.createArray("array", b ->
431437
b.withShape(10, 10)
432438
.withDataType(DataType.UINT8)

0 commit comments

Comments
 (0)