File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/classloader/ClassLoaderTestDAO.java | File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/classloader/ClassLoaderTestDAO.java | |||
Method name: void updateAccountBranch(Integer, String)
|
Method name: void updateAccountBalance(Integer, Integer)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | log.debug("Updating account " + id + " to branch " + branch);↵ | 1 | log.debug("Updating account " + id + " to balance " + newBalance);↵ | |
2 | tm.begin();↵ | 2 | tm.begin();↵ | |
3 | try {↵ | 3 | try {↵ | |
4 | Session session = sessionFactory.getCurrentSession();↵ | 4 | Session session = sessionFactory.getCurrentSession();↵ | |
5 | Object account = session.get(acctClass, id);↵ | 5 | Object account = session.get(acctClass, id);↵ | |
6 | setBranch.invoke(account, branch);↵ | 6 | setBalance.invoke(account, newBalance);↵ | |
7 | session.update(account);↵ | 7 | session.update(account);↵ | |
8 | tm.commit();↵ | 8 | tm.commit();↵ | |
9 | }↵ | 9 | }↵ | |
10 | catch (Exception e) {↵ | 10 | catch (Exception e) {↵ | |
11 | log.error("rolling back", e);↵ | 11 | log.error("rolling back", e);↵ | |
12 | tm.rollback();↵ | 12 | tm.rollback();↵ | |
13 | throw e;↵ | 13 | throw e;↵ | |
14 | }↵ | 14 | }↵ | |
15 | log.debug("Updated account " + id + " to branch " + branch); | 15 | log.debug("Updated account " + id + " to balance " + newBalance); | |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 45 |
Number of mapped statements | 9 |
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) | 4.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | log.debug("Updating account " + id + " to branch " + branch); |
| 1 | log.debug("Updating account " + id + " to balance " + newBalance); | |||||||||||||||||
2 | tm.begin(); | 2 | tm.begin(); | ||||||||||||||||||
3 | try | 3 | try | ||||||||||||||||||
4 | Session session = sessionFactory.getCurrentSession(); | 4 | Session session = sessionFactory.getCurrentSession(); | ||||||||||||||||||
5 | Object account = session.get(acctClass, id); | 5 | Object account = session.get(acctClass, id); | ||||||||||||||||||
6 | setBranch.invoke(account, branch); |
| 6 | setBalance.invoke(account, newBalance); | |||||||||||||||||
7 | session.update(account); | 7 | session.update(account); | ||||||||||||||||||
8 | tm.commit(); | 8 | tm.commit(); | ||||||||||||||||||
9 | log.debug("Updated account " + id + " to branch " + branch); |
| 9 | log.debug("Updated account " + id + " to balance " + newBalance); |
Row | Violation |
---|---|
1 | Type java.lang.String of variable branch does not match with type java.lang.Integer of variable newBalance |
2 | Type java.lang.String of variable branch does not match with type java.lang.Integer of variable newBalance |
3 | Type java.lang.String of variable branch does not match with type java.lang.Integer of variable newBalance |