Object result = processValue( values[i], types[i] );
if (result!=null) {
substitute = true;
values[i] = result;
}
for ( int i=0; i<types.length; i++ ) {
Object result = processValue( values[i], types[i] );
if (result!=null) {
values[i] = result;
substituteComponent = true;
}
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/WrapVisitor.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/WrapVisitor.java
|
Method name: void processValue(int, Object[], Type[])
|
|
Method name: Object processComponent(Object, AbstractComponentType)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 5
|
|
| | | 1 | for ( int i=0; i<types.length; i++ ) {↵
|
1 | Object result = processValue( values[i], types[i] );↵ | | 2 | Object result = processValue( values[i], types[i] );↵
|
2 | if (result!=null) {↵ | | 3 | if (result!=null) {↵
|
3 | substitute = true;↵ | | 4 | ↵
|
4 | values[i] = result;↵ | | 5 | values[i] = result;↵
|
| | | 6 | substituteComponent = true;↵
|
| | | 7 | }↵
|
5 | } | | 8 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Object result = processValue(values[i], types[i]); | | 6 | Object result = processValue(values[i], types[i]); |
2 | if (result != null) | | 7 | if (result != null) |
3 | | | 9 | substituteComponent = true; |
4 | | | 8 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression substitute is a field being modified, and thus it cannot be parameterized |
2 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables substituteComponent, values |