Getter result = null; for (int i = 0; i < chain.length; i++) { PropertyAccessor candidate = chain[i]; try { result = candidate.getGetter(theClass, propertyName); return result; } catch (PropertyNotFoundException pnfe) { // ignore } } throw new PropertyNotFoundException("Could not find getter for " + propertyName + " on " + theClass);
Setter result = null; for (int i = 0; i < chain.length; i++) { PropertyAccessor candidate = chain[i]; try { result = candidate.getSetter(theClass, propertyName); return result; } catch (PropertyNotFoundException pnfe) { // } } throw new PropertyNotFoundException("Could not find setter for " + propertyName + " on " + theClass);
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/property/ChainedPropertyAccessor.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/property/ChainedPropertyAccessor.java
Method name: Getter getGetter(Class, String) Method name: Setter getSetter(Class, String)
Number of AST nodes: 7 Number of AST nodes: 7
1
Getter result = null;
1
Setter result = null;
2
		for (int i = 0; i < chain.length; i++) {
2
		for (int i = 0; i < chain.length; i++) {
3
			PropertyAccessor candidate = chain[i];
3
			PropertyAccessor candidate = chain[i];
4
			try {
4
			try {
5
				result = candidate.getGetter(theClass, propertyName);
5
				result = candidate.getSetter(theClass, propertyName);
6
				return result;
6
				return result;
7
			} catch (PropertyNotFoundException pnfe) {
7
			} catch (PropertyNotFoundException pnfe) {
8
				// ignore
8
				//
9
			}
9
			}
10
		}
10
		}
11
		throw new PropertyNotFoundException("Could not find getter for " + propertyName + " on " + theClass);
11
		throw new PropertyNotFoundException("Could not find setter for " + propertyName + " on " + theClass);
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 comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                
    1
    Setter result = null;
    1
    Getter result = null;
                                                
    2
    for (int i = 0; i < chain.length; i++)
    2
    for (int i = 0; i < chain.length; i++)
    3
    PropertyAccessor candidate = chain[i];
    3
    PropertyAccessor candidate = chain[i];
    4
    try
    4
    try
                                                                                                              
    5
    result = candidate.getSetter(theClass, propertyName);
    Preondition Violations
    Unmatched statement result=candidate.getSetter(theClass,propertyName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement result=candidate.getSetter(theClass,propertyName); 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
    5
    result = candidate.getSetter(theClass, propertyName);
    5
    result = candidate.getGetter(theClass, propertyName);
    5
    result = candidate.getGetter(theClass, propertyName);
    Preondition Violations
    Unmatched statement result=candidate.getGetter(theClass,propertyName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement result=candidate.getGetter(theClass,propertyName); 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
                                                                                                              
                                      
    6
    return result;
    Preondition Violations
    Unmatched return result;
    6
    return result;
    6
    return result;
    6
    return result;
    Preondition Violations
    Unmatched return result;
                                      
    7
    throw new PropertyNotFoundException("Could not find getter for " + propertyName + " on " + theClass);
    7
    throw new PropertyNotFoundException("Could not find getter for " + propertyName + " on " + theClass);
    7
    throw new PropertyNotFoundException("Could not find setter for " + propertyName + " on " + theClass);
    Differences
    Expression1Expression2Difference
    "Could not find getter for ""Could not find setter for "LITERAL_VALUE_MISMATCH
    7
    throw new PropertyNotFoundException("Could not find setter for " + propertyName + " on " + theClass);
    Precondition Violations (6)
    Row Violation
    1Unmatched statement result=candidate.getSetter(theClass,propertyName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement result=candidate.getSetter(theClass,propertyName); 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 statement result=candidate.getGetter(theClass,propertyName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement result=candidate.getGetter(theClass,propertyName); 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
    5Unmatched return result;
    6Unmatched return result;