ArrayList<DependencyInfo> list = new ArrayList<DependencyInfo>(dependencies.length);
for (Dependency dependency : dependencies) {
final String dependencyType = dependency.getClass().getSimpleName();
final String exportFilter = dependency.getExportFilter().toString();
final String importFilter = dependency.getImportFilter().toString();
final DependencyInfo info;
if (dependency instanceof LocalDependency) {
final LocalDependency localDependency = (LocalDependency) dependency;
ArrayList<String> pathList = new ArrayList<String>(localDependency.getPaths());
Collections.sort(pathList);
info = new DependencyInfo(dependencyType, exportFilter, importFilter, null, null, false, localDependency.getLocalLoader().toString(), pathList);
} else if (dependency instanceof ModuleDependency) {
final ModuleDependency moduleDependency = (ModuleDependency) dependency;
info = new DependencyInfo(dependencyType, exportFilter, importFilter, moduleDependency.getModuleLoader().mxBean, moduleDependency.getIdentifier().toString(), moduleDependency.isOptional(), null, null);
} else {
info = new DependencyInfo(dependencyType, exportFilter, importFilter, null, null, false, null, null);
}
list.add(info);
}
return list;
}