Skip to content

Commit

Permalink
Final bug fixes
Browse files Browse the repository at this point in the history
- Separated the runner method to the main method to prevent the console window from closing when encountering a fatal error.
- Added comments in the Main class to components which were missing comments.
- Added code to keep the console window up even when the program is finished.
- Closed the scanner.
  • Loading branch information
daylamtayari committed Feb 5, 2021
1 parent 25723fb commit c72ad09
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions src/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,31 @@
import java.util.Scanner;

public class Main {
protected static List<List<String>> contents;
protected static String token;
protected static List<List<String>> contents; //2D list which contains all of the contents.
protected static String token; //String value representing the user's token.

public static void main(String[] args) {
/**
* Main method thar runs the program.
* @param args
*/
public static void main(String[] args){
runner();
//Keep the console window open after completion.
new Thread(new Runnable() {
@Override
public synchronized void run() {
for(;;)
try {
wait();
} catch (InterruptedException e) {}
}
}).run();
}

/**
* The runner method of the program.
*/
public static void runner() {
Scanner sc=new Scanner(System.in);
System.out.print(
"\nWelcome to Microsoft To Do export."
Expand Down Expand Up @@ -91,5 +112,6 @@ else if(selection==2){
+ "\n\nIf you find this tool useful, please consider helping to support me financially:"
+ "\nhttps://paypal.me/daylamtayari https://cash.app/$daylamtayari BTC: 15KcKrsqW6DQdyZPrgRXXmsKkyyZzHAQVX"
);
sc.close();
}
}

0 comments on commit c72ad09

Please sign in to comment.