for ( int i=0; i<ids.length; i++ ) {
s.append( persister.getIdentifierType().toLoggableString( ids[i], factory ) );
if ( i < ids.length-1 ) {
s.append( ", " );
}
}
for ( int i = 0; i < ids.length; i++ ) {
// Need to use the identifier type of the collection owner
// since the incoming is value is actually the owner's id.
// Using the collection's key type causes problems with
// property-ref keys...
s.append( persister.getOwnerEntityPersister().getIdentifierType().toLoggableString( ids[i], factory ) );
if ( i < ids.length-1 ) {
s.append( ", " );
}
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/pretty/MessageHelper.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/pretty/MessageHelper.java
|
Method name: String infoString(EntityPersister, Serializable[], SessionFactoryImplementor)
|
|
Method name: String collectionInfoString(CollectionPersister, Serializable[], SessionFactoryImplementor)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | for ( int i=0; i<ids.length; i++ ) {↵ | | 1 | for ( int i = 0; i < ids.length; i++ ) {↵
|
2 | s.append( persister↵ | | 2 | // Need to use the identifier type of the collection owner↵
|
| | | 3 | // since the incoming is value is actually the owner's id.↵
|
| | | 4 | // Using the collection's key type causes problems with↵
|
| | | 5 | // property-ref keys...↵
|
3 | .getIdentifierType().toLoggableString( ids[i], factory ) );↵ | | 6 | s.append( persister.getOwnerEntityPersister().getIdentifierType().toLoggableString( ids[i], factory ) );↵
|
4 | if ( i < ids.length-1 ) {↵ | | 7 | if ( i < ids.length-1 ) {↵
|
5 | s.append( ", " );↵ | | 8 | s.append( ", " );↵
|
6 | }↵ | | 9 | }↵
|
7 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 9 |
-
{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) | 17.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | for (int i = 0; i < ids.length; i++) | | 7 | for (int i = 0; i < ids.length; i++) |
8 | s.append(persister.getIdentifierType().toLoggableString(ids[i], factory)); | | 8 | s.append(persister.getOwnerEntityPersister().getIdentifierType().toLoggableString(ids[i], factory)); |
9 | | | 9 | |
10 | | | 10 | |
Precondition Violations (0)
Row |
Violation |