Configuration cfg = new Configuration(); assertNotNull( cfg.getEventListeners().getDeleteEventListeners() ); cfg.setListeners( "delete", null ); assertEquals( 0, cfg.getEventListeners().getDeleteEventListeners().length );
Configuration cfg = new Configuration(); assertNotNull( cfg.getEventListeners().getDeleteEventListeners() ); cfg.setListener( "delete", null ); assertEquals( 0, cfg.getEventListeners().getDeleteEventListeners().length );
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/cfg/ListenerTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/cfg/ListenerTest.java
Method name: void testSetListenersNullClass() Method name: void testSetListenerNullClass()
Number of AST nodes: 4 Number of AST nodes: 4
1
Configuration cfg = new Configuration();
1
Configuration cfg = new Configuration();
2
		assertNotNull( cfg.getEventListeners().getDeleteEventListeners() );
2
		assertNotNull( cfg.getEventListeners().getDeleteEventListeners() );
3
		cfg.setListeners( "delete", null );
3
		cfg.setListener( "delete", null );
4
		assertEquals( 0, cfg.getEventListeners().getDeleteEventListeners().length );
4
		assertEquals( 0, cfg.getEventListeners().getDeleteEventListeners().length );
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.0
Clones locationClones are declared in the same class
Number of node comparisons8
  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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Configuration cfg = new Configuration();
    1
    Configuration cfg = new Configuration();
    2
    assertNotNull(cfg.getEventListeners().getDeleteEventListeners());
    2
    assertNotNull(cfg.getEventListeners().getDeleteEventListeners());
    3
    cfg.setListeners("delete", null);
    3
    cfg.setListeners("delete", null);
    3
    cfg.setListener("delete", null);
    Differences
    Expression1Expression2Difference
    setListenerssetListenerMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression cfg.setListeners("delete",null) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cfg.setListener("delete",null) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cfg.setListeners("delete",null) is a void method call, and thus it cannot be parameterized
    Expression cfg.setListener("delete",null) is a void method call, and thus it cannot be parameterized
    3
    cfg.setListener("delete", null);
    4
    assertEquals(0, cfg.getEventListeners().getDeleteEventListeners().length);
    4
    assertEquals(0, cfg.getEventListeners().getDeleteEventListeners().length);
    Precondition Violations (4)
    Row Violation
    1Expression cfg.setListeners("delete",null) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression cfg.setListener("delete",null) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression cfg.setListeners("delete",null) is a void method call, and thus it cannot be parameterized
    4Expression cfg.setListener("delete",null) is a void method call, and thus it cannot be parameterized