Employee john = new Employee("John Doe"); john.setCompany( "JBoss" ); john.setDepartment( "hr" ); john.setTitle( "hr guru" ); john.setRegion( "US" ); Employee polli = new Employee("Polli Wog"); polli.setCompany( "JBoss" ); polli.setDepartment( "hr" ); polli.setTitle( "hr novice" ); polli.setRegion( "US" ); polli.setManager( john ); john.getMinions().add( polli ); Employee suzie = new Employee( "Suzie Q" ); suzie.setCompany( "JBoss" ); suzie.setDepartment( "hr" ); suzie.setTitle( "hr novice" ); suzie.setRegion( "EMEA" ); suzie.setManager( john ); john.getMinions().add( suzie ); Customer cust = new Customer( "John Q Public" ); cust.setCompany( "Acme" ); cust.setRegion( "US" ); cust.setContactOwner( john ); Person ups = new Person( "UPS guy" ); ups.setCompany( "UPS" ); ups.setRegion( "US" ); s.save( john ); s.save( cust ); s.save( ups ); s.flush();
Employee john = new Employee( "John Doe" ); john.setCompany( "JBoss" ); john.setDepartment( "hr" ); john.setTitle( "hr guru" ); john.setRegion( "US" ); Employee polli = new Employee( "Polli Wog" ); polli.setCompany( "JBoss" ); polli.setDepartment( "hr" ); polli.setTitle( "hr novice" ); polli.setRegion( "US" ); polli.setManager( john ); john.getMinions().add( polli ); Employee suzie = new Employee( "Suzie Q" ); suzie.setCompany( "JBoss" ); suzie.setDepartment( "hr" ); suzie.setTitle( "hr novice" ); suzie.setRegion( "EMEA" ); suzie.setManager( john ); john.getMinions().add( suzie ); Customer cust = new Customer( "John Q Public" ); cust.setCompany( "Acme" ); cust.setRegion( "US" ); cust.setContactOwner( john ); Person ups = new Person( "UPS guy" ); ups.setCompany( "UPS" ); ups.setRegion( "US" ); s.save( john ); s.save( cust ); s.save( ups ); s.flush();
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/subclassfilter/DiscrimSubclassFilterTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/subclassfilter/UnionSubclassFilterTest.java
Method name: void prepareTestData(Session) Method name: void prepareTestData(Session)
Number of AST nodes: 30 Number of AST nodes: 30
1
Employee john = new Employee("John Doe");
1
Employee john = new Employee( "John Doe" );
2
		john.setCompany( "JBoss" );
2
		john.setCompany( "JBoss" );
3
		john.setDepartment( "hr" );
3
		john.setDepartment( "hr" );
4
		john.setTitle( "hr guru" );
4
		john.setTitle( "hr guru" );
5
		john.setRegion( "US" );
5
		john.setRegion( "US" );
6
		Employee polli = new Employee("Polli Wog");
6
		Employee polli = new Employee( "Polli Wog" );
7
		polli.setCompany( "JBoss" );
7
		polli.setCompany( "JBoss" );
8
		polli.setDepartment( "hr" );
8
		polli.setDepartment( "hr" );
9
		polli.setTitle( "hr novice" );
9
		polli.setTitle( "hr novice" );
10
		polli.setRegion( "US" );
10
		polli.setRegion( "US" );
11
		polli.setManager( john );
11
		polli.setManager( john );
12
		john.getMinions().add( polli );
12
		john.getMinions().add( polli );
13
		Employee suzie = new Employee( "Suzie Q" );
13
		Employee suzie = new Employee( "Suzie Q" );
14
		suzie.setCompany( "JBoss" );
14
		suzie.setCompany( "JBoss" );
15
		suzie.setDepartment( "hr" );
15
		suzie.setDepartment( "hr" );
16
		suzie.setTitle( "hr novice" );
16
		suzie.setTitle( "hr novice" );
17
		suzie.setRegion( "EMEA" );
17
		suzie.setRegion( "EMEA" );
18
		suzie.setManager( john );
18
		suzie.setManager( john );
19
		john.getMinions().add( suzie );
19
		john.getMinions().add( suzie );
20
		Customer cust = new Customer( "John Q Public" );
20
		Customer cust = new Customer( "John Q Public" );
21
		cust.setCompany( "Acme" );
21
		cust.setCompany( "Acme" );
22
		cust.setRegion( "US" );
22
		cust.setRegion( "US" );
23
		cust.setContactOwner( john );
23
		cust.setContactOwner( john );
24
		Person ups = new Person( "UPS guy" );
24
		Person ups = new Person( "UPS guy" );
25
		ups.setCompany( "UPS" );
25
		ups.setCompany( "UPS" );
26
		ups.setRegion( "US" );
26
		ups.setRegion( "US" );
27
		s.save( john );
27
		s.save( john );
28
		s.save( cust );
28
		s.save( cust );
29
		s.save( ups );
29
		s.save( ups );
30
		s.flush();
30
		s.flush();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes having the same super class
Number of node comparisons305
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements30
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    Employee john = new Employee("John Doe");
    1
    Employee john = new Employee("John Doe");
    2
    john.setCompany("JBoss");
    2
    john.setCompany("JBoss");
    3
    john.setDepartment("hr");
    3
    john.setDepartment("hr");
    4
    john.setTitle("hr guru");
    4
    john.setTitle("hr guru");
    5
    john.setRegion("US");
    5
    john.setRegion("US");
    6
    Employee polli = new Employee("Polli Wog");
    6
    Employee polli = new Employee("Polli Wog");
    7
    polli.setCompany("JBoss");
    7
    polli.setCompany("JBoss");
    8
    polli.setDepartment("hr");
    8
    polli.setDepartment("hr");
    9
    polli.setTitle("hr novice");
    9
    polli.setTitle("hr novice");
    10
    polli.setRegion("US");
    10
    polli.setRegion("US");
    11
    polli.setManager(john);
    11
    polli.setManager(john);
    12
    john.getMinions().add(polli);
    12
    john.getMinions().add(polli);
    13
    Employee suzie = new Employee("Suzie Q");
    13
    Employee suzie = new Employee("Suzie Q");
    14
    suzie.setCompany("JBoss");
    14
    suzie.setCompany("JBoss");
    15
    suzie.setDepartment("hr");
    15
    suzie.setDepartment("hr");
    16
    suzie.setTitle("hr novice");
    16
    suzie.setTitle("hr novice");
    17
    suzie.setRegion("EMEA");
    17
    suzie.setRegion("EMEA");
    18
    suzie.setManager(john);
    18
    suzie.setManager(john);
    19
    john.getMinions().add(suzie);
    19
    john.getMinions().add(suzie);
    20
    Customer cust = new Customer("John Q Public");
    20
    Customer cust = new Customer("John Q Public");
    21
    cust.setCompany("Acme");
    21
    cust.setCompany("Acme");
    22
    cust.setRegion("US");
    22
    cust.setRegion("US");
    23
    cust.setContactOwner(john);
    23
    cust.setContactOwner(john);
    24
    Person ups = new Person("UPS guy");
    24
    Person ups = new Person("UPS guy");
    25
    ups.setCompany("UPS");
    25
    ups.setCompany("UPS");
    26
    ups.setRegion("US");
    26
    ups.setRegion("US");
    27
    s.save(john);
    27
    s.save(john);
    28
    s.save(cust);
    28
    s.save(cust);
    29
    s.save(ups);
    29
    s.save(ups);
    30
    s.flush();
    30
    s.flush();
    Precondition Violations (0)
    Row Violation