Revision 34021
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/model/PackagesTableModel.java | ||
---|---|---|
61 | 61 |
|
62 | 62 |
Set<TablePackageInfo> infoSet = |
63 | 63 |
new TreeSet<TablePackageInfo>(new TablePackageInfoComparator()); |
64 |
// Add installable package infos |
|
64 | 65 |
for (int i = 0; i < installerExecutionService.getPackageCount(); i++) { |
65 | 66 |
PackageInfo installerInfo = |
66 | 67 |
installerExecutionService.getPackageInfo(i); |
... | ... | |
70 | 71 |
infoSet.add(info); |
71 | 72 |
} |
72 | 73 |
} |
74 |
// Add already installed package infos |
|
73 | 75 |
try { |
74 | 76 |
PackageInfo[] installedPackages = |
75 | 77 |
installerManager.getInstalledPackages(pluginsFolder); |
... | ... | |
250 | 252 |
PackageInfo packageInfo1 = info1.getPackageInfo(); |
251 | 253 |
PackageInfo packageInfo2 = info2.getPackageInfo(); |
252 | 254 |
|
255 |
// 1: compare package code |
|
253 | 256 |
int comparison = compareCode(packageInfo1, packageInfo2); |
254 | 257 |
|
255 | 258 |
if (comparison == 0) { |
259 |
// 2: same package code, compare version |
|
256 | 260 |
comparison = compareVersion(packageInfo1, packageInfo2); |
257 | 261 |
if (comparison == 0) { |
262 |
// 3: same version, compare build |
|
258 | 263 |
comparison = compareBuild(packageInfo1, packageInfo2); |
264 |
if (comparison == 0) { |
|
265 |
// 4: same build also, compare object hascode as a way |
|
266 |
// to distinguish between the same package when it has |
|
267 |
// been installed and is available to install, and they |
|
268 |
// appear as two distinct objects in the |
|
269 |
// TablePackageInfo's set |
|
270 |
comparison = |
|
271 |
packageInfo1.hashCode() - packageInfo2.hashCode(); |
|
272 |
} |
|
259 | 273 |
} |
260 | 274 |
} |
261 | 275 |
|
Also available in: Unified diff