From fab0186cbe7973a73e67b4219a93e656c34ed805 Mon Sep 17 00:00:00 2001 From: artdeell Date: Wed, 5 Feb 2025 22:48:03 +0300 Subject: [PATCH] Style[bta_profile]: add clarifying comments --- .../main/java/net/kdt/pojavlaunch/modloaders/BTAUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/modloaders/BTAUtils.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/modloaders/BTAUtils.java index ac5bea545..764009464 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/modloaders/BTAUtils.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/modloaders/BTAUtils.java @@ -54,6 +54,9 @@ public class BTAUtils { private static List createVersionList(List versionStrings, String buildType) { ListIterator iterator = versionStrings.listIterator(versionStrings.size()); ArrayList btaVersions = new ArrayList<>(versionStrings.size()); + // The original list is guaranteed to be in ascending order - the earliest versions + // are at the top, but for user convenience we need to put the newest versions at the top, + // so the BTAVersion list is made from the reverse of the string list. while(iterator.hasPrevious()) { String version = iterator.previous(); if(version == null) continue; @@ -79,6 +82,8 @@ public class BTAUtils { List untestedVersions = new ArrayList<>(); for(String version : stringVersions) { if(version == null) break; + // Checking for presence in testing array here to avoid accidentally adding nonexistent + // versions if some of them end up getting removed. if(BTA_TESTED_VERSIONS.contains(version)) { testedVersions.add(version); }else {