String code; try { code = (String) CURRENCY_GET_CODE.invoke(value, null); } catch (Exception e) { throw new HibernateException("Could not get Currency code", e); } return ( (LiteralType) Hibernate.STRING ).objectToSQLString(code, dialect);
Object code; try { code = CURRENCY_GET_CODE.invoke(value, null); } catch (Exception e) { throw new HibernateException("Could not get Currency code", e); } Hibernate.STRING.set(st, code, index);
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/CurrencyType.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/type/CurrencyType.java
Method name: String objectToSQLString(Object, Dialect) Method name: void set(PreparedStatement, Object, int)
Number of AST nodes: 4 Number of AST nodes: 4
1
String code;
1
Object code;
2
		try {
2
		try {
3
			code = (String) CURRENCY_GET_CODE.invoke(value, null);
3
			code = CURRENCY_GET_CODE.invoke(value, null);
4
		}
4
		}
5
		catch (Exception e) {
5
		catch (Exception e) {
6
			throw new HibernateException("Could not get Currency code", e);
6
			throw new HibernateException("Could not get Currency code", e);
7
		}
7
		}
8
		return ( (LiteralType) Hibernate.STRING ).objectToSQLString(code, dialect);
8
		Hibernate.STRING.set(st, code, index);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                  
    1
    Object code;
    1
    String code;
                                  
    2
    try
    2
    try
                                                                                              
    3
    code = CURRENCY_GET_CODE.invoke(value, null);
    Preondition Violations
    Unmatched statement code=CURRENCY_GET_CODE.invoke(value,null); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    3
    code = CURRENCY_GET_CODE.invoke(value, null);
    3
    code = (String)CURRENCY_GET_CODE.invoke(value, null);
    3
    code = (String)CURRENCY_GET_CODE.invoke(value, null);
    Preondition Violations
    Unmatched statement code=(String)CURRENCY_GET_CODE.invoke(value,null); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                              
                                                                                  
    4
    Hibernate.STRING.set(st, code, index);
    4
    return ((LiteralType)Hibernate.STRING).objectToSQLString(code, dialect);
    4
    return ((LiteralType)Hibernate.STRING).objectToSQLString(code, dialect);
    Preondition Violations
    Unmatched return ((LiteralType)Hibernate.STRING).objectToSQLString(code,dialect);
                                                                                                                                                        
    Precondition Violations (3)
    Row Violation
    1Unmatched statement code=CURRENCY_GET_CODE.invoke(value,null); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    2Unmatched statement code=(String)CURRENCY_GET_CODE.invoke(value,null); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    3Unmatched return ((LiteralType)Hibernate.STRING).objectToSQLString(code,dialect);