cs2103jan2015-w09-4j / main

CS2103 project of team w09-4j
3 stars 0 forks source link

updateTaskMap does not perform as expected #82

Closed eric-vader closed 9 years ago

eric-vader commented 9 years ago

From what was understood on code, updateTaskMap is supposed to be updating the task map. However, it was called in add(task) to insert to task map. The code fails to add a new entry to the HashMap.

From the Java API Docs:

Open DeclarationTask java.util.HashMap.replace(String key, Task value)

Replaces the entry for the specified key only if it is currently mapped to some value.

Specified by: replace(...) in Map
Parameters:
key key with which the specified value is associated
value value to be associated with the specified key
Returns:
the previous value associated with the specified key, or null if there was no mapping for the key. (A null return can also indicate that the map previously associated null with the key, if the implementation supports null values.)

It will not add to the taskmap.