if (!event.isPre()) { Fqn<String> fqn = event.getFqn(); System.out.println("MyListener - Created node " + fqn.toString()); modified.add(fqn); }
if (!event.isPre()) { Fqn<String> fqn = event.getFqn(); System.out.println("MyListener - Visited node " + fqn.toString()); accessed.add(fqn); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/classloader/CacheAccessListener.java File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/classloader/CacheAccessListener.java
Method name: void nodeCreated(NodeCreatedEvent) Method name: void nodeVisited(NodeVisitedEvent)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (!event.isPre())
1
if (!event.isPre())
2
      {
2
      {
3
         Fqn<String> fqn = event.getFqn();
3
         Fqn<String> fqn = event.getFqn();
4
         System.out.println("MyListener - Created node " + fqn.toString());
4
         System.out.println("MyListener - Visited node " + fqn.toString());
5
         modified.add(fqn);
5
         accessed.add(fqn); 
6
      }
6
      }
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 comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (!event.isPre())
    1
    if (!event.isPre())
    1
    if (!event.isPre())
    Differences
    Expression1Expression2Difference
    org.jboss.cache.notifications.event.NodeCreatedEventorg.jboss.cache.notifications.event.NodeVisitedEventVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jboss.cache.notifications.event.NodeCreatedEvent of variable event does not match with type org.jboss.cache.notifications.event.NodeVisitedEvent of variable event
    • Make classes org.jboss.cache.notifications.event.NodeCreatedEvent and org.jboss.cache.notifications.event.NodeVisitedEvent extend a common superclass
    1
    if (!event.isPre())
    2
    Fqn<String> fqn = event.getFqn();
    2
    Fqn<String> fqn = event.getFqn();
    2
    Fqn<String> fqn = event.getFqn();
    Differences
    Expression1Expression2Difference
    org.jboss.cache.notifications.event.NodeCreatedEventorg.jboss.cache.notifications.event.NodeVisitedEventVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jboss.cache.notifications.event.NodeCreatedEvent of variable event does not match with type org.jboss.cache.notifications.event.NodeVisitedEvent of variable event
    • Make classes org.jboss.cache.notifications.event.NodeCreatedEvent and org.jboss.cache.notifications.event.NodeVisitedEvent extend a common superclass
    2
    Fqn<String> fqn = event.getFqn();
    3
    System.out.println("MyListener - Created node " + fqn.toString());
    3
    System.out.println("MyListener - Created node " + fqn.toString());
    3
    System.out.println("MyListener - Visited node " + fqn.toString());
    Differences
    Expression1Expression2Difference
    "MyListener - Created node ""MyListener - Visited node "LITERAL_VALUE_MISMATCH
    3
    System.out.println("MyListener - Visited node " + fqn.toString());
    4
    modified.add(fqn);
    4
    modified.add(fqn);
    4
    accessed.add(fqn);
    Differences
    Expression1Expression2Difference
    modifiedaccessedVARIABLE_NAME_MISMATCH
    4
    accessed.add(fqn);
    Precondition Violations (2)
    Row Violation
    1Type org.jboss.cache.notifications.event.NodeCreatedEvent of variable event does not match with type org.jboss.cache.notifications.event.NodeVisitedEvent of variable event
    2Type org.jboss.cache.notifications.event.NodeCreatedEvent of variable event does not match with type org.jboss.cache.notifications.event.NodeVisitedEvent of variable event