Changeset 1200


Ignore:
Timestamp:
04/30/13 17:44:18 (12 years ago)
Author:
adeicke
Message:

Avoid double entries in complete filter result.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/tasktree/FilterResult.java

    r1162 r1200  
    4545    @SuppressWarnings("unchecked") 
    4646    public void addTask(ITask task) { 
    47         if (filterPredicate.apply(task) && !filteredTasks.contains(task)) { 
    48             filteredTasks.add(task); 
    49         } 
    50         else { 
    51             tasksNotMatchedFilter.add(task); 
    52         } 
     47        boolean notFilteredYet = !filteredTasks.contains(task) && !tasksNotMatchedFilter.contains(task); 
     48        if(notFilteredYet) { 
     49                if (filterPredicate.apply(task)) { 
     50                    filteredTasks.add(task); 
     51                } 
     52                else { 
     53                    tasksNotMatchedFilter.add(task); 
     54                } 
     55        } 
    5356    } 
    5457 
Note: See TracChangeset for help on using the changeset viewer.