Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public BuildResult getResult() {

};

private List<LinkedHashMap<String, List<LinkedHashMap<String, Object>>>> actions; // TODO: Should be improved.
private List<Map<String, Object>> actions; // TODO: Should be improved.
private boolean building;
private String description;
private String displayName;
Expand Down Expand Up @@ -162,10 +162,8 @@ public boolean isBuilding() {

public List<BuildCause> getCauses() {
return actions.stream()
.filter(item -> item.containsKey("causes"))
.flatMap(item -> item.entrySet().stream())
.flatMap(sub -> sub.getValue().stream())
.map(item -> convertToBuildCause(item))
.flatMap(item -> ((List<Map<String, Object>>) item.getOrDefault("causes", List.of())).stream())
.map(this::convertToBuildCause)
.collect(toList());
}

Expand Down Expand Up @@ -348,9 +346,7 @@ public List getActions() {

public Map<String, Object> getParameters() {
Map<String, Object> parameters = actions.stream()
.filter(item -> item.containsKey("parameters"))
.flatMap(item -> item.entrySet().stream())
.flatMap(sub -> sub.getValue().stream())
.flatMap(item -> ((List<Map<String, Object>>) item.getOrDefault("parameters", List.of())).stream())
.collect(toMap(k -> (String) k.get("name"), v -> v.get("value")));

return parameters;
Expand Down