import java.util.ArrayList;\r
import java.util.Collection;\r
import java.util.HashMap;\r
+import java.util.List;\r
\r
/**\r
* The logic to compute which packages to install, based on the choices\r
* When the user doesn't provide a selection, looks at local packages to find\r
* those that can be updated and compute dependencies too.\r
*/\r
- public ArrayList<ArchiveInfo> computeUpdates(\r
+ public List<ArchiveInfo> computeUpdates(\r
Collection<Archive> selectedArchives,\r
SdkSources sources,\r
Package[] localPkgs,\r
boolean includeObsoletes) {\r
\r
- ArrayList<ArchiveInfo> archives = new ArrayList<ArchiveInfo>();\r
- ArrayList<Package> remotePkgs = new ArrayList<Package>();\r
+ List<ArchiveInfo> archives = new ArrayList<ArchiveInfo>();\r
+ List<Package> remotePkgs = new ArrayList<Package>();\r
SdkSource[] remoteSources = sources.getAllSources();\r
\r
// Create ArchiveInfos out of local (installed) packages.\r
* and adds them to the list of archives to install.\r
*/\r
public void addNewPlatforms(\r
- ArrayList<ArchiveInfo> archives,\r
+ Collection<ArchiveInfo> archives,\r
SdkSources sources,\r
Package[] localPkgs,\r
boolean includeObsoletes) {\r
*/\r
private Collection<Archive> findUpdates(\r
ArchiveInfo[] localArchives,\r
- ArrayList<Package> remotePkgs,\r
+ Collection<Package> remotePkgs,\r
SdkSource[] remoteSources,\r
boolean includeObsoletes) {\r
ArrayList<Archive> updates = new ArrayList<Archive>();\r
* an appropriate package.\r
*/\r
private void fixMissingLocalDependencies(\r
- ArrayList<ArchiveInfo> outArchives,\r
+ Collection<ArchiveInfo> outArchives,\r
Collection<Archive> selectedArchives,\r
- ArrayList<Package> remotePkgs,\r
+ Collection<Package> remotePkgs,\r
SdkSource[] remoteSources,\r
ArchiveInfo[] localArchives) {\r
\r
}\r
\r
private ArchiveInfo insertArchive(Archive archive,\r
- ArrayList<ArchiveInfo> outArchives,\r
+ Collection<ArchiveInfo> outArchives,\r
Collection<Archive> selectedArchives,\r
- ArrayList<Package> remotePkgs,\r
+ Collection<Package> remotePkgs,\r
SdkSource[] remoteSources,\r
ArchiveInfo[] localArchives,\r
boolean automated) {\r
* at least size 1 and contain no null elements.\r
*/\r
private ArchiveInfo[] findDependency(Package pkg,\r
- ArrayList<ArchiveInfo> outArchives,\r
+ Collection<ArchiveInfo> outArchives,\r
Collection<Archive> selectedArchives,\r
- ArrayList<Package> remotePkgs,\r
+ Collection<Package> remotePkgs,\r
SdkSource[] remoteSources,\r
ArchiveInfo[] localArchives) {\r
\r
*/\r
protected ArchiveInfo findToolsDependency(\r
IMinToolsDependency pkg,\r
- ArrayList<ArchiveInfo> outArchives,\r
+ Collection<ArchiveInfo> outArchives,\r
Collection<Archive> selectedArchives,\r
- ArrayList<Package> remotePkgs,\r
+ Collection<Package> remotePkgs,\r
SdkSource[] remoteSources,\r
ArchiveInfo[] localArchives) {\r
// This is the requirement to match.\r
*/\r
protected ArchiveInfo findPlatformToolsDependency(\r
IMinPlatformToolsDependency pkg,\r
- ArrayList<ArchiveInfo> outArchives,\r
+ Collection<ArchiveInfo> outArchives,\r
Collection<Archive> selectedArchives,\r
- ArrayList<Package> remotePkgs,\r
+ Collection<Package> remotePkgs,\r
SdkSource[] remoteSources,\r
ArchiveInfo[] localArchives) {\r
// This is the requirement to match.\r
*/\r
protected ArchiveInfo findPlatformDependency(\r
IPlatformDependency pkg,\r
- ArrayList<ArchiveInfo> outArchives,\r
+ Collection<ArchiveInfo> outArchives,\r
Collection<Archive> selectedArchives,\r
- ArrayList<Package> remotePkgs,\r
+ Collection<Package> remotePkgs,\r
SdkSource[] remoteSources,\r
ArchiveInfo[] localArchives) {\r
// This is the requirement to match.\r
*/\r
protected ArchiveInfo findMinApiLevelDependency(\r
IMinApiLevelDependency pkg,\r
- ArrayList<ArchiveInfo> outArchives,\r
+ Collection<ArchiveInfo> outArchives,\r
Collection<Archive> selectedArchives,\r
- ArrayList<Package> remotePkgs,\r
+ Collection<Package> remotePkgs,\r
SdkSource[] remoteSources,\r
ArchiveInfo[] localArchives) {\r
\r
*/\r
protected ArchiveInfo findExactApiLevelDependency(\r
IExactApiLevelDependency pkg,\r
- ArrayList<ArchiveInfo> outArchives,\r
+ Collection<ArchiveInfo> outArchives,\r
Collection<Archive> selectedArchives,\r
- ArrayList<Package> remotePkgs,\r
+ Collection<Package> remotePkgs,\r
SdkSource[] remoteSources,\r
ArchiveInfo[] localArchives) {\r
\r
* @param remoteSources A list of available remote sources to fetch from.\r
*/\r
protected void fetchRemotePackages(\r
- final ArrayList<Package> remotePkgs,\r
+ final Collection<Package> remotePkgs,\r
final SdkSource[] remoteSources) {\r
if (remotePkgs.size() > 0) {\r
return;\r