Changeset 1190 for trunk


Ignore:
Timestamp:
04/29/13 16:43:17 (12 years ago)
Author:
pharms
Message:
  • remove a find bugs warning
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/IterationComparisonRuleTest.java

    r1146 r1190  
    2424import de.ugoe.cs.autoquest.tasktrees.taskequality.IterationComparisonRule; 
    2525import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
    26 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager; 
    2726import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 
    2827import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 
     
    4443    @Test 
    4544    public void test() { 
    46         TaskEqualityRuleManager manager = new TaskEqualityRuleManager(); 
    47         manager.init(); 
    48          
    4945        ITaskFactory taskFactory = new TaskFactory(); 
    5046        ITaskBuilder treeBuilder = new TaskBuilder(); 
    5147         
    52         IterationComparisonRule rule = new IterationComparisonRule(manager); 
     48        IterationComparisonRule rule = new IterationComparisonRule(); 
    5349         
    5450        IEventType eventType1 = new StringEventType("eventType1"); 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SelectionComparisonRuleTest.java

    r1146 r1190  
    2424import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
    2525import de.ugoe.cs.autoquest.tasktrees.taskequality.SelectionComparisonRule; 
    26 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager; 
    2726import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 
    2827import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
     
    4443    @Test 
    4544    public void test() { 
    46         TaskEqualityRuleManager manager = new TaskEqualityRuleManager(); 
    47         manager.init(); 
    48          
    4945        ITaskFactory taskFactory = new TaskFactory(); 
    5046        ITaskBuilder treeBuilder = new TaskBuilder(); 
    5147         
    52         SelectionComparisonRule rule = new SelectionComparisonRule(manager); 
     48        SelectionComparisonRule rule = new SelectionComparisonRule(); 
    5349         
    5450        IEventType eventType1 = new StringEventType("eventType1"); 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SequenceComparisonRuleTest.java

    r1146 r1190  
    2424import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
    2525import de.ugoe.cs.autoquest.tasktrees.taskequality.SequenceComparisonRule; 
    26 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager; 
    2726import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 
    2827import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 
     
    4443    @Test 
    4544    public void test() { 
    46         TaskEqualityRuleManager manager = new TaskEqualityRuleManager(); 
    47         manager.init(); 
    48          
    4945        ITaskFactory taskFactory = new TaskFactory(); 
    5046        ITaskBuilder treeBuilder = new TaskBuilder(); 
    5147         
    52         SequenceComparisonRule rule = new SequenceComparisonRule(manager); 
     48        SequenceComparisonRule rule = new SequenceComparisonRule(); 
    5349         
    5450        IEventType eventType1 = new StringEventType("eventType1"); 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndIterationComparisonRuleTest.java

    r1146 r1190  
    2424import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskAndIterationComparisonRule; 
    2525import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
    26 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager; 
    2726import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 
    2827import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 
     
    4443    @Test 
    4544    public void test() { 
    46         TaskEqualityRuleManager manager = new TaskEqualityRuleManager(); 
    47         manager.init(); 
    48          
    4945        ITaskFactory taskFactory = new TaskFactory(); 
    5046        ITaskBuilder treeBuilder = new TaskBuilder(); 
    5147         
    52         TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(manager); 
     48        TaskAndIterationComparisonRule rule = new TaskAndIterationComparisonRule(); 
    5349         
    5450        IEventType eventType1 = new StringEventType("eventType1"); 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndSelectionComparisonRuleTest.java

    r1146 r1190  
    2424import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskAndSelectionComparisonRule; 
    2525import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
    26 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager; 
    2726import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 
    2827import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder; 
     
    4342    @Test 
    4443    public void test() { 
    45         TaskEqualityRuleManager manager = new TaskEqualityRuleManager(); 
    46         manager.init(); 
    47          
    4844        ITaskFactory taskFactory = new TaskFactory(); 
    4945        ITaskBuilder treeBuilder = new TaskBuilder(); 
    5046         
    51         TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(manager); 
     47        TaskAndSelectionComparisonRule rule = new TaskAndSelectionComparisonRule(); 
    5248         
    5349        IEventType eventType1 = new StringEventType("eventType1"); 
  • trunk/autoquest-core-tasktrees-test/src/test/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/AbstractTemporalRelationshipTC.java

    r1146 r1190  
    3333import de.ugoe.cs.autoquest.tasktrees.TaskTreeValidator; 
    3434import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 
    35 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager; 
    36 import de.ugoe.cs.autoquest.tasktrees.testutils.Utilities; 
    3735import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstanceList; 
    3836import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder; 
     
    6260    private TaskTreeEncoder encoder = new TaskTreeEncoder(); 
    6361     
    64     /** */ 
    65     private TaskEqualityRuleManager taskEqualityRuleManager = 
    66         Utilities.getTaskEqualityRuleManagerForTests(); 
    67  
    6862    /** 
    6963     * 
     
    9791                    parameters.add(taskBuilder); 
    9892                } 
    99                 else if (TaskEqualityRuleManager.class.equals(type)) { 
    100                     parameters.add(taskEqualityRuleManager); 
    101                 } 
    10293                else if (TaskEquality.class.equals(type)) { 
    10394                    parameters.add(TaskEquality.LEXICALLY_EQUAL); 
     
    192183                    parameters.add(taskBuilder); 
    193184                } 
    194                 else if (TaskEqualityRuleManager.class.equals(type)) { 
    195                     parameters.add(taskEqualityRuleManager); 
    196                 } 
    197185                else if (TaskEquality.class.equals(type)) { 
    198186                    parameters.add(TaskEquality.LEXICALLY_EQUAL); 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/IterationComparisonRule.java

    r1154 r1190  
    8181public class IterationComparisonRule implements TaskComparisonRule { 
    8282     
    83     /** the rule manager for internally comparing tasks */ 
    84     private TaskEqualityRuleManager mRuleManager; 
    85  
    86     /** 
    87      * <p> 
    88      * simple constructor to provide the rule with the task equality rule manager to be able 
    89      * to perform comparisons of the children of provided tasks 
    90      * </p> 
    91      *  
    92      * @param ruleManager the rule manager for comparing tasks 
    93      */ 
    94     IterationComparisonRule(TaskEqualityRuleManager ruleManager) { 
    95         super(); 
    96         mRuleManager = ruleManager; 
    97     } 
    98  
    9983    /* (non-Javadoc) 
    10084     * @see NodeComparisonRule#isApplicable(ITask, ITask) 
     
    319303    { 
    320304        if (requiredEqualityLevel == null) { 
    321             return mRuleManager.compare(child1, child2); 
    322         } 
    323         else if (mRuleManager.areAtLeastEqual(child1, child2, requiredEqualityLevel)) { 
     305            return TaskEqualityRuleManager.getInstance().compare(child1, child2); 
     306        } 
     307        else if (TaskEqualityRuleManager.getInstance().areAtLeastEqual 
     308                    (child1, child2, requiredEqualityLevel)) 
     309        { 
    324310            return requiredEqualityLevel; 
    325311        } 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SelectionComparisonRule.java

    r1154 r1190  
    3737 */ 
    3838public class SelectionComparisonRule implements TaskComparisonRule { 
    39  
    40     /** the rule manager for internally comparing tasks */ 
    41     private TaskEqualityRuleManager mRuleManager; 
    42  
    43     /** 
    44      * <p> 
    45      * simple constructor to provide the rule with the task equality rule manager to be able 
    46      * to perform comparisons of the children of provided tasks 
    47      * </p> 
    48      *  
    49      * @param ruleManager the rule manager for comparing tasks 
    50      */ 
    51     SelectionComparisonRule(TaskEqualityRuleManager ruleManager) { 
    52         super(); 
    53         mRuleManager = ruleManager; 
    54     } 
    5539 
    5640    /* (non-Javadoc) 
     
    263247    { 
    264248        if (requiredEqualityLevel == null) { 
    265             return mRuleManager.compare(child1, child2); 
    266         } 
    267         else if (mRuleManager.areAtLeastEqual(child1, child2, requiredEqualityLevel)) { 
     249            return TaskEqualityRuleManager.getInstance().compare(child1, child2); 
     250        } 
     251        else if (TaskEqualityRuleManager.getInstance().areAtLeastEqual 
     252                     (child1, child2, requiredEqualityLevel)) 
     253        { 
    268254            return requiredEqualityLevel; 
    269255        } 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/SequenceComparisonRule.java

    r1154 r1190  
    3232 */ 
    3333public class SequenceComparisonRule implements TaskComparisonRule { 
    34  
    35     /** the rule manager for internally comparing tasks */ 
    36     private TaskEqualityRuleManager mRuleManager; 
    37  
    38     /** 
    39      * <p> 
    40      * simple constructor to provide the rule with the task equality rule manager to be able 
    41      * to perform comparisons of the children of provided tasks 
    42      * </p> 
    43      *  
    44      * @param ruleManager the rule manager for comparing tasks 
    45      */ 
    46     SequenceComparisonRule(TaskEqualityRuleManager ruleManager) { 
    47         super(); 
    48         mRuleManager = ruleManager; 
    49     } 
    5034 
    5135    /* (non-Javadoc) 
     
    154138    { 
    155139        if (requiredEqualityLevel == null) { 
    156             return mRuleManager.compare(child1, child2); 
     140            return TaskEqualityRuleManager.getInstance().compare(child1, child2); 
    157141        } 
    158         else if (mRuleManager.areAtLeastEqual(child1, child2, requiredEqualityLevel)) { 
     142        else if (TaskEqualityRuleManager.getInstance().areAtLeastEqual 
     143                    (child1, child2, requiredEqualityLevel)) 
     144        { 
    159145            return requiredEqualityLevel; 
    160146        } 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndIterationComparisonRule.java

    r1154 r1190  
    3232public class TaskAndIterationComparisonRule implements TaskComparisonRule { 
    3333     
    34     /** the rule manager for internally comparing tasks */ 
    35     private TaskEqualityRuleManager mRuleManager; 
    36  
    37     /** 
    38      * <p> 
    39      * simple constructor to provide the rule with the task equality rule manager to be able 
    40      * to perform comparisons of the children of provided tasks 
    41      * </p> 
    42      *  
    43      * @param ruleManager the rule manager for comparing tasks 
    44      */ 
    45     TaskAndIterationComparisonRule(TaskEqualityRuleManager ruleManager) { 
    46         super(); 
    47         mRuleManager = ruleManager; 
    48     } 
    49  
    5034    /* (non-Javadoc) 
    5135     * @see NodeComparisonRule#isApplicable(ITask, ITask) 
     
    172156    { 
    173157        if (requiredEqualityLevel == null) { 
    174             return mRuleManager.compare(child1, child2); 
     158            return TaskEqualityRuleManager.getInstance().compare(child1, child2); 
    175159        } 
    176         else if (mRuleManager.areAtLeastEqual(child1, child2, requiredEqualityLevel)) { 
     160        else if (TaskEqualityRuleManager.getInstance().areAtLeastEqual 
     161                     (child1, child2, requiredEqualityLevel)) 
     162        { 
    177163            return requiredEqualityLevel; 
    178164        } 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskAndSelectionComparisonRule.java

    r1154 r1190  
    3333public class TaskAndSelectionComparisonRule implements TaskComparisonRule { 
    3434     
    35     /** the rule manager for internally comparing tasks */ 
    36     private TaskEqualityRuleManager mRuleManager; 
    37      
    38     /** 
    39      * <p> 
    40      * simple constructor to provide the rule with the task equality rule manager to be able 
    41      * to perform comparisons of the children of provided tasks 
    42      * </p> 
    43      *  
    44      * @param ruleManager the rule manager for comparing tasks 
    45      */ 
    46     TaskAndSelectionComparisonRule(TaskEqualityRuleManager ruleManager) { 
    47         super(); 
    48         mRuleManager = ruleManager; 
    49     } 
    50  
    5135    /* (non-Javadoc) 
    5236     * @see NodeComparisonRule#isApplicable(ITask, ITask) 
     
    196180    { 
    197181        if (requiredEqualityLevel == null) { 
    198             return mRuleManager.compare(child1, child2); 
     182            return TaskEqualityRuleManager.getInstance().compare(child1, child2); 
    199183        } 
    200         else if (mRuleManager.areAtLeastEqual(child1, child2, requiredEqualityLevel)) { 
     184        else if (TaskEqualityRuleManager.getInstance().areAtLeastEqual 
     185                     (child1, child2, requiredEqualityLevel)) 
     186        { 
    201187            return requiredEqualityLevel; 
    202188        } 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/taskequality/TaskEqualityRuleManager.java

    r1189 r1190  
    5757        mRuleIndex.add(new GUIEventTaskComparisonRule()); 
    5858        mRuleIndex.add(new EventTaskComparisonRule()); 
    59         mRuleIndex.add(new IterationComparisonRule(this)); 
    60         mRuleIndex.add(new SequenceComparisonRule(this)); 
    61         mRuleIndex.add(new SelectionComparisonRule(this)); 
    62         mRuleIndex.add(new TaskAndIterationComparisonRule(this)); 
    63         mRuleIndex.add(new TaskAndSelectionComparisonRule(this)); 
     59        mRuleIndex.add(new IterationComparisonRule()); 
     60        mRuleIndex.add(new SequenceComparisonRule()); 
     61        mRuleIndex.add(new SelectionComparisonRule()); 
     62        mRuleIndex.add(new TaskAndIterationComparisonRule()); 
     63        mRuleIndex.add(new TaskAndSelectionComparisonRule()); 
    6464    } 
    6565 
Note: See TracChangeset for help on using the changeset viewer.