Skip to content

Commit

Permalink
Reduce JRE to 17
Browse files Browse the repository at this point in the history
Closes #9
  • Loading branch information
skycatminepokie committed Dec 20, 2024
1 parent 64b6e01 commit 1f82da3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/skycatdev/binarysearchtool/CliUi.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void onBisectFinished() {
public void onFinished(ArrayList<Mod> problematicMods) {
assert searchHandler != null : "searchHandler should be the one calling, why is it null?";
if (problematicMods.size() == 1) {
System.out.printf("Finished! The problematic mod was: %s (%s)%n", problematicMods.getFirst().name(), problematicMods.getFirst().filename());
System.out.printf("Finished! The problematic mod was: %s (%s)%n", problematicMods.get(0).name(), problematicMods.get(0).filename());
} else {
System.out.println("Finished! The following mods rely on each other, and one is the problem:");
for (Mod problematicMod : problematicMods) {
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/skycatdev/binarysearchtool/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import javax.swing.*;
import java.io.File;
import java.nio.file.NotDirectoryException;
import java.nio.file.Path;

public class Main {
Expand Down Expand Up @@ -46,14 +45,14 @@ private static void startUi(boolean useGui, Path modsPath) {
SearchGui gui = new SearchGui();
SearchHandler.createWithUi(modsPath, gui);
gui.setVisible(true);
} catch (NotDirectoryException | IllegalArgumentException e) {
} catch (IllegalArgumentException e) {
throw new RuntimeException("The directory should've been validated by now.", e);
}
});
} else {
try {
SearchHandler.createWithUi(modsPath, new CliUi());
} catch (NotDirectoryException | IllegalArgumentException e) {
} catch (IllegalArgumentException e) {
throw new RuntimeException("The directory should've been validated by now.", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public void onFinished(ArrayList<Mod> problematicMods) {
failureButton.setEnabled(false);
successButton.setEnabled(false);
if (problematicMods.size() == 1) {
JOptionPane.showMessageDialog(this, "Finished! The problematic mod is " + problematicMods.getFirst().name() + ".");
JOptionPane.showMessageDialog(this, "Finished! The problematic mod is " + problematicMods.get(0).name() + ".");
} else {
StringBuilder message = new StringBuilder("Finished! The problem is one of these mods, which all rely on each other:");
for (Mod problematicMod : problematicMods) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static SearchHandler createWithUi(Path inputPath, SearchUi ui) throws Ill

private static <T> void rotateList(ArrayList<T> list, int rotation) {
for (int i = 0; i < rotation; i++) {
list.addLast(list.removeFirst());
list.add(list.remove(0));
}
}

Expand Down Expand Up @@ -202,7 +202,7 @@ public void bisect(boolean lastSuccessful) {
int candidatesSize = candidateMods.size();
while (testingMods.size() < candidatesSize / 2) {
// Add the mod to the testing set, remove it from the candidate set
Mod mod = candidateMods.removeFirst();
Mod mod = candidateMods.remove(0);
testingMods.add(mod);
Main.log("Added mod " + mod.name());
addDeps(mod);
Expand Down

0 comments on commit 1f82da3

Please sign in to comment.