if (!event.isPre()) { Fqn<String> fqn = event.getFqn(); System.out.println("MyListener - Modified node " + fqn.toString()); modified.add(fqn); }
if (!event.isPre()) { Fqn<String> fqn = event.getFqn(); System.out.println("MyListener - Created node " + fqn.toString()); modified.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 nodeModified(NodeModifiedEvent) Method name: void nodeCreated(NodeCreatedEvent)
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 - Modified node " + fqn.toString());
4
         System.out.println("MyListener - Created node " + fqn.toString());
5
         modified.add(fqn);
5
         modified.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.9
    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.NodeModifiedEventorg.jboss.cache.notifications.event.NodeCreatedEventVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jboss.cache.notifications.event.NodeModifiedEvent of variable event does not match with type org.jboss.cache.notifications.event.NodeCreatedEvent of variable event
    • Make classes org.jboss.cache.notifications.event.NodeModifiedEvent and org.jboss.cache.notifications.event.NodeCreatedEvent 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.NodeModifiedEventorg.jboss.cache.notifications.event.NodeCreatedEventVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jboss.cache.notifications.event.NodeModifiedEvent of variable event does not match with type org.jboss.cache.notifications.event.NodeCreatedEvent of variable event
    • Make classes org.jboss.cache.notifications.event.NodeModifiedEvent and org.jboss.cache.notifications.event.NodeCreatedEvent extend a common superclass
    2
    Fqn<String> fqn = event.getFqn();
    3
    System.out.println("MyListener - Modified node " + fqn.toString());
    3
    System.out.println("MyListener - Modified node " + fqn.toString());
    3
    System.out.println("MyListener - Created node " + fqn.toString());
    Differences
    Expression1Expression2Difference
    "MyListener - Modified node ""MyListener - Created node "LITERAL_VALUE_MISMATCH
    3
    System.out.println("MyListener - Created node " + fqn.toString());
    4
    modified.add(fqn);
    4
    modified.add(fqn);
    Precondition Violations (2)
    Row Violation
    1Type org.jboss.cache.notifications.event.NodeModifiedEvent of variable event does not match with type org.jboss.cache.notifications.event.NodeCreatedEvent of variable event
    2Type org.jboss.cache.notifications.event.NodeModifiedEvent of variable event does not match with type org.jboss.cache.notifications.event.NodeCreatedEvent of variable event