Skip to content

Commit

Permalink
Merge pull request #59 from CSC207-2023Y-UofT/50-address-intellij-war…
Browse files Browse the repository at this point in the history
…nings

Address intellij warnings
  • Loading branch information
aricasas authored Aug 15, 2023
2 parents bae8f81 + 9d6c989 commit 620614d
Show file tree
Hide file tree
Showing 24 changed files with 63 additions and 86 deletions.
22 changes: 11 additions & 11 deletions project_plan_dev.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Project Planning and Development with Github
# Project Planning and Development with GitHub

In this course project, you are expected to use Github to manage your code. This document describes the workflow for using Github when you are developing the course project. Please read it carefully and follow the instructions. **Try to work through the steps with the help of your team first, but please ask for help if your team gets stuck on any of the steps or needs something clarified.**
In this course project, you are expected to use GitHub to manage your code. This document describes the workflow for using GitHub when you are developing the course project. Please read it carefully and follow the instructions. **Try to work through the steps with the help of your team first, but please ask for help if your team gets stuck on any of the steps or needs something clarified.**

## Create a New Github Project
[Github Projects](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects) (*Yes, the name of this product is called "Github Projects", do not confuse it with the course project*) is a lightweight project management tool that is integrated to Github. You can use it to track issues, pull requests, visualize tasks status, and track responsibilities. **TAs will mark you project implementation plan and track your progression using the Github project.**
## Create a New GitHub Project
[GitHub Projects](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects) (*Yes, the name of this product is called "GitHub Projects", do not confuse it with the course project*) is a lightweight project management tool that is integrated to GitHub. You can use it to track issues, pull requests, visualize tasks status, and track responsibilities. **TAs will mark you project implementation plan and track your progression using the GitHub project.**

1. Navigate to **Projects** Page on [CSC207 organization page](https://github.com/orgs/CSC207-2023Y-UofT/projects)

Expand All @@ -18,10 +18,10 @@ In this course project, you are expected to use Github to manage your code. This

![](images/link_project.png)

5. The project will show up in the the list below.
5. The project will show up in the list below.

## Define Your Features for the Implementation Plan
As a part of the project planning, you are required to record all features formulated from your user stories, as **issues** in your Github repository.
As a part of the project planning, you are required to record all features formulated from your user stories, as **issues** in your GitHub repository.

1. Navigate to your repository and select **Issues** tab, then click **New issue**.

Expand All @@ -30,7 +30,7 @@ As a part of the project planning, you are required to record all features formu
1. Fill in the title as the name of the feature and provide a brief description of the feature.
**Please use a consistent naming convention for your issues.** For example, you can use the following format: `[Feature x] <feature name>`

2. On the side bar, select the **Assignee**, **Labels** (Enhancement for your Features), and **Projects**(the one you just created) for the issue. Then click **Submit new issue**.
2. On the sidebar, select the **Assignee**, **Labels** (Enhancement for your Features), and **Projects**(the one you just created) for the issue. Then click **Submit new issue**.

![](images/set_tags.png)

Expand All @@ -40,7 +40,7 @@ As a part of the project planning, you are required to record all features formu
## Feature Development
When you work on a feature, you are always required to create a **branch** for the feature and **merge** the branch back to the main branch with **pull requests** when the feature is completed. Note: the below should remind you of the "workflow" we covered in the first lab this term. Please review the details of that document in addition to the below, which provides additional details about how the process works on GitHub.

1. To create a new branch, navigate to the issue you are assigned to, and click **Create branch** on the right side bar.
1. To create a new branch, navigate to the issue you are assigned to, and click **Create branch** on the right sidebar.

![](images/create_branch.png)

Expand Down Expand Up @@ -84,18 +84,18 @@ must be reviewed and approved by other team members before merging.** :warning:

6. (Optional) Delete the feature branch after the pull request is merged. You can delete the branch by navigating to the **View all branches** page.

7. (Optional) If the feature is not completed or you want to continue working on the feature, you can reopen the issue and create new pull requests. Remember to change the status of the issue to **In Progress**.
7. (Optional) If the feature is not completed, or you want to continue working on the feature, you can reopen the issue and create new pull requests. Remember to change the status of the issue to **In Progress**.


## More Project Management and Other Resoruces (Optional)
## More Project Management and Other Resources (Optional)

- Use issues to keep track of bugs, tasks and other things that need to be done by selecting the appropriate labels.

- Use milestones to group issues into a set of deliverables. To create milestones, navigate to the **Milestones** tab and click **New milestone**.

- Use Projects to tracks issues and collaborate with your team. See the [sample project (Password Manager example)](https://github.com/orgs/CSC207-2022F-UofT/projects/2) for reference.

- Github document for projects: https://docs.github.com/en/issues/planning-and-tracking-with-projects
- GitHub document for projects: https://docs.github.com/en/issues/planning-and-tracking-with-projects

- Git operations: https://docs.github.com/en/get-started/using-git

Expand Down
1 change: 1 addition & 0 deletions src/main/java/entities/MonthObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* they can be created by MonthObjectFactory classes. It contains the setName and getName methods that all MonthObject
* classes should have.
*/
@SuppressWarnings("unused") // These methods are actually used, but just on the concrete class
public interface MonthObject {

/**
Expand Down
1 change: 1 addition & 0 deletions src/main/java/entities/MonthObjectFactoryInputData.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* that each version of addMonthObject and editMonthObject in CategoryFactory and ExpenseFactory can take in a different
* set of input data objects that are child classes of MonthObjectFactoryInputData.
*/
@SuppressWarnings("unused") // These methods are actually used, but just on the concrete class
public abstract class MonthObjectFactoryInputData {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public class CategoryID {
private final String name;
private Object value;
private final Object value;
private final int monthID;

private final SessionStorage session;
Expand All @@ -33,7 +33,6 @@ public CategoryID(String name, Object value, int monthID, SessionStorage session
}
public String getName(){return name;}
public Object getValue(){return value;}
public void setValue(double value){this.value = value;}
public int getMonthID(){return monthID;}
public SessionStorage getSession(){return session;}
public String getOldCategory(){return oldCategory;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ private double toDouble(Object value) throws NumberFormatException, NullPointerE
*
* @param categoryIDAdd CategoryID required for adding a new category to designated monthID MonthlyStorage Object.
* @return CategoryOD String message indicating success/fail add attempt.
* @throws EntityException thrown when the new category input is invalid.
*/
@Override
public CategoryOD addCategoryInMonth(CategoryID categoryIDAdd) {
public CategoryOD addCategoryInMonth(CategoryID categoryIDAdd) throws EntityException {
this.month = categoryIDAdd.getSession().getMonthlyData(categoryIDAdd.getMonthID());
try {
this.month = categoryIDAdd.getSession().getMonthlyData(categoryIDAdd.getMonthID());
double valueDouble = toDouble(categoryIDAdd.getValue());

if (valueDouble < 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
*/
public class ExpenseID {
private final String name;
private Object value;

private final Object value;
private final String category;
private final boolean isRecurringExpense;
private final int monthID;
Expand Down Expand Up @@ -48,12 +47,6 @@ public ExpenseID(String name, Object value, String category, boolean isRecurring
*/
public Object getValue(){return value;}

/**
* Sets Double Expense value. (Casting occurs in ExpenseUCI)
* @param value double passed in from ExpenseUCI to cast user input into a valid Expense attribute.
*/
public void setValue(double value){this.value = value;}

/**
* Gets String Category name that this Expense belongs to (before add/edit expense occurs).
* @return String Category name associated with the Expense in this use case.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* ExpenseOD passes a String message (from ExpenseP) resulting from the success or fail add/edit Expense attempt.
*/
public class ExpenseOD {
String message;
private final String message;

/**
* Constructs ExpenseOD by passing a String context-specific message generated in ExpenseUCI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ public static double toDouble(Object value) throws NumberFormatException {
*
* @param expenseIDAdd ExpenseID required for adding a new expense to the designated monthID MonthlyStorage Object.
* @return ExpenseOD String message indicating success/fail add attempt.
* @throws EntityException thrown when the new expense input is invalid.
*/
@Override
public ExpenseOD addExpenseInMonth(ExpenseID expenseIDAdd) {
public ExpenseOD addExpenseInMonth(ExpenseID expenseIDAdd) throws EntityException {
SessionStorage session = expenseIDAdd.getSession();
this.month = session.getMonthlyData(expenseIDAdd.getMonthID());
try {
SessionStorage session = expenseIDAdd.getSession();
this.month = session.getMonthlyData(expenseIDAdd.getMonthID());
double valueDouble = toDouble(expenseIDAdd.getValue());

if (valueDouble < 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/use_cases/create_new_month/NewMonthUCI.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public NewMonthOD createOutput(NewMonthID input) {
* @param monthID the monthID of the new MonthlyStorage
* @param budgetValue the budget for the new MonthlyStorage
* @return new MonthlyStorage object
* @throws EntityException if an error in the program causes two Expenese in recurData to have the same name
* @throws EntityException if an error in the program causes two Expense in recurData to have the same name
*/
private MonthlyStorage createNewMonth(SessionStorage session, int monthID, double budgetValue) throws EntityException {
ArrayList<Expense> recurData= session.getRecurData();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/use_cases/monthly_menu/MonthMenuOD.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class MonthMenuOD {
private ArrayList<Category> categoryData;
private double monthlyBudget;
private String warning;
boolean successful;
private final boolean successful;

/**
* Constructs an MonthMenuOD holding output data.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/use_cases/session_load/SessionLoadIB.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* The input boundary interface for loading sessions
* The SessionLoadUCI interactor class implements this interface and it is called by
* The SessionLoadUCI interactor class implements this interface, and it is called by
* the SessionLoadC controller class
*/
public interface SessionLoadIB {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/use_cases/session_load/SessionLoadOB.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/**
* The output boundary interface for displaying the result of loading a session
* The SessionLoadP presenter class implements this interface and it is called by
* The SessionLoadP presenter class implements this interface, and it is called by
* the SessionLoadUCI interactor class
*/
public interface SessionLoadOB {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/views/add_edit_category_views/AddCategoryV.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void openAddCategory() {
}

/**
* Checks and formats user input to pass in valid parameters for a CategtoryC to start a use case.
* Checks and formats user input to pass in valid parameters for a CategoryC to start a use case.
*/
@Override
public void actionPerformed(ActionEvent evt) {
Expand Down Expand Up @@ -115,7 +115,7 @@ private void tryUseCaseAdd() {
monthID, currSession, oldCategory);
frame.setVisible(false);
// Update Month Menu
loadMonthMenu(currSession, monthID, null);
((LoadMonthMenuVB) this).loadMonthMenu(currSession, monthID, null);
} catch (EntityException e) {
JOptionPane.showMessageDialog(this,
"This month does not exist in current session. Please go to add month page.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void openEditCategory() {
}

/**
* Checks and formats user input to pass in valid parameters for a CategtoryC to start a use case.
* Checks and formats user input to pass in valid parameters for a CategoryC to start a use case.
*/
@Override
public void actionPerformed(ActionEvent evt) {
Expand Down Expand Up @@ -128,7 +128,7 @@ private void tryUseCaseEdit() {
currSession, selectedCategory);
frame.setVisible(false);
// Update Month Menu
loadMonthMenu(currSession, monthID, null);
((LoadMonthMenuVB) this).loadMonthMenu(currSession, monthID, null);
} catch (EntityException e) {
JOptionPane.showMessageDialog(this, "This month does not exist in current session. " +
"Please go to add month page.");
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/views/add_edit_epense_views/AddExpenseV.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public void openAddExpense() {
JPanel panel = new JPanel();
panel.setBorder(BorderFactory.createEmptyBorder(50, 30, 50, 30));
panel.setLayout(new GridLayout(0, 1));
JPanel panell = new JPanel();
panell.setBorder(BorderFactory.createEmptyBorder(50, 30, 50, 30));
panell.setLayout(new GridLayout(0, 1));
JPanel panel2 = new JPanel();
panel2.setBorder(BorderFactory.createEmptyBorder(50, 30, 50, 30));
panel2.setLayout(new GridLayout(0, 1));

frame.add(panel, BorderLayout.CENTER);
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
Expand All @@ -79,8 +79,8 @@ public void openAddExpense() {
panel.add(selectCategoryLabel);
panel.add(categoryCombo);
panel.add(isRecurringCheckBox);
frame.add(panell, BorderLayout.SOUTH);
panell.add(submit);
frame.add(panel2, BorderLayout.SOUTH);
panel2.add(submit);

frame.pack();
frame.setVisible(true);
Expand All @@ -101,7 +101,7 @@ public void actionPerformed(ActionEvent evt) {
try {
message = controller.expenseInMonth(nameInput.getText(), valueInput.getText(), selectedCategory, isRecurring, monthID, currSession, selectedExpense);
frame.setVisible(false);
loadMonthMenu(currSession, monthID, null);
((LoadMonthMenuVB) this).loadMonthMenu(currSession, monthID, null);
} catch (EntityException e) {
JOptionPane.showMessageDialog(this, "This month does not exist in current session. Please go to add month page.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void actionPerformed(ActionEvent evt) {
isRecurring, monthID, currSession, selectedExpense);
frame.setVisible(false);
// Update Month Menu
loadMonthMenu(currSession, monthID, null);
((LoadMonthMenuVB) this).loadMonthMenu(currSession, monthID, null);
} catch (EntityException e) {
JOptionPane.showMessageDialog(this, "This month does not exist in current " +
"session. Please go to add month page.");
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/views/create_new_month/NewMonthV.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import use_cases.monthly_menu.UpdateViewIB;
import use_cases.monthly_menu.UpdateViewUCI;
import views.load_monthly_menu.LoadMonthMenuVB;
import views.main_menu.MainMenuV;
import views.monthly_menu.MonthMenuP;
import views.monthly_menu.MonthMenuV;
import views.monthly_menu.UpdateViewC;
import views.session_load.SessionLoadMainMenuVB;

import javax.swing.*;
import java.awt.*;
Expand All @@ -23,7 +23,7 @@
* NewMonthOD object, and use the output to set up success and fail view.
*/
public class NewMonthV implements ActionListener, LoadMonthMenuVB {
private final MainMenuV mainMenu;
private final SessionLoadMainMenuVB mainMenu;
private final NewMonthC controller;
private final SessionStorage session;
private final JFrame frame = new JFrame("Creat a new Month");
Expand All @@ -43,7 +43,7 @@ public class NewMonthV implements ActionListener, LoadMonthMenuVB {
* @param controller the controller class to get output data
* @param session the SessionStorage to store the new MonthlyStorage
*/
public NewMonthV (MainMenuV mainMenu, NewMonthC controller, SessionStorage session){
public NewMonthV (SessionLoadMainMenuVB mainMenu, NewMonthC controller, SessionStorage session){
this.mainMenu = mainMenu;
this.controller = controller;
this.session = session;
Expand Down Expand Up @@ -146,7 +146,7 @@ private void getOutput(){
// Update Main Menu dropdown list of Months
mainMenu.openMainMenu(null,session);
// Load new Month Menu for the new MonthlyStorage
loadMonthMenu(session,monthID,"Month created successfully.");
((LoadMonthMenuVB) this).loadMonthMenu(session,monthID,"Month created successfully.");
} else {
JOptionPane.showMessageDialog(frame, output.getWarning());
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/views/main_menu/MainMenuV.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void actionPerformed(ActionEvent e) {
}
} else if (e.getSource() == this.selectMonthButton) {
// Open a new MonthMenuV to display the selected month
this.loadMonthMenu(this.session, this.selectedMonthID, null);
((LoadMonthMenuVB) this).loadMonthMenu(this.session, this.selectedMonthID, null);
} else if (e.getSource() == this.createMonthButton) {
// Open a new NewMonthV so user can create their new month
NewMonthC newMonthController = new NewMonthC(new NewMonthUCI(new NewMonthP()));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/views/session_load/SessionLoadC.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/**
* The controller class for the session load menu.
* It is called by the view with the user input and it calls the interactor
* It is called by the view with the user input, and it calls the interactor
* through the SessionLoadIB interface
*/
public class SessionLoadC {
Expand Down
Loading

0 comments on commit 620614d

Please sign in to comment.