StringBuffer buffer = new StringBuffer();
manyToManyFilterHelper.render( buffer, alias, enabledFilters );
if ( manyToManyWhereString != null ) {
buffer.append( " and " )
.append( StringHelper.replace( manyToManyWhereTemplate, Template.TEMPLATE, alias ) );
}
return buffer.toString();
if ( FieldInterceptionHelper.isInstrumented( entity ) ) {
FieldInterceptor interceptor = FieldInterceptionHelper.extractFieldInterceptor( entity );
if ( interceptor != null ) {
interceptor.setSession( session );
}
else {
FieldInterceptor fieldInterceptor = FieldInterceptionHelper.injectFieldInterceptor(
entity,
getEntityName(),
null,
session
);
fieldInterceptor.dirty();
}
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java
|
Method name: String getManyToManyFilterFragment(String, Map)
|
|
Method name: void afterReassociate(Object, SessionImplementor)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 6
|
|
1 | StringBuffer buffer = new StringBuffer();↵ | | |
|
2 | manyToManyFilterHelper.render( buffer, alias, enabledFilters↵ | | 1 | if ( FieldInterceptionHelper.isInstrumented( entity ) ) {↵
|
3 | );↵ | | 2 | FieldInterceptor interceptor = FieldInterceptionHelper.extractFieldInterceptor( entity );↵
|
|
4 | if ( manyToManyWhereString != null ) {↵ | | 3 | if ( ↵
|
5 | buffer.append( " and "↵ | | 4 | interceptor != null ) {↵
|
6 | )↵ | | 5 | interceptor.setSession( session );↵
|
7 | .append( StringHelper.replace( manyToManyWhereTemplate, Template.TEMPLATE, alias ) );↵ | | 6 | ↵
|
8 | }↵ | | |
|
|
9 | return buffer.toString(); | | 7 | }↵
|
| | | 8 | else {↵
|
| | | 9 | FieldInterceptor fieldInterceptor = FieldInterceptionHelper.injectFieldInterceptor(↵
|
| | | 10 | entity,↵
|
| | | 11 | getEntityName(),↵
|
| | | 12 | null,↵
|
| | | 13 | session↵
|
| | | 14 | );↵
|
| | | 15 | fieldInterceptor.dirty();↵
|
| | | 16 | }↵
|
| | | 17 | }
|
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 11 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | StringBuffer buffer = new StringBuffer(); | | | |
| | | 2 | FieldInterceptor interceptor = FieldInterceptionHelper.extractFieldInterceptor(entity); |
2 | manyToManyFilterHelper.render(buffer, alias, enabledFilters); | | | |
3 | if (manyToManyWhereString != null) | | 3 | if (interceptor != null) |
| | | 4 | interceptor.setSession(session); |
4 | buffer.append(" and ").append(StringHelper.replace(manyToManyWhereTemplate, Template.TEMPLATE, alias)); | | | |
| | | | |
| | | 5 | FieldInterceptor fieldInterceptor = FieldInterceptionHelper.injectFieldInterceptor(entity, getEntityName(), null, session); |
| | | 6 | fieldInterceptor.dirty(); |
5 | return buffer.toString(); | | | |
Precondition Violations (2)
Row |
Violation |
1 | Type java.lang.String of variable manyToManyWhereString does not match with type org.hibernate.intercept.FieldInterceptor of variable interceptor |
2 | Unmatched return buffer.toString(); |