From ae02cf0b08b91f3b2057d9e97bd05ceb7575bb27 Mon Sep 17 00:00:00 2001 From: Thanasis S <8089997+MrThanasiz@users.noreply.github.com> Date: Wed, 12 Jun 2019 21:46:48 +0300 Subject: [PATCH 1/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 59d4161..c44b85b 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,8 @@ For the versions available, see the [tags on this repository](https://github.com ## Authors -* **Athanasios Stefanidis** - *InputDataFrame / Score / Tips / UniversitySelectFrame* - [MrThanasiz](https://github.com/MrThanasiz/) -* **Konstantinos Petridis** - *LogRegCheck / Secretariat / SecretariatFrame* - [Romputer](https://github.com/Romputer) +* **Athanasios Stefanidis** - *InputDataFrame / Score / Tips / UniversitySelectFrame / ValidationCheck* - [MrThanasiz](https://github.com/MrThanasiz/) +* **Konstantinos Petridis** - *LogRegCheck / Secretariat / SecretariatFrame / Student* - [Romputer](https://github.com/Romputer) * **Stamatis Sellas** - *Department / MainFrame / University* - [Novvator](https://github.com/Novvator) * **Stefanos Fokianos** - *CentralRegistry / CreateFile / HomeFrame / RegisterFrame* - [Stef-Fokianos](https://github.com/Stef-fokianos) From c7f45730b9a1bba44b329c80c57ad49635626ace Mon Sep 17 00:00:00 2001 From: Thanasis S <8089997+MrThanasiz@users.noreply.github.com> Date: Wed, 12 Jun 2019 21:48:15 +0300 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c44b85b..b68963c 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Please contact [MrThanasiz](https://github.com/MrThanasiz)/[Novvator](https://gi ## Versioning -For the versions available, see the [tags on this repository](https://github.com/your/project/tags). +For the versions available, check the [Releases tab on the repository](https://github.com/MrThanasiz/UoM-Erasmus-Helper/releases). ## Authors From 817a6c2925279ab471ac960730e6c00c1285a7e7 Mon Sep 17 00:00:00 2001 From: Romputer Date: Wed, 12 Jun 2019 22:02:52 +0300 Subject: [PATCH 3/3] Minor changes --- src/CentralRegistry.java | 56 +++++++++++++++++++--------------------- src/LogRegCheck.java | 2 +- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/src/CentralRegistry.java b/src/CentralRegistry.java index 8710293..acbff3e 100644 --- a/src/CentralRegistry.java +++ b/src/CentralRegistry.java @@ -8,7 +8,7 @@ public class CentralRegistry private static ArrayList students; - public static boolean initializedList = false; + private static boolean initializedList = false; @SuppressWarnings("unchecked") @@ -41,6 +41,28 @@ public static void desirializeUsers(){ c.printStackTrace(); } } + + public static void serializeUsers() { + + String filename = "student.ser"; + + // Serialization + try{ + //Saving of student in a file + FileOutputStream file = new FileOutputStream(filename); + ObjectOutputStream out = new ObjectOutputStream(file); + + // Method for serialization of Student s + out.writeObject(students); + + out.close(); + file.close(); + + // System.out.println("Serialization worked"); + }catch(IOException ex) { + System.out.println("IOException is caught"); + } + } public static Student registerNewUser() { @@ -53,34 +75,6 @@ public static Student registerNewUser() { return s.get(s.indexOf(stud)); } - - - - public static void serializeUsers() { - - String filename = "student.ser"; - - // Serialization - try{ - //Saving of student in a file - FileOutputStream file = new FileOutputStream(filename); - ObjectOutputStream out = new ObjectOutputStream(file); - - // Method for serialization of Student s - out.writeObject(students); - - out.close(); - file.close(); - - // System.out.println("Serialization worked"); - }catch(IOException ex) { - - System.out.println("IOException is caught"); - } - - - - } public static ArrayList getStudents(){ @@ -158,6 +152,10 @@ public static ArrayList getDepartments(){ return departmentsList; } + public static boolean initializedList() { + return initializedList; + } + public static void assignStudsToDeps() { for(Student student: students) { for(int i = 0; i < departmentsList.size(); i++) diff --git a/src/LogRegCheck.java b/src/LogRegCheck.java index a266f2e..fd94b80 100644 --- a/src/LogRegCheck.java +++ b/src/LogRegCheck.java @@ -3,7 +3,7 @@ public class LogRegCheck { public static Student checkUsername(String aUsername) { //We need a initializedList variable in Central Registry - if ( !CentralRegistry.initializedList ) + if ( !CentralRegistry.initializedList() ) return null; for(Student student: CentralRegistry.getStudents())