File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/RmicTest.java | |||
Method name: void testCompilerArg()
|
Method name: void testCompilerArg()
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | assertEquals("no args", 0, args.length);↵ | 1 | assertEquals("no args", 0, args.length);↵ | |
2 | Javac.ImplementationSpecificArgument arg = javac.createCompilerArg();↵ | 2 | Rmic.ImplementationSpecificArgument arg = rmic.createCompilerArg();↵ | |
3 | String ford = "Ford";↵ | 3 | String ford = "Ford";↵ | |
4 | String prefect = "Prefect";↵ | 4 | String prefect = "Prefect";↵ | |
5 | String testArg = ford + " " + prefect;↵ | 5 | String testArg = ford + " " + prefect;↵ | |
6 | arg.setValue(testArg);↵ | 6 | arg.setValue(testArg);↵ | |
7 | args = javac.getCurrentCompilerArgs();↵ | 7 | args = rmic.getCurrentCompilerArgs();↵ | |
8 | assertEquals("unconditional single arg", 1, args.length);↵ | 8 | assertEquals("unconditional single arg", 1, args.length);↵ | |
9 | assertEquals(testArg, args[0]);↵ | 9 | assertEquals(testArg, args[0]);↵ | |
10 | arg.setCompiler("jikes");↵ | 10 | arg.setCompiler("weblogic");↵ | |
11 | args = javac.getCurrentCompilerArgs();↵ | 11 | args = rmic.getCurrentCompilerArgs();↵ | |
12 | assertNotNull(args); | 12 |
| |
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 | 90 |
Number of mapped statements | 12 |
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 | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | assertEquals("no args", 0, args.length); | 3 | assertEquals("no args", 0, args.length); | ||||||||||||||||||||
4 | Javac.ImplementationSpecificArgument arg = javac.createCompilerArg(); |
| 4 | Rmic.ImplementationSpecificArgument arg = rmic.createCompilerArg(); | |||||||||||||||||||
5 | String ford = "Ford"; | 5 | String ford = "Ford"; | ||||||||||||||||||||
6 | String prefect = "Prefect"; | 6 | String prefect = "Prefect"; | ||||||||||||||||||||
7 | String testArg = ford + " " + prefect; | 7 | String testArg = ford + " " + prefect; | ||||||||||||||||||||
8 | arg.setValue(testArg); |
| 8 | arg.setValue(testArg); | |||||||||||||||||||
9 | args = javac.getCurrentCompilerArgs(); |
| 9 | args = rmic.getCurrentCompilerArgs(); | |||||||||||||||||||
10 | assertEquals("unconditional single arg", 1, args.length); | 10 | assertEquals("unconditional single arg", 1, args.length); | ||||||||||||||||||||
11 | assertEquals(testArg, args[0]); | 11 | assertEquals(testArg, args[0]); | ||||||||||||||||||||
12 | arg.setCompiler("jikes"); |
| 12 | arg.setCompiler("weblogic"); | |||||||||||||||||||
13 | args = javac.getCurrentCompilerArgs(); |
| 13 | args = rmic.getCurrentCompilerArgs(); | |||||||||||||||||||
14 | assertNotNull(args); | 14 | assertNotNull(args); |
Row | Violation |
---|---|
1 | Expression javac cannot be unified with expression rmic , because common superclass org.apache.tools.ant.taskdefs.MatchingTask does not declare member(s) public java.lang.String[] getCurrentCompilerArgs() |
2 | Expression arg cannot be unified with expression arg , because common superclass org.apache.tools.ant.util.facade.ImplementationSpecificArgument does not declare member(s) public void setCompiler(java.lang.String) |
3 | Expression javac cannot be unified with expression rmic , because common superclass org.apache.tools.ant.taskdefs.MatchingTask does not declare member(s) public java.lang.String[] getCurrentCompilerArgs() |
4 | Clone fragment #1 returns variables args, testArg, arg, ford, prefect , while Clone fragment #2 returns variables args, testArg |