BasicGetter result = getGetterOrNull(theClass, propertyName); if (result==null) { throw new PropertyNotFoundException( "Could not find a getter for " + propertyName + " in class " + theClass.getName() ); } return result;
BasicSetter result = getSetterOrNull(theClass, propertyName); if (result==null) { throw new PropertyNotFoundException( "Could not find a setter for property " + propertyName + " in class " + theClass.getName() ); } return result;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/property/BasicPropertyAccessor.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/property/BasicPropertyAccessor.java
Method name: Getter createGetter(Class, String) Method name: Setter createSetter(Class, String)
Number of AST nodes: 4 Number of AST nodes: 4
1
BasicGetter result = getGetterOrNull(theClass, propertyName);
1
BasicSetter result = getSetterOrNull(theClass, propertyName);
2
		if (result==null) {
2
		if (result==null) {
3
			throw new PropertyNotFoundException( 
3
			throw new PropertyNotFoundException( 
4
					"Could not find a getter for " + 
4
					"Could not find a setter for property " + 
5
					propertyName + 
5
					propertyName + 
6
					" in class " + 
6
					" in class " + 
7
					theClass.getName() 
7
					theClass.getName() 
8
			);
8
				);
9
		}
9
		}
10
		return result;
10
		return result;
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.1
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                              
    1
    BasicSetter result = getSetterOrNull(theClass, propertyName);
    1
    BasicGetter result = getGetterOrNull(theClass, propertyName);
                                                                                                                              
    2
    if (result == null)
    2
    if (result == null)
    2
    if (result == null)
    Differences
    Expression1Expression2Difference
    org.hibernate.property.BasicPropertyAccessor.BasicGetterorg.hibernate.property.BasicPropertyAccessor.BasicSetterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.property.BasicPropertyAccessor.BasicGetter of variable result does not match with type org.hibernate.property.BasicPropertyAccessor.BasicSetter of variable result
    • Make classes org.hibernate.property.BasicPropertyAccessor.BasicGetter and org.hibernate.property.BasicPropertyAccessor.BasicSetter extend a common superclass
    2
    if (result == null)
    3
    throw new PropertyNotFoundException("Could not find a getter for " + propertyName + " in class " + theClass.getName());
    3
    throw new PropertyNotFoundException("Could not find a getter for " + propertyName + " in class " + theClass.getName());
    3
    throw new PropertyNotFoundException("Could not find a setter for property " + propertyName + " in class " + theClass.getName());
    Differences
    Expression1Expression2Difference
    "Could not find a getter for ""Could not find a setter for property "LITERAL_VALUE_MISMATCH
    3
    throw new PropertyNotFoundException("Could not find a setter for property " + propertyName + " in class " + theClass.getName());
                                      
    4
    return result;
    Preondition Violations
    Unmatched return result;
    4
    return result;
    4
    return result;
    4
    return result;
    Preondition Violations
    Unmatched return result;
                                      
    Precondition Violations (3)
    Row Violation
    1Type org.hibernate.property.BasicPropertyAccessor.BasicGetter of variable result does not match with type org.hibernate.property.BasicPropertyAccessor.BasicSetter of variable result
    2Unmatched return result;
    3Unmatched return result;