File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/AptCompilerAdapter.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/Javac13.java | |||
Method name: boolean execute()
|
Method name: boolean execute()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | Class c = Class.forName(APT_ENTRY_POINT);↵ | 1 | Class c = Class.forName ("com.sun.tools.javac.Main");↵ | |
2 | Object compiler = c.newInstance();↵ | 2 | Object compiler = c.newInstance ();↵ | |
3 | Method compile = c.getMethod(APT_METHOD_NAME,↵ | 3 | Method compile = c.getMethod↵ | |
4 | ↵ | 4 | ("compile",↵ | |
5 | new Class[]{(new String[]{}).getClass()});↵ | 5 | new Class [] {(new String [] {}).getClass ()});↵ | |
6 | int result = ((Integer) compile.invoke↵ | 6 | int result = ((Integer) compile.invoke↵ | |
7 | (compiler, new Object[]{cmd.getArguments()}))↵ | 7 | (compiler, new Object[] {cmd.getArguments()}))↵ | |
8 | .intValue();↵ | 8 | .intValue ();↵ | |
9 | return (result == APT_COMPILER_SUCCESS); | 9 | return (result == MODERN_COMPILER_SUCCESS); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 14 |
Number of mapped statements | 5 |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | Class c = Class.forName(APT_ENTRY_POINT); |
| 4 | Class c = Class.forName("com.sun.tools.javac.Main"); | ||||||||||
6 | Object compiler = c.newInstance(); | 5 | Object compiler = c.newInstance(); | |||||||||||
7 | Method compile = c.getMethod(APT_METHOD_NAME, new Class[] {(new String[] {}).getClass()}); |
| 6 | Method compile = c.getMethod("compile", new Class[] {(new String[] {}).getClass()}); | ||||||||||
8 | int result = ((Integer)compile.invoke(compiler, new Object[] {cmd.getArguments()})).intValue(); | 7 | int result = ((Integer)compile.invoke(compiler, new Object[] {cmd.getArguments()})).intValue(); | |||||||||||
9 | return (result == APT_COMPILER_SUCCESS); |
| 8 | return (result == MODERN_COMPILER_SUCCESS); |
Row | Violation |
---|