File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/jdbc/ColumnNameCache.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java | |||
Method name: int getIndexForColumnName(String, ResultSetWrapper)
|
Method name: String getManyToManyFilterFragment(String, Map)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 5 | |||
1 | Integer cached = ( Integer ) columnNameToIndexCache.get( columnName↵ | 1 | StringBuffer buffer = new StringBuffer();↵ | |
2 | );↵ | 2 | manyToManyFilterHelper.render( buffer, alias, enabledFilters );↵ | |
3 | if ( cached != null ) {↵ | 3 | if ( ↵ | |
4 | return cached.intValue();↵ | |||
5 | }↵ | |||
6 | else {↵ | |||
7 | int index = rs.getTarget().findColumn( columnName );↵ | |||
8 | columnNameToIndexCache.put( columnName, new Integer(index↵ | 4 | manyToManyWhereString != null ) {↵ | |
5 | buffer.append( " and " )↵ | |||
9 | ) );↵ | 6 | .append( StringHelper.replace( manyToManyWhereTemplate, Template.TEMPLATE, alias ) );↵ | |
10 | ↵ | 7 | }↵ | |
11 | return index;↵ | 8 | return ↵ | |
12 | } | 9 |
| |
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 1.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | StringBuffer buffer = new StringBuffer(); | ||||||||||||||||
1 | Integer cached = (Integer)columnNameToIndexCache.get(columnName); | | ||||||||||||||||
| 2 | manyToManyFilterHelper.render(buffer, alias, enabledFilters); | ||||||||||||||||
2 | if (cached != null) |
| 3 | if (manyToManyWhereString != null) | ||||||||||||||
3 | return cached.intValue(); |
| | |||||||||||||||
else | | |||||||||||||||||
4 | int index = rs.getTarget().findColumn(columnName); | | ||||||||||||||||
5 | columnNameToIndexCache.put(columnName, new Integer(index)); | | ||||||||||||||||
6 | return index; |
| | |||||||||||||||
| 4 | buffer.append(" and ").append(StringHelper.replace(manyToManyWhereTemplate, Template.TEMPLATE, alias)); | ||||||||||||||||
|
| 5 | return buffer.toString(); |
Row | Violation |
---|---|
1 | Type java.lang.Integer of variable cached does not match with type java.lang.String of variable manyToManyWhereString |
2 | Unmatched return cached.intValue(); |
3 | Unmatched return index; |
4 | Unmatched return buffer.toString(); |