File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/RmicTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/JavacTest.java | |||
Method name: void testCompilerArg()
|
Method name: void testCompilerArg()
|
|||
Number of AST nodes: 23 | Number of AST nodes: 23 | |||
1 | String[] args = rmic.getCurrentCompilerArgs();↵ | 1 | String[] args = javac.getCurrentCompilerArgs();↵ | |
2 | assertNotNull(args);↵ | 2 | assertNotNull(args);↵ | |
3 | assertEquals("no args", 0, args.length);↵ | 3 | assertEquals("no args", 0, args.length);↵ | |
4 | Rmic.ImplementationSpecificArgument arg = rmic.createCompilerArg();↵ | 4 | Javac.ImplementationSpecificArgument arg = javac.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 = rmic.getCurrentCompilerArgs();↵ | 9 | args = javac.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("weblogic");↵ | 12 | arg.setCompiler("jikes");↵ | |
13 | args = rmic.getCurrentCompilerArgs();↵ | 13 | args = javac.getCurrentCompilerArgs();↵ | |
14 | assertNotNull(args);↵ | 14 | assertNotNull(args);↵ | |
15 | assertEquals("implementation is weblogic but build.rmic is null",↵ | 15 | assertEquals("implementation is jikes but build.compiler is null",↵ | |
16 | 0, args.length);↵ | 16 | 0, args.length);↵ | |
17 | project.setProperty("build.rmic", "sun");↵ | 17 | project.setProperty("build.compiler", "jvc");↵ | |
18 | args = rmic.getCurrentCompilerArgs();↵ | 18 | args = javac.getCurrentCompilerArgs();↵ | |
19 | assertNotNull(args);↵ | 19 | assertNotNull(args);↵ | |
20 | assertEquals("implementation is weblogic but build.rmic is sun",↵ | 20 | assertEquals("implementation is jikes but build.compiler is jvc",↵ | |
21 | 0, args.length);↵ | 21 | 0, args.length);↵ | |
22 | project.setProperty("build.rmic", "weblogic");↵ | 22 | project.setProperty("build.compiler", "jikes");↵ | |
23 | args = rmic.getCurrentCompilerArgs();↵ | 23 | args = javac.getCurrentCompilerArgs();↵ | |
24 | assertEquals("both are weblogic", 1, args.length);↵ | 24 | assertEquals("both are jikes", 1, args.length);↵ | |
25 | assertEquals(testArg, args[0]); | 25 |
| |
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 | 247 |
Number of mapped statements | 23 |
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 | String[] args = rmic.getCurrentCompilerArgs(); |
| 1 | String[] args = javac.getCurrentCompilerArgs(); | ||||||||||||||||||||||||
2 | assertNotNull(args); | 2 | assertNotNull(args); | |||||||||||||||||||||||||
3 | assertEquals("no args", 0, args.length); | 3 | assertEquals("no args", 0, args.length); | |||||||||||||||||||||||||
4 | Rmic.ImplementationSpecificArgument arg = rmic.createCompilerArg(); |
| 4 | Javac.ImplementationSpecificArgument arg = javac.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 = rmic.getCurrentCompilerArgs(); |
| 9 | args = javac.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("weblogic"); |
| 12 | arg.setCompiler("jikes"); | ||||||||||||||||||||||||
13 | args = rmic.getCurrentCompilerArgs(); |
| 13 | args = javac.getCurrentCompilerArgs(); | ||||||||||||||||||||||||
14 | assertNotNull(args); | 14 | assertNotNull(args); | |||||||||||||||||||||||||
15 | assertEquals("implementation is weblogic but build.rmic is null", 0, args.length); |
| 15 | assertEquals("implementation is jikes but build.compiler is null", 0, args.length); | ||||||||||||||||||||||||
16 | project.setProperty("build.rmic", "sun"); |
| 16 | project.setProperty("build.compiler", "jvc"); | ||||||||||||||||||||||||
17 | args = rmic.getCurrentCompilerArgs(); |
| 17 | args = javac.getCurrentCompilerArgs(); | ||||||||||||||||||||||||
18 | assertNotNull(args); | 18 | assertNotNull(args); | |||||||||||||||||||||||||
19 | assertEquals("implementation is weblogic but build.rmic is sun", 0, args.length); |
| 19 | assertEquals("implementation is jikes but build.compiler is jvc", 0, args.length); | ||||||||||||||||||||||||
20 | project.setProperty("build.rmic", "weblogic"); |
| 20 | project.setProperty("build.compiler", "jikes"); | ||||||||||||||||||||||||
21 | args = rmic.getCurrentCompilerArgs(); |
| 21 | args = javac.getCurrentCompilerArgs(); | ||||||||||||||||||||||||
22 | assertEquals("both are weblogic", 1, args.length); |
| 22 | assertEquals("both are jikes", 1, args.length); | ||||||||||||||||||||||||
23 | assertEquals(testArg, args[0]); | 23 | assertEquals(testArg, args[0]); |
Row | Violation |
---|---|
1 | Expression rmic cannot be unified with expression javac , because common superclass org.apache.tools.ant.taskdefs.MatchingTask does not declare member(s) public java.lang.String[] getCurrentCompilerArgs() |
2 | Expression Rmic cannot be unified with expression Javac , because common superclass org.apache.tools.ant.taskdefs.MatchingTask does not declare member(s) public org.apache.tools.ant.taskdefs.Rmic.ImplementationSpecificArgument createCompilerArg() , public org.apache.tools.ant.taskdefs.Javac.ImplementationSpecificArgument createCompilerArg() |
3 | Expression rmic cannot be unified with expression javac , because common superclass org.apache.tools.ant.taskdefs.MatchingTask does not declare member(s) public org.apache.tools.ant.taskdefs.Rmic.ImplementationSpecificArgument createCompilerArg() , public org.apache.tools.ant.taskdefs.Javac.ImplementationSpecificArgument createCompilerArg() |
4 | Expression rmic cannot be unified with expression javac , because common superclass org.apache.tools.ant.taskdefs.MatchingTask does not declare member(s) public java.lang.String[] getCurrentCompilerArgs() |
5 | 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) |
6 | Expression rmic cannot be unified with expression javac , because common superclass org.apache.tools.ant.taskdefs.MatchingTask does not declare member(s) public java.lang.String[] getCurrentCompilerArgs() |
7 | Expression rmic cannot be unified with expression javac , because common superclass org.apache.tools.ant.taskdefs.MatchingTask does not declare member(s) public java.lang.String[] getCurrentCompilerArgs() |
8 | Expression rmic cannot be unified with expression javac , because common superclass org.apache.tools.ant.taskdefs.MatchingTask does not declare member(s) public java.lang.String[] getCurrentCompilerArgs() |
9 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables arg, testArg, args, ford, prefect |