s.append( persister.getEntityName() );
s.append( "#<" );
for ( int i=0; i<ids.length; i++ ) {
s.append( persister.getIdentifierType().toLoggableString( ids[i], factory ) );
if ( i < ids.length-1 ) {
s.append( ", " );
}
}
s.append( '>' );
s.append( persister.getRole() );
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( ", " );
}
}
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: 7
|
|
Number of AST nodes: 7
|
|
1 | s.append( persister.getEntityName() );↵ | | 1 | s.append( persister.getRole() );↵
|
2 | s.append( "#<" );↵ | | 2 | s.append( "#<" );↵
|
3 | for ( int i=0; i<ids.length; i++ ) {↵ | | 3 | for ( int i = 0; i < ids.length; i++ ) {↵
|
4 | s.append( persister↵ | | 4 | // Need to use the identifier type of the collection owner↵
|
| | | 5 | // since the incoming is value is actually the owner's id.↵
|
| | | 6 | // Using the collection's key type causes problems with↵
|
| | | 7 | // property-ref keys...↵
|
5 | .getIdentifierType().toLoggableString( ids[i], factory ) );↵ | | 8 | s.append( persister.getOwnerEntityPersister().getIdentifierType().toLoggableString( ids[i], factory ) );↵
|
6 | if ( i < ids.length-1 ) {↵ | | 9 | if ( i < ids.length-1 ) {↵
|
7 | s.append( ", " );↵ | | 10 | s.append( ", " );↵
|
8 | }↵ | | 11 | }↵
|
9 | }↵ | | 12 | }↵
|
10 | s.append( '>' ); | | 13 | s.append( '>' );
|
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 18 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 21.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | s.append(persister.getEntityName()); | | 6 | s.append("#<"); |
6 | s.append("#<"); | | 5 | s.append(persister.getRole()); |
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 | |
11 | s.append('>'); | | 11 | s.append('>'); |
Precondition Violations (0)
Row |
Violation |