Updated DetectionTask.java: added Javadoc and inline comments.