-
Notifications
You must be signed in to change notification settings - Fork 228
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
[Sunaga] iP #240
base: master
Are you sure you want to change the base?
[Sunaga] iP #240
Conversation
- added DONE and Task object
Add input and expected
Added 3 exceptions extending Duke Exception Persisting issue: blank line / space input does not give IDK exception.
Add delete aaaa / done aaaa exception handler as invalid.
…g to each DukeException child class.
…pdate task in 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.
Code is easy to read overall 👍 I have noted a few coding standard violations.
src/main/java/duke/Duke.java
Outdated
|
||
|
||
private void processInput(String userInput) { | ||
String keyword_UC = userInput.toUpperCase().split(" ", -1)[0]; |
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.
Perhaps use a camelCase variable name and a more descriptive name rather than UC
here?
src/main/java/duke/Duke.java
Outdated
import duke.exceptions.DukeMissingDesException; | ||
import duke.handler.Parser; | ||
import duke.handler.Queries; | ||
import duke.tasks.*; |
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.
Should this import statement be listed explicitly instead?
src/main/java/duke/Duke.java
Outdated
import duke.tasks.*; | ||
import duke.tasks.Event; | ||
|
||
import java.awt.*; |
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.
Same issue as above
src/main/java/duke/Storage.java
Outdated
import java.util.Scanner; | ||
|
||
public class Storage { | ||
private static String STORAGE_PATH; |
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.
Perhaps this instance variable should be declared final instead? (as your variable name is already in all uppercase letters)
src/main/java/duke/Ui.java
Outdated
} | ||
|
||
public String readCommand() { | ||
assert hasCommand(); |
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.
Like the use of assertion here 😄
@@ -0,0 +1,14 @@ | |||
package duke.exceptions; | |||
|
|||
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.
Should there be a space between Exception
and the opening bracket {
?
@@ -0,0 +1,23 @@ | |||
package duke.exceptions; | |||
|
|||
public class DukeIDKException extends DukeException{ |
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.
Should there be a space between DukeException
and the opening bracket {
?
I noticed the same issue in several other places too.
} | ||
|
||
public Task markDone() { | ||
this.isDone = true; |
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.
Perhaps you can remove the unnecessary this
here?
this.type = type; | ||
} | ||
|
||
public Task markDone() { |
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.
Should this method be named differently because markDone
does not really tell us that a task will be returned?
|
||
|
||
public TaskList() { | ||
this.tasks = new ArrayList<>(); |
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.
Perhaps remove the redundant this
here?
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.
Overall clear and well-formatted code but some parts can be further abstracted for clarity.
src/main/java/duke/Duke.java
Outdated
import java.util.Scanner; | ||
|
||
public class Duke { | ||
private boolean exit = false; |
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.
isExit
src/main/java/duke/Duke.java
Outdated
} | ||
|
||
public static void main(String[] args) throws IOException { | ||
new Duke("data/tasks.txt").run(); |
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 may want to use relative path
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.
Hi my understanding was that this already is a relative path.
What do you mean by use a "relative path"? could you suggest how this is done? Thank you.
src/main/java/duke/Duke.java
Outdated
break; | ||
|
||
case ADD: | ||
Task toAdd; |
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 may want to abstract each case into a separate method
|
||
public class Parser { | ||
public static Task parseFromData(String dataInput) { | ||
String[] splitInput = dataInput.split("\\|", -1); |
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.
splitInputs?
/** | ||
* Constructor for DukeException for incomprehensible request. | ||
*/ | ||
public DukeIDKException() { |
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.
DukeIdkException?
…ePossible method in Duke. (easy way out). Change ADD to TODO/DEADLINE/EVENT in Queries.
Add TaskHandler absrtact class.
Improve CodeQuality
# Conflicts: # src/main/java/duke/handler/DeadlineHandler.java # src/main/java/duke/handler/EventHandler.java # src/main/java/duke/handler/TodoHandler.java
Add assert to getTask method
Format requires Schedule weekly (no.of times) (schedulable event). Issue: listing does not work beyond 7 tasks when queried as after 1st query.
Add Ui.png screenshot
Change app name to remove space
No description provided.