From a5c3599d7bc7a9ef5583ad2d50a55975f030fbea Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 29 Apr 2025 06:03:56 +0200 Subject: declare variables final when possible --- .../com/example/portfolio2/Controller.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/com.example.portfolio2/com/example/portfolio2/Controller.java') diff --git a/src/com.example.portfolio2/com/example/portfolio2/Controller.java b/src/com.example.portfolio2/com/example/portfolio2/Controller.java index 2457e25..a948809 100644 --- a/src/com.example.portfolio2/com/example/portfolio2/Controller.java +++ b/src/com.example.portfolio2/com/example/portfolio2/Controller.java @@ -29,7 +29,7 @@ class Controller{ /// /// @param store Storage model /// @param view Application view - Controller(Database store, Window view){ + Controller(final Database store, final Window view){ this.store = store; this.view = view; } @@ -38,7 +38,7 @@ class Controller{ /// @param combo involved activity box /// @param select selected item /// @param area whole text area - void onComboSelected(ComboBox combo, ComboBox select, TextArea area) { + void onComboSelected(final ComboBox combo, final ComboBox select, final TextArea area) { // clear the activity selection box select.getItems().clear(); @@ -55,7 +55,7 @@ class Controller{ /// @param combo involved activity box /// @param select selected item /// @param area whole text area - void onActivitySelected(ComboBox combo, ComboBox select, TextArea area) { + void onActivitySelected(final ComboBox combo, final ComboBox select, final TextArea area) { // pass the value chosen in the box addActivity(select.getValue(), area); @@ -71,7 +71,7 @@ class Controller{ /// @param subject1 involved 1st column subject module box /// @param subject2 involved 2nd column subject module box /// @param subjectModules list of selected subject modules - void onSubjectModuleSelected(ComboBox subject1, ComboBox subject2, List subjectModules) { + void onSubjectModuleSelected(final ComboBox subject1, final ComboBox subject2, final List subjectModules) { // Beautiful loop we've created to remove option chosen in one subject module box from the other for (String sub : subjectModules) { @@ -86,7 +86,7 @@ class Controller{ /// add participation to database /// @param s activity identifier /// @param textArea whole text area - void addActivity(String s, TextArea textArea) { + void addActivity(final String s, final TextArea textArea) { store.addParticipation(store.getActivityIndeks(s)); } @@ -97,7 +97,7 @@ class Controller{ /// /// @param combo involved activity box /// @param textArea whole text area - void updateArea(ComboBox combo, TextArea textArea) { + void updateArea(final ComboBox combo, final TextArea textArea) { textArea.clear(); for(String s : store.getParticipation(combo.getValue())) { textArea.appendText(s + "\n"); @@ -107,11 +107,11 @@ class Controller{ /// update label with current ECTS of program type /// @param ectslabel text display area for ECTS points /// @param comboBox involved activity box - void updateEcts(Label ectslabel, ComboBox comboBox) { + void updateEcts(final Label ectslabel, final ComboBox comboBox) { ectslabel.setText("ECTS: "+store.getSumEcts(comboBox.getValue())); } - void fillElective(ComboBox electiveBox) { + void fillElective(final ComboBox electiveBox) { electiveBox.getItems().addAll(store.getAllActivities()); } } -- cgit v1.2.3