Configuration cfg = new Configuration();
assertNotNull( cfg.getEventListeners().getDeleteEventListeners() );
try {
cfg.setListener( "delete", new String[] { } );
fail( "should have thrown java.lang.ArrayStoreException" );
}
catch ( ArrayStoreException ex ) {
// expected
}
Configuration cfg = new Configuration();
assertNotNull( cfg.getEventListeners().getDeleteEventListeners() );
try {
cfg.setListener( "delete", new Object[] { } );
fail( "should have thrown java.lang.ArrayStoreException" );
}
catch ( ArrayStoreException ex ) {
// expected
}
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 testSetListenerEmptyClassObjectArray()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
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( "delete", new Object[] { } );↵
|
5 | fail( "should have thrown java.lang.ArrayStoreException" );↵ | | 5 | fail( "should have thrown java.lang.ArrayStoreException" );↵
|
6 | }↵ | | 6 | }↵
|
7 | catch ( ArrayStoreException ex ) {↵ | | 7 | catch ( ArrayStoreException ex ) {↵
|
8 | // expected↵ | | 8 | // expected↵
|
9 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 11 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 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 | try | | 3 | try |
4 | cfg.setListener("delete", new String[] {}); | | 4 | cfg.setListener("delete", new Object[] {}); |
5 | fail("should have thrown java.lang.ArrayStoreException"); | | 5 | fail("should have thrown java.lang.ArrayStoreException"); |
Precondition Violations (1)
Row |
Violation |
1 | Type java.lang.String of variable String does not match with type java.lang.Object of variable Object |