File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaClass.java | File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaClass.java | |||
Method name: void addConstructor(Constructor, Class>)
|
Method name: void addMethod(Method, Class>)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if (constructors == null) {↵ | 1 | if (methods == null) {↵ | |
2 | constructors = new ArrayList<Constructor>(4);↵ | 2 | methods = new ArrayList<Method>(4);↵ | |
3 | }↵ | 3 | }↵ | |
4 | if (!Ruby.isSecurityRestricted()) {↵ | 4 | if (!Ruby.isSecurityRestricted()) {↵ | |
5 | try {↵ | 5 | try {↵ | |
6 | ctor.setAccessible(true);↵ | 6 | method.setAccessible(true);↵ | |
7 | } catch(SecurityException e) {}↵ | 7 | } catch(SecurityException e) {}↵ | |
8 | }↵ | 8 | }↵ | |
9 | constructors.add(ctor);↵ | 9 | methods.add(method);↵ | |
10 | haveLocalConstructor |= javaClass == ctor.getDeclaringClass(); | 10 | haveLocalMethod |= javaClass == method.getDeclaringClass(); | |
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.4 |
Clones location | Clones are in the same java file |
Number of node comparisons | 13 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (constructors == null) |
| 1 | if (methods == null) | ||||||||||||||
| 2 | methods = new ArrayList<Method>(4); | ||||||||||||||||
2 | constructors = new ArrayList<Constructor>(4); | | ||||||||||||||||
3 | if (!Ruby.isSecurityRestricted()) | 3 | if (!Ruby.isSecurityRestricted()) | |||||||||||||||
4 | try | 4 | try | |||||||||||||||
5 | ctor.setAccessible(true); |
| 5 | method.setAccessible(true); | ||||||||||||||
| 6 | methods.add(method); | ||||||||||||||||
6 | constructors.add(ctor); | | ||||||||||||||||
| 7 | haveLocalMethod |= javaClass == method.getDeclaringClass(); | ||||||||||||||||
7 | haveLocalConstructor |= javaClass == ctor.getDeclaringClass(); | |
Row | Violation |
---|---|
1 | Type java.util.List<java.lang.reflect.Constructor> of variable constructors does not match with type java.util.List<java.lang.reflect.Method> of variable methods |