refactor(bazel): code smell
@@ -52,6 +52,12 @@ public class HaskellCabalLibraryJsonProtoParser {
throw new IntegrationException(String.format("Unable to parse results from JSON proto string: %s", jsonProtoString));
}
for (ResultItem result : proto.getResults()) {
+ extractAddDependencies(jsonProtoString, dependencies, result);
+ }
+ return dependencies;
+ }
+
+ private void extractAddDependencies(String jsonProtoString, List<NameVersion> dependencies, ResultItem result) throws IntegrationException {
if (result == null || result.getTarget() == null) {
throw new IntegrationException(String.format("Unable to parse target from result inJSON proto string: %s", jsonProtoString));
}
@@ -70,8 +76,6 @@ public class HaskellCabalLibraryJsonProtoParser {
}
}
}
- return dependencies;
- }
private Optional<NameVersion> extractDependency(List<AttributeItem> attributes) throws IntegrationException {
String dependencyName = null;
