File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/condition/ContainsTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/condition/EqualsTest.java | |||
Method name: void testCaseSensitive()
|
Method name: void testCaseSensitive()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | Contains con = new Contains();↵ | 1 | Equals eq = new Equals();↵ | |
2 | con.setString("abc");↵ | 2 | eq.setArg1("a");↵ | |
3 | con.setSubstring("A");↵ | 3 | eq.setArg2("A");↵ | |
4 | assertTrue(!con.eval());↵ | 4 | assertTrue(!eq.eval());↵ | |
5 | con.setCasesensitive(false);↵ | 5 | eq.setCasesensitive(false);↵ | |
6 | assertTrue(con.eval()); | 6 | assertTrue(eq.eval()); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 28 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Contains con = new Contains(); |
| 1 | Equals eq = new Equals(); | ||||||||||||||||||||||||
2 | con.setString("abc"); |
| 2 | eq.setArg1("a"); | ||||||||||||||||||||||||
3 | con.setSubstring("A"); |
| 3 | eq.setArg2("A"); | ||||||||||||||||||||||||
4 | assertTrue(!con.eval()); |
| 4 | assertTrue(!eq.eval()); | ||||||||||||||||||||||||
5 | con.setCasesensitive(false); |
| 5 | eq.setCasesensitive(false); | ||||||||||||||||||||||||
6 | assertTrue(con.eval()); |
| 6 | assertTrue(eq.eval()); |
Row | Violation |
---|---|
1 | Expression con.setString("abc") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression eq.setArg1("a") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression con.setString("abc") is a void method call, and thus it cannot be parameterized |
4 | Expression eq.setArg1("a") is a void method call, and thus it cannot be parameterized |
5 | Expression con cannot be unified with expression eq , because common superclass org.apache.tools.ant.taskdefs.condition.Condition does not declare member(s) public void setString(java.lang.String) , public void setArg1(java.lang.String) |
6 | Expression con.setSubstring("A") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression eq.setArg2("A") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression con.setSubstring("A") is a void method call, and thus it cannot be parameterized |
9 | Expression eq.setArg2("A") is a void method call, and thus it cannot be parameterized |
10 | Expression con cannot be unified with expression eq , because common superclass org.apache.tools.ant.taskdefs.condition.Condition does not declare member(s) public void setSubstring(java.lang.String) , public void setArg2(java.lang.String) |
11 | Expression con cannot be unified with expression eq , because common superclass org.apache.tools.ant.taskdefs.condition.Condition does not declare member(s) public void setCasesensitive(boolean) |