Skip to content

Commit 898754d

Browse files
committed
Fix bug with parameterized return types of List
1 parent 75ad2f3 commit 898754d

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns="http://maven.apache.org/POM/4.0.0"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<artifactId>simplixstorage</artifactId>
6-
<version>3.2.6</version>
6+
<version>3.2.7</version>
77

88
<build>
99
<defaultGoal>clean verify -U</defaultGoal>

src/main/java/de/leonhard/storage/internal/DataStorage.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
import de.leonhard.storage.internal.serialize.SimplixSerializer;
55
import de.leonhard.storage.util.ClassWrapper;
66
import de.leonhard.storage.util.Valid;
7-
import java.util.*;
8-
import java.util.stream.Collectors;
97
import lombok.NonNull;
108
import org.jetbrains.annotations.Nullable;
119

10+
import java.util.*;
11+
import java.util.stream.Collectors;
12+
1213
public interface DataStorage {
1314

1415
/**
@@ -199,15 +200,15 @@ default List<String> getStringList(final String key) {
199200
}
200201

201202
default List<Integer> getIntegerList(final String key) {
202-
return getOrDefault(key, new ArrayList<>());
203+
return getOrDefault(key, new ArrayList<String>()).stream().map(Integer::parseInt).collect(Collectors.toList());
203204
}
204205

205206
default List<Byte> getByteList(final String key) {
206-
return getOrDefault(key, new ArrayList<>());
207+
return getOrDefault(key, new ArrayList<String>()).stream().map(Byte::parseByte).collect(Collectors.toList());
207208
}
208209

209210
default List<Long> getLongList(final String key) {
210-
return getOrDefault(key, new ArrayList<>());
211+
return getOrDefault(key, new ArrayList<String>()).stream().map(Long::parseLong).collect(Collectors.toList());
211212
}
212213

213214
default Map<?, ?> getMap(final String key) {

0 commit comments

Comments
 (0)