Skip to content

Commit

Permalink
Make Map generator more type-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcono1234 committed Sep 24, 2024
1 parent 27b509f commit 4c7050f
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ public SampleElements<Entry<String, JsonElement>> samples() {
public Map<String, JsonElement> create(Object... elements) {
JsonObject object = new JsonObject();
for (Object element : elements) {
@SuppressWarnings("unchecked")
var entry = (Entry<String, JsonElement>) element;
object.add(entry.getKey(), entry.getValue());
var entry = (Entry<?, ?>) element;
object.add((String) entry.getKey(), (JsonElement) entry.getValue());
}
return object.asMap();
}
Expand Down

0 comments on commit 4c7050f

Please sign in to comment.