optional drill-down
@@ -244,8 +244,23 @@ public class MetadataUtility {
.fetch();
var callIds = new HashSet<>(callInfo.map(Record2::value1));
+// callIds.addAll(callIdsSubProj);
+ callInfo.forEach(r -> cache.callIdToPkgVsn.put(r.value1(), cache.pkgVsnIdToVsn.get(r.value2())));
+ return callIds;
+ }
- // Drill-down technique
+ /**
+ * Implements drill-down technique to find subprojects carrying the same callables.
+ * @param pkgVersionIds - map of package versions
+ * @param callIds - callable IDs of the main project
+ * @param fastenUri - fasten_uri to drill
+ * @param context - DSL context
+ * @return - List of callable IDs that we were able to drill
+ */
+ public List<Long> getDrilledDownCallables(HashSet<Long> pkgVersionIds,
+ Set<Long> callIds,
+ String fastenUri,
+ DSLContext context) {
var callIdsSubProj = new ArrayList<Long>();
var pkgVersions = pkgVersionIds.stream().map(id -> cache.pkgVsnIdToVsn.get(id)).collect(Collectors.toList());
callIds.forEach(callId -> {
@@ -264,9 +279,7 @@ public class MetadataUtility {
});
if (callIdsSubProj.size() > 0) logger.info("Found " + (callIdsSubProj.size() - 1) + " extra callable(s) using drill-down");
- callIds.addAll(callIdsSubProj);
- callInfo.forEach(r -> cache.callIdToPkgVsn.put(r.value1(), cache.pkgVsnIdToVsn.get(r.value2())));
- return callIds;
+ return callIdsSubProj;
}
/**
