Skip to content

Commit

Permalink
Fix bug with parameterized return types of List
Browse files Browse the repository at this point in the history
  • Loading branch information
KotlinFactory committed Oct 23, 2023
1 parent 75ad2f3 commit 898754d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>simplixstorage</artifactId>
<version>3.2.6</version>
<version>3.2.7</version>

<build>
<defaultGoal>clean verify -U</defaultGoal>
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/de/leonhard/storage/internal/DataStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import de.leonhard.storage.internal.serialize.SimplixSerializer;
import de.leonhard.storage.util.ClassWrapper;
import de.leonhard.storage.util.Valid;
import java.util.*;
import java.util.stream.Collectors;
import lombok.NonNull;
import org.jetbrains.annotations.Nullable;

import java.util.*;
import java.util.stream.Collectors;

public interface DataStorage {

/**
Expand Down Expand Up @@ -199,15 +200,15 @@ default List<String> getStringList(final String key) {
}

default List<Integer> getIntegerList(final String key) {
return getOrDefault(key, new ArrayList<>());
return getOrDefault(key, new ArrayList<String>()).stream().map(Integer::parseInt).collect(Collectors.toList());
}

default List<Byte> getByteList(final String key) {
return getOrDefault(key, new ArrayList<>());
return getOrDefault(key, new ArrayList<String>()).stream().map(Byte::parseByte).collect(Collectors.toList());
}

default List<Long> getLongList(final String key) {
return getOrDefault(key, new ArrayList<>());
return getOrDefault(key, new ArrayList<String>()).stream().map(Long::parseLong).collect(Collectors.toList());
}

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

0 comments on commit 898754d

Please sign in to comment.