-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Jade Tay] Duke Increments #142
base: master
Are you sure you want to change the base?
Conversation
Add toolVersion block in to Gradle code sample to prevent errors.
Change file mode on `gradle` to be executable (nus-cs2103-AY1920S2#9)
Gradle defaults to an empty stdin which results in runtime exceptions when attempting to read from `System.in`. Let's add some sensible defaults for students who may still need to work with the standard input stream.
Add configuration for console applications
The OpenJFX plugin expects applications to be modular and bundled with jlink, resulting in fat jars that are not cross-platform. Let's manually include the required dependencies so that shadow can package them properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally pretty clear code, with almost all methods having Javadoc comments! Great!!
I have left some comments below for further discussion, especially about the DukeException
class. Hope you find them useful! Do reply if you have any concerns about them
setAlignment(Pos.TOP_LEFT); | ||
} | ||
|
||
public static DialogBox getUserDialog(String text, Image img) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a good idea to have Javadoc comments here, for a public method
return new DialogBox(text, img); | ||
} | ||
|
||
public static DialogBox getDukeDialog(String text, Image img) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well, would it be clearer if we put a Javadoc comment here? Seems more useful than the existing comment for the private flip method
/** | ||
* Creates a new Exception when thrown. | ||
*/ | ||
public class DukeException extends Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, the name DukeException seems quite ambiguous. Granted, it seems like all Exception files in Duke extend from DukeException. Interesting way to structure the Exceptions, but I'm not sure of the difference if each individual Exception extended directly from Exception instead
/** | ||
* This class contains the task list. | ||
*/ | ||
public class TaskList { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel that this class does not do much that an ArrayList<Task>
cannot do, so I was wondering whether this class serves any other purpose that I might have missed?
/** | ||
* Constructor for AddCommand. | ||
* | ||
* @param t t is the Task to be added into TaskList. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can have a better variable naming as well as a more intuitive javadoc
storage.saveTasks(tasks.getTasks()); | ||
String msg = "Got it! I've added this task!: \n"; | ||
msg += " " + this.task; | ||
msg += "\nNow you have " + tasks.getNumTasks() + " tasks in the list."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can apply SLAP here. You can abstract out the string concatenation
A-Assertions
A-CodeQuality 3.0
Functionalities added: