Skip to content

Commit d153c5f

Browse files
committed
Fixed really weird bug with java generics and raw parameters. Multiple-values in attribute holders have been fixed.
1 parent aabd47e commit d153c5f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

api/src/main/java/fr/jamailun/ultimatespellsystem/api/utils/AttributesHolder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public interface AttributesHolder {
6161
* @return a new, non-null collection of parsed elements.
6262
* @param <R> the produced type.
6363
*/
64+
@SuppressWarnings("RawUseOfParameterized")
6465
default <R> @NotNull Collection<R> parseMap(@NotNull String key, @NotNull BiFunction<Map<?,?>, String, R> builder) {
6566
List<R> output = new ArrayList<>();
6667

@@ -75,7 +76,9 @@ public interface AttributesHolder {
7576
// Read multi
7677
String keyMulti = key + "s";
7778
if(hasAttribute(keyMulti)) {
78-
for(Map<?,?> map : tryGetAttributes(keyMulti, Map.class)) {
79+
// Idk why it doesn't work when one-lined ??
80+
List<Map> maps = tryGetAttributes(keyMulti, Map.class);
81+
for(Map<?,?> map : maps) {
7982
R element = builder.apply(map, keyMulti);
8083
if(element != null) {
8184
output.add(element);

0 commit comments

Comments
 (0)