File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/criterion/Junction.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/collection/PersistentIdentifierBag.java | |||
Method name: TypedValue[] getTypedValues(Criteria, CriteriaQuery)
|
Method name: void PersistentIdentifierBag(SessionImplementor, Collection)
|
|||
Number of AST nodes: 2 | Number of AST nodes: 2 | |||
1 | public TypedValue[] getTypedValues(Criteria crit, CriteriaQuery criteriaQuery) | 1 | public PersistentIdentifierBag(SessionImplementor session, Collection coll) { | |
2 | throws HibernateException { | 2 | super(session); | |
3 | ArrayList typedValues = new ArrayList(); | 3 | if (coll instanceof List) { | |
4 | Iterator iter = criteria.iterator(); | 4 | values = (List) coll; | |
5 | while ( iter.hasNext() ) { | 5 | } | |
6 | TypedValue[] subvalues = ( (Criterion) iter.next() ).getTypedValues(crit, criteriaQuery); | 6 | else { | |
7 | for ( int i=0; i<subvalues.length; i++ ) { | 7 | values = new ArrayList(); | |
8 | typedValues.add( subvalues[i] ); | 8 | Iterator iter = coll.iterator(); | |
9 | } | 9 | while ( iter.hasNext() ) { | |
10 | } | 10 | values.add( iter.next() ); | |
11 | return (TypedValue[]) typedValues.toArray( new TypedValue[ typedValues.size() ] ); | 11 | } | |
12 | } | 12 | } | |
13 | setInitialized(); | |||
14 | setDirectlyAccessible(true); | |||
15 | identifiers = new HashMap(); | |||
16 | } | |||
See real code fragment | See real code fragment |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Similarity Score | 0.500 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | for (int i = 0; i < subvalues.length; i++) |
| 6 | while (iter.hasNext()) | ||||||||||||||||||
6 | typedValues.add(subvalues[i]); |
| | |||||||||||||||||||
| 7 | values.add(iter.next()); |
Row | Violation |
---|---|
1 | Type org.hibernate.engine.TypedValue[] of variable subvalues does not match with type java.util.Collection of variable coll |
2 | Type org.hibernate.engine.TypedValue[] of variable subvalues does not match with type java.util.Collection of variable coll |
3 | Unmatched statement typedValues.add(subvalues[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Clone fragment #1 returns variables i , while Clone fragment #2 returns variables |