<code>Task::getName()</code> is not reliable due to Folders, etc. 
You should use Task::getDisplayName() as it has been mentioned in Javadoc