Configuration cfg = new Configuration(); assertNotNull( cfg.getEventListeners().getDeleteEventListeners() ); try { cfg.setListener( "delete", new String[] { } ); fail( "should have thrown java.lang.ArrayStoreException" );
Configuration cfg = new Configuration(); assertNotNull( cfg.getEventListeners().getDeleteEventListeners() ); try { cfg.setListener( null, new DeleteListenerForTest() ); fail( "should have thrown MappingException" );
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 testSetListenerEmptyClassNameArray() Method name: void testSetListenerNullType()
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
		try {
3
		try {
4
			cfg.setListener( "delete", new String[] { } );
4
			cfg.setListener( null, new DeleteListenerForTest() );
5
			fail( "should have thrown java.lang.ArrayStoreException" );
5
			fail( "should have thrown MappingException" );
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 declared in the same class
Number of node comparisons2
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    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
    Configuration cfg = new Configuration();
    1
    Configuration cfg = new Configuration();
    2
    assertNotNull(cfg.getEventListeners().getDeleteEventListeners());
    2
    assertNotNull(cfg.getEventListeners().getDeleteEventListeners());
    Precondition Violations (0)
    Row Violation