Skip to content

Commit 01c657b

Browse files
[Fix] Platforms Path Order Mismatch
1 parent 9640ba2 commit 01c657b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

mode/tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ public Channel getChannel() {
262262
}
263263
}
264264

265-
Collections.sort(platformList,comparator);
265+
Collections.sort(platformList,comparePlatformInfo);
266+
Collections.sort(platformPathsList,comparePlatformPath);
266267
return null;
267268
}
268269

@@ -302,7 +303,7 @@ private Boolean isPlatform(String path){
302303
return false;
303304
}
304305

305-
Comparator<Vector> comparator = new Comparator<Vector>() {
306+
Comparator<Vector> comparePlatformInfo = new Comparator<Vector>() {
306307
@Override
307308
public int compare(Vector o1, Vector o2) {
308309
String name1 = (String) o1.get(1);
@@ -312,6 +313,15 @@ public int compare(Vector o1, Vector o2) {
312313
return version2 - version1;
313314
}
314315
};
316+
317+
Comparator<String> comparePlatformPath = new Comparator<String>() {
318+
@Override
319+
public int compare(String o1, String o2) {
320+
int version1 = Integer.parseInt(o1.substring(o1.indexOf("-")+1));
321+
int version2 = Integer.parseInt(o2.substring(o2.indexOf("-")+1));
322+
return version2 - version1;
323+
}
324+
};
315325
}
316326

317327
class DownloadTask extends SwingWorker<Object, Object> {

0 commit comments

Comments
 (0)