if (type == Data.DATASET) {
Set<String> dataSetsUsed = dataSetsUsedBy(appSpec);
List<DatasetRecord> result = Lists.newArrayListWithExpectedSize(dataSetsUsed.size());
for (String dsName : dataSetsUsed) {
String typeName = null;
DatasetSpecification dsSpec = getDatasetSpec(dsName);
if (dsSpec != null) {
typeName = dsSpec.getType();
}
result.add(makeDataSetRecord(dsName, typeName));
}
return GSON.toJson(result);
}