byte[] original = buildRecursively( BLOB_SIZE, true ); byte[] changed = buildRecursively( BLOB_SIZE, false ); Session s = openSession(); s.beginTransaction(); LobHolder entity = new LobHolder(); entity.setBlobLocator( Hibernate.createBlob( original ) ); s.save( entity ); s.getTransaction().commit(); s.close(); s = openSession(); s.beginTransaction(); entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() ); assertEquals( BLOB_SIZE, entity.getBlobLocator().length() ); assertEquals( original, extractData( entity.getBlobLocator() ) ); s.getTransaction().commit(); s.close(); // test mutation via setting the new clob data... if ( supportsLobValueChangePropogation() ) { s = openSession(); s.beginTransaction(); entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE ); entity.getBlobLocator().truncate( 1 ); entity.getBlobLocator().setBytes( 1, changed ); s.getTransaction().commit(); s.close(); s = openSession(); s.beginTransaction(); entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE ); assertNotNull( entity.getBlobLocator() ); assertEquals( BLOB_SIZE, entity.getBlobLocator().length() ); assertEquals( changed, extractData( entity.getBlobLocator() ) ); entity.getBlobLocator().truncate( 1 ); entity.getBlobLocator().setBytes( 1, original ); s.getTransaction().commit(); s.close(); } // test mutation via supplying a new clob locator instance... s = openSession(); s.beginTransaction(); entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE ); assertNotNull( entity.getBlobLocator() ); assertEquals( BLOB_SIZE, entity.getBlobLocator().length() ); assertEquals( original, extractData( entity.getBlobLocator() ) ); entity.setBlobLocator( Hibernate.createBlob( changed ) ); s.getTransaction().commit(); s.close(); s = openSession(); s.beginTransaction(); entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() ); assertEquals( BLOB_SIZE, entity.getBlobLocator().length() ); assertEquals( changed, extractData( entity.getBlobLocator() ) ); s.delete( entity ); s.getTransaction().commit(); s.close();
String original = buildRecursively( CLOB_SIZE, 'x' ); String changed = buildRecursively( CLOB_SIZE, 'y' ); Session s = openSession(); s.beginTransaction(); LobHolder entity = new LobHolder(); entity.setClobLocator( Hibernate.createClob( original ) ); s.save( entity ); s.getTransaction().commit(); s.close(); s = openSession(); s.beginTransaction(); entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() ); assertEquals( CLOB_SIZE, entity.getClobLocator().length() ); assertEquals( original, extractData( entity.getClobLocator() ) ); s.getTransaction().commit(); s.close(); // test mutation via setting the new clob data... if ( supportsLobValueChangePropogation() ) { s = openSession(); s.beginTransaction(); entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE ); entity.getClobLocator().truncate( 1 ); entity.getClobLocator().setString( 1, changed ); s.getTransaction().commit(); s.close(); s = openSession(); s.beginTransaction(); entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE ); assertNotNull( entity.getClobLocator() ); assertEquals( CLOB_SIZE, entity.getClobLocator().length() ); assertEquals( changed, extractData( entity.getClobLocator() ) ); entity.getClobLocator().truncate( 1 ); entity.getClobLocator().setString( 1, original ); s.getTransaction().commit(); s.close(); } // test mutation via supplying a new clob locator instance... s = openSession(); s.beginTransaction(); entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE ); assertNotNull( entity.getClobLocator() ); assertEquals( CLOB_SIZE, entity.getClobLocator().length() ); assertEquals( original, extractData( entity.getClobLocator() ) ); entity.setClobLocator( Hibernate.createClob( changed ) ); s.getTransaction().commit(); s.close(); s = openSession(); s.beginTransaction(); entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() ); assertEquals( CLOB_SIZE, entity.getClobLocator().length() ); assertEquals( changed, extractData( entity.getClobLocator() ) ); s.delete( entity ); s.getTransaction().commit(); s.close();
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/lob/BlobTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/lob/ClobTest.java
Method name: void testBoundedBlobLocatorAccess() Method name: void testBoundedClobLocatorAccess()
Number of AST nodes: 51 Number of AST nodes: 51
1
byte[] original = buildRecursively( BLOB_SIZE, true );
1
String original = buildRecursively( CLOB_SIZE, 'x' );
2
		byte[] changed = buildRecursively( BLOB_SIZE, false );
2
		String changed = buildRecursively( CLOB_SIZE, 'y' );
3
		Session s = openSession();
3
		Session s = openSession();
4
		s.beginTransaction();
4
		s.beginTransaction();
5
		LobHolder entity = new LobHolder();
5
		LobHolder entity = new LobHolder();
6
		entity.setBlobLocator( Hibernate.createBlob( original ) );
6
		entity.setClobLocator( Hibernate.createClob( original ) );
7
		s.save( entity );
7
		s.save( entity );
8
		s.getTransaction().commit();
8
		s.getTransaction().commit();
9
		s.close();
9
		s.close();
10
		s = openSession();
10
		s = openSession();
11
		s.beginTransaction();
11
		s.beginTransaction();
12
		entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() );
12
		entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() );
13
		assertEquals( BLOB_SIZE, entity.getBlobLocator().length() );
13
		assertEquals( CLOB_SIZE, entity.getClobLocator().length() );
14
		assertEquals( original, extractData( entity.getBlobLocator() ) );
14
		assertEquals( original, extractData( entity.getClobLocator() ) );
15
		s.getTransaction().commit();
15
		s.getTransaction().commit();
16
		s.close();
16
		s.close();
17
		// test mutation via setting the new clob data...
17
		// test mutation via setting the new clob data...
18
		if ( supportsLobValueChangePropogation() ) {
18
		if ( supportsLobValueChangePropogation() ) {
19
			s = openSession();
19
			s = openSession();
20
			s.beginTransaction();
20
			s.beginTransaction();
21
			entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE );
21
			entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE );
22
			entity.getBlobLocator().truncate( 1 );
22
			entity.getClobLocator().truncate( 1 );
23
			entity.getBlobLocator().setBytes( 1, changed );
23
			entity.getClobLocator().setString( 1, changed );
24
			s.getTransaction().commit();
24
			s.getTransaction().commit();
25
			s.close();
25
			s.close();
26
			s = openSession();
26
			s = openSession();
27
			s.beginTransaction();
27
			s.beginTransaction();
28
			entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE );
28
			entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE );
29
			assertNotNull( entity.getBlobLocator() );
29
			assertNotNull( entity.getClobLocator() );
30
			assertEquals( BLOB_SIZE, entity.getBlobLocator().length() );
30
			assertEquals( CLOB_SIZE, entity.getClobLocator().length() );
31
			assertEquals( changed, extractData( entity.getBlobLocator() ) );
31
			assertEquals( changed, extractData( entity.getClobLocator() ) );
32
			entity.getBlobLocator().truncate( 1 );
32
			entity.getClobLocator().truncate( 1 );
33
			entity.getBlobLocator().setBytes( 1, original );
33
			entity.getClobLocator().setString( 1, original );
34
			s.getTransaction().commit();
34
			s.getTransaction().commit();
35
			s.close();
35
			s.close();
36
		}
36
		}
37
		// test mutation via supplying a new clob locator instance...
37
		// test mutation via supplying a new clob locator instance...
38
		s = openSession();
38
		s = openSession();
39
		s.beginTransaction();
39
		s.beginTransaction();
40
		entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE );
40
		entity = ( LobHolder ) s.get( LobHolder.class, entity.getId(), LockMode.UPGRADE );
41
		assertNotNull( entity.getBlobLocator() );
41
		assertNotNull( entity.getClobLocator() );
42
		assertEquals( BLOB_SIZE, entity.getBlobLocator().length() );
42
		assertEquals( CLOB_SIZE, entity.getClobLocator().length() );
43
		assertEquals( original, extractData( entity.getBlobLocator() ) );
43
		assertEquals( original, extractData( entity.getClobLocator() ) );
44
		entity.setBlobLocator( Hibernate.createBlob( changed ) );
44
		entity.setClobLocator( Hibernate.createClob( changed ) );
45
		s.getTransaction().commit();
45
		s.getTransaction().commit();
46
		s.close();
46
		s.close();
47
		s = openSession();
47
		s = openSession();
48
		s.beginTransaction();
48
		s.beginTransaction();
49
		entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() );
49
		entity = ( LobHolder ) s.get( LobHolder.class, entity.getId() );
50
		assertEquals( BLOB_SIZE, entity.getBlobLocator().length() );
50
		assertEquals( CLOB_SIZE, entity.getClobLocator().length() );
51
		assertEquals( changed, extractData( entity.getBlobLocator() ) );
51
		assertEquals( changed, extractData( entity.getClobLocator() ) );
52
		s.delete( entity );
52
		s.delete( entity );
53
		s.getTransaction().commit();
53
		s.getTransaction().commit();
54
		s.close();
54
		s.close();
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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons563
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements45
    Number of unmapped statements in the first code fragment6
    Number of unmapped statements in the second code fragment6
    Time elapsed for statement mapping (ms)103.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                          
    1
    String original = buildRecursively(CLOB_SIZE, 'x');
    1
    byte[] original = buildRecursively(BLOB_SIZE, true);
                                                                                                            
                                                                                                        
    2
    String changed = buildRecursively(CLOB_SIZE, 'y');
    2
    byte[] changed = buildRecursively(BLOB_SIZE, false);
                                                                                                            
    3
    Session s = openSession();
    3
    Session s = openSession();
    4
    s.beginTransaction();
    4
    s.beginTransaction();
    5
    LobHolder entity = new LobHolder();
    5
    LobHolder entity = new LobHolder();
    6
    entity.setBlobLocator(Hibernate.createBlob(original));
    6
    entity.setBlobLocator(Hibernate.createBlob(original));
    6
    entity.setClobLocator(Hibernate.createClob(original));
    Differences
    Expression1Expression2Difference
    byte[]java.lang.StringVARIABLE_TYPE_MISMATCH
    createBlobcreateClobMETHOD_INVOCATION_NAME_MISMATCH
    java.sql.Blobjava.sql.ClobVARIABLE_TYPE_MISMATCH
    setBlobLocatorsetClobLocatorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Type byte[] of variable original does not match with type java.lang.String of variable original
    • Make classes byte[] and java.lang.String extend a common superclass
    Expression Hibernate.createBlob(original) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Hibernate.createClob(original) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.sql.Blob of variable Hibernate.createBlob(original) does not match with type java.sql.Clob of variable Hibernate.createClob(original)
    • Make classes java.sql.Blob and java.sql.Clob extend a common superclass
    Expression entity.setBlobLocator(Hibernate.createBlob(original)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.setClobLocator(Hibernate.createClob(original)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.setBlobLocator(Hibernate.createBlob(original)) is a void method call, and thus it cannot be parameterized
    Expression entity.setClobLocator(Hibernate.createClob(original)) is a void method call, and thus it cannot be parameterized
    6
    entity.setClobLocator(Hibernate.createClob(original));
    7
    s.save(entity);
    7
    s.save(entity);
    8
    s.getTransaction().commit();
    8
    s.getTransaction().commit();
    9
    s.close();
    9
    s.close();
    10
    s = openSession();
    10
    s = openSession();
    11
    s.beginTransaction();
    11
    s.beginTransaction();
    12
    entity = (LobHolder)s.get(LobHolder.class, entity.getId());
    12
    entity = (LobHolder)s.get(LobHolder.class, entity.getId());
                                                                                                                              
    13
    assertEquals(CLOB_SIZE, entity.getClobLocator().length());
    Preondition Violations
    Unmatched statement assertEquals(CLOB_SIZE,entity.getClobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    13
    assertEquals(CLOB_SIZE, entity.getClobLocator().length());
    13
    assertEquals(BLOB_SIZE, entity.getBlobLocator().length());
    13
    assertEquals(BLOB_SIZE, entity.getBlobLocator().length());
    Preondition Violations
    Unmatched statement assertEquals(BLOB_SIZE,entity.getBlobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                              
    14
    assertEquals(original, extractData(entity.getBlobLocator()));
    14
    assertEquals(original, extractData(entity.getBlobLocator()));
    14
    assertEquals(original, extractData(entity.getClobLocator()));
    Differences
    Expression1Expression2Difference
    byte[]java.lang.StringVARIABLE_TYPE_MISMATCH
    getBlobLocatorgetClobLocatorMETHOD_INVOCATION_NAME_MISMATCH
    java.sql.Blobjava.sql.ClobVARIABLE_TYPE_MISMATCH
    byte[]java.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type byte[] of variable original does not match with type java.lang.String of variable original
    • Make classes byte[] and java.lang.String extend a common superclass
    Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    • Make classes java.sql.Blob and java.sql.Clob extend a common superclass
    Expression extractData(entity.getBlobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method extractData
    Expression extractData(entity.getClobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method extractData
    Type byte[] of variable extractData(entity.getBlobLocator()) does not match with type java.lang.String of variable extractData(entity.getClobLocator())
    • Make classes byte[] and java.lang.String extend a common superclass
    14
    assertEquals(original, extractData(entity.getClobLocator()));
    15
    s.getTransaction().commit();
    15
    s.getTransaction().commit();
    16
    s.close();
    16
    s.close();
    17
    if (supportsLobValueChangePropogation())
    17
    if (supportsLobValueChangePropogation())
    18
    s = openSession();
    18
    s = openSession();
    19
    s.beginTransaction();
    19
    s.beginTransaction();
    20
    entity = (LobHolder)s.get(LobHolder.class, entity.getId(), LockMode.UPGRADE);
    20
    entity = (LobHolder)s.get(LobHolder.class, entity.getId(), LockMode.UPGRADE);
    21
    entity.getBlobLocator().truncate(1);
    21
    entity.getBlobLocator().truncate(1);
    21
    entity.getClobLocator().truncate(1);
    Differences
    Expression1Expression2Difference
    getBlobLocatorgetClobLocatorMETHOD_INVOCATION_NAME_MISMATCH
    java.sql.Blobjava.sql.ClobVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    • Make classes java.sql.Blob and java.sql.Clob extend a common superclass
    21
    entity.getClobLocator().truncate(1);
    22
    entity.getBlobLocator().setBytes(1, changed);
    22
    entity.getBlobLocator().setBytes(1, changed);
    22
    entity.getClobLocator().setString(1, changed);
    Differences
    Expression1Expression2Difference
    byte[]java.lang.StringVARIABLE_TYPE_MISMATCH
    setBytessetStringMETHOD_INVOCATION_NAME_MISMATCH
    getBlobLocatorgetClobLocatorMETHOD_INVOCATION_NAME_MISMATCH
    java.sql.Blobjava.sql.ClobVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type byte[] of variable changed does not match with type java.lang.String of variable changed
    • Make classes byte[] and java.lang.String extend a common superclass
    Expression entity.getBlobLocator().setBytes(1,changed) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getClobLocator().setString(1,changed) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getBlobLocator().setBytes(1,changed) is a void method call, and thus it cannot be parameterized
    Expression entity.getClobLocator().setString(1,changed) is a void method call, and thus it cannot be parameterized
    Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    • Make classes java.sql.Blob and java.sql.Clob extend a common superclass
    22
    entity.getClobLocator().setString(1, changed);
    23
    s.getTransaction().commit();
    23
    s.getTransaction().commit();
    24
    s.close();
    24
    s.close();
    25
    s = openSession();
    25
    s = openSession();
    26
    s.beginTransaction();
    26
    s.beginTransaction();
    27
    entity = (LobHolder)s.get(LobHolder.class, entity.getId(), LockMode.UPGRADE);
    27
    entity = (LobHolder)s.get(LobHolder.class, entity.getId(), LockMode.UPGRADE);
    28
    assertNotNull(entity.getBlobLocator());
    28
    assertNotNull(entity.getBlobLocator());
    28
    assertNotNull(entity.getClobLocator());
    Differences
    Expression1Expression2Difference
    getBlobLocatorgetClobLocatorMETHOD_INVOCATION_NAME_MISMATCH
    java.sql.Blobjava.sql.ClobVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    • Make classes java.sql.Blob and java.sql.Clob extend a common superclass
    28
    assertNotNull(entity.getClobLocator());
                                                                                                                              
    29
    assertEquals(CLOB_SIZE, entity.getClobLocator().length());
    Preondition Violations
    Unmatched statement assertEquals(CLOB_SIZE,entity.getClobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement assertEquals(CLOB_SIZE,entity.getClobLocator().length()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    29
    assertEquals(CLOB_SIZE, entity.getClobLocator().length());
    29
    assertEquals(BLOB_SIZE, entity.getBlobLocator().length());
    29
    assertEquals(BLOB_SIZE, entity.getBlobLocator().length());
    Preondition Violations
    Unmatched statement assertEquals(BLOB_SIZE,entity.getBlobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement assertEquals(BLOB_SIZE,entity.getBlobLocator().length()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                                              
    30
    assertEquals(changed, extractData(entity.getBlobLocator()));
    30
    assertEquals(changed, extractData(entity.getBlobLocator()));
    30
    assertEquals(changed, extractData(entity.getClobLocator()));
    Differences
    Expression1Expression2Difference
    byte[]java.lang.StringVARIABLE_TYPE_MISMATCH
    getBlobLocatorgetClobLocatorMETHOD_INVOCATION_NAME_MISMATCH
    java.sql.Blobjava.sql.ClobVARIABLE_TYPE_MISMATCH
    byte[]java.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type byte[] of variable changed does not match with type java.lang.String of variable changed
    • Make classes byte[] and java.lang.String extend a common superclass
    Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    • Make classes java.sql.Blob and java.sql.Clob extend a common superclass
    Expression extractData(entity.getBlobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method extractData
    Expression extractData(entity.getClobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method extractData
    Type byte[] of variable extractData(entity.getBlobLocator()) does not match with type java.lang.String of variable extractData(entity.getClobLocator())
    • Make classes byte[] and java.lang.String extend a common superclass
    30
    assertEquals(changed, extractData(entity.getClobLocator()));
    31
    entity.getBlobLocator().truncate(1);
    31
    entity.getBlobLocator().truncate(1);
    31
    entity.getClobLocator().truncate(1);
    Differences
    Expression1Expression2Difference
    getBlobLocatorgetClobLocatorMETHOD_INVOCATION_NAME_MISMATCH
    java.sql.Blobjava.sql.ClobVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    • Make classes java.sql.Blob and java.sql.Clob extend a common superclass
    31
    entity.getClobLocator().truncate(1);
    32
    entity.getBlobLocator().setBytes(1, original);
    32
    entity.getBlobLocator().setBytes(1, original);
    32
    entity.getClobLocator().setString(1, original);
    Differences
    Expression1Expression2Difference
    byte[]java.lang.StringVARIABLE_TYPE_MISMATCH
    setBytessetStringMETHOD_INVOCATION_NAME_MISMATCH
    getBlobLocatorgetClobLocatorMETHOD_INVOCATION_NAME_MISMATCH
    java.sql.Blobjava.sql.ClobVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type byte[] of variable original does not match with type java.lang.String of variable original
    • Make classes byte[] and java.lang.String extend a common superclass
    Expression entity.getBlobLocator().setBytes(1,original) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getClobLocator().setString(1,original) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getBlobLocator().setBytes(1,original) is a void method call, and thus it cannot be parameterized
    Expression entity.getClobLocator().setString(1,original) is a void method call, and thus it cannot be parameterized
    Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    • Make classes java.sql.Blob and java.sql.Clob extend a common superclass
    32
    entity.getClobLocator().setString(1, original);
    33
    s.getTransaction().commit();
    33
    s.getTransaction().commit();
    34
    s.close();
    34
    s.close();
    35
    s = openSession();
    35
    s = openSession();
    36
    s.beginTransaction();
    36
    s.beginTransaction();
    37
    entity = (LobHolder)s.get(LobHolder.class, entity.getId(), LockMode.UPGRADE);
    37
    entity = (LobHolder)s.get(LobHolder.class, entity.getId(), LockMode.UPGRADE);
    38
    assertNotNull(entity.getBlobLocator());
    38
    assertNotNull(entity.getBlobLocator());
    38
    assertNotNull(entity.getClobLocator());
    Differences
    Expression1Expression2Difference
    getBlobLocatorgetClobLocatorMETHOD_INVOCATION_NAME_MISMATCH
    java.sql.Blobjava.sql.ClobVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    • Make classes java.sql.Blob and java.sql.Clob extend a common superclass
    38
    assertNotNull(entity.getClobLocator());
                                                                                                                              
    39
    assertEquals(CLOB_SIZE, entity.getClobLocator().length());
    Preondition Violations
    Unmatched statement assertEquals(CLOB_SIZE,entity.getClobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    39
    assertEquals(CLOB_SIZE, entity.getClobLocator().length());
    39
    assertEquals(BLOB_SIZE, entity.getBlobLocator().length());
    39
    assertEquals(BLOB_SIZE, entity.getBlobLocator().length());
    Preondition Violations
    Unmatched statement assertEquals(BLOB_SIZE,entity.getBlobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                              
    40
    assertEquals(original, extractData(entity.getBlobLocator()));
    40
    assertEquals(original, extractData(entity.getBlobLocator()));
    40
    assertEquals(original, extractData(entity.getClobLocator()));
    Differences
    Expression1Expression2Difference
    byte[]java.lang.StringVARIABLE_TYPE_MISMATCH
    getBlobLocatorgetClobLocatorMETHOD_INVOCATION_NAME_MISMATCH
    java.sql.Blobjava.sql.ClobVARIABLE_TYPE_MISMATCH
    byte[]java.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type byte[] of variable original does not match with type java.lang.String of variable original
    • Make classes byte[] and java.lang.String extend a common superclass
    Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    • Make classes java.sql.Blob and java.sql.Clob extend a common superclass
    Expression extractData(entity.getBlobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method extractData
    Expression extractData(entity.getClobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method extractData
    Type byte[] of variable extractData(entity.getBlobLocator()) does not match with type java.lang.String of variable extractData(entity.getClobLocator())
    • Make classes byte[] and java.lang.String extend a common superclass
    40
    assertEquals(original, extractData(entity.getClobLocator()));
    41
    entity.setBlobLocator(Hibernate.createBlob(changed));
    41
    entity.setBlobLocator(Hibernate.createBlob(changed));
    41
    entity.setClobLocator(Hibernate.createClob(changed));
    Differences
    Expression1Expression2Difference
    byte[]java.lang.StringVARIABLE_TYPE_MISMATCH
    createBlobcreateClobMETHOD_INVOCATION_NAME_MISMATCH
    java.sql.Blobjava.sql.ClobVARIABLE_TYPE_MISMATCH
    setBlobLocatorsetClobLocatorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Type byte[] of variable changed does not match with type java.lang.String of variable changed
    • Make classes byte[] and java.lang.String extend a common superclass
    Expression Hibernate.createBlob(changed) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Hibernate.createClob(changed) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.sql.Blob of variable Hibernate.createBlob(changed) does not match with type java.sql.Clob of variable Hibernate.createClob(changed)
    • Make classes java.sql.Blob and java.sql.Clob extend a common superclass
    Expression entity.setBlobLocator(Hibernate.createBlob(changed)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.setClobLocator(Hibernate.createClob(changed)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.setBlobLocator(Hibernate.createBlob(changed)) is a void method call, and thus it cannot be parameterized
    Expression entity.setClobLocator(Hibernate.createClob(changed)) is a void method call, and thus it cannot be parameterized
    41
    entity.setClobLocator(Hibernate.createClob(changed));
    42
    s.getTransaction().commit();
    42
    s.getTransaction().commit();
    43
    s.close();
    43
    s.close();
    44
    s = openSession();
    44
    s = openSession();
    45
    s.beginTransaction();
    45
    s.beginTransaction();
    46
    entity = (LobHolder)s.get(LobHolder.class, entity.getId());
    46
    entity = (LobHolder)s.get(LobHolder.class, entity.getId());
                                                                                                                              
    47
    assertEquals(CLOB_SIZE, entity.getClobLocator().length());
    Preondition Violations
    Unmatched statement assertEquals(CLOB_SIZE,entity.getClobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    47
    assertEquals(CLOB_SIZE, entity.getClobLocator().length());
    47
    assertEquals(BLOB_SIZE, entity.getBlobLocator().length());
    47
    assertEquals(BLOB_SIZE, entity.getBlobLocator().length());
    Preondition Violations
    Unmatched statement assertEquals(BLOB_SIZE,entity.getBlobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                              
    48
    assertEquals(changed, extractData(entity.getBlobLocator()));
    48
    assertEquals(changed, extractData(entity.getBlobLocator()));
    48
    assertEquals(changed, extractData(entity.getClobLocator()));
    Differences
    Expression1Expression2Difference
    byte[]java.lang.StringVARIABLE_TYPE_MISMATCH
    getBlobLocatorgetClobLocatorMETHOD_INVOCATION_NAME_MISMATCH
    java.sql.Blobjava.sql.ClobVARIABLE_TYPE_MISMATCH
    byte[]java.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type byte[] of variable changed does not match with type java.lang.String of variable changed
    • Make classes byte[] and java.lang.String extend a common superclass
    Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    • Make classes java.sql.Blob and java.sql.Clob extend a common superclass
    Expression extractData(entity.getBlobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method extractData
    Expression extractData(entity.getClobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method extractData
    Type byte[] of variable extractData(entity.getBlobLocator()) does not match with type java.lang.String of variable extractData(entity.getClobLocator())
    • Make classes byte[] and java.lang.String extend a common superclass
    48
    assertEquals(changed, extractData(entity.getClobLocator()));
    49
    s.delete(entity);
    49
    s.delete(entity);
    50
    s.getTransaction().commit();
    50
    s.getTransaction().commit();
    51
    s.close();
    51
    s.close();
    Precondition Violations (82)
    Row Violation
    1Type byte[] of variable original does not match with type java.lang.String of variable original
    2Expression Hibernate.createBlob(original) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression Hibernate.createClob(original) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.sql.Blob of variable Hibernate.createBlob(original) does not match with type java.sql.Clob of variable Hibernate.createClob(original)
    5Expression entity.setBlobLocator(Hibernate.createBlob(original)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression entity.setClobLocator(Hibernate.createClob(original)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression entity.setBlobLocator(Hibernate.createBlob(original)) is a void method call, and thus it cannot be parameterized
    8Expression entity.setClobLocator(Hibernate.createClob(original)) is a void method call, and thus it cannot be parameterized
    9Unmatched statement assertEquals(CLOB_SIZE,entity.getClobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10Unmatched statement assertEquals(BLOB_SIZE,entity.getBlobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11Type byte[] of variable original does not match with type java.lang.String of variable original
    12Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    15Expression extractData(entity.getBlobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression extractData(entity.getClobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Type byte[] of variable extractData(entity.getBlobLocator()) does not match with type java.lang.String of variable extractData(entity.getClobLocator())
    18Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    21Type byte[] of variable changed does not match with type java.lang.String of variable changed
    22Expression entity.getBlobLocator().setBytes(1,changed) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Expression entity.getClobLocator().setString(1,changed) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Expression entity.getBlobLocator().setBytes(1,changed) is a void method call, and thus it cannot be parameterized
    25Expression entity.getClobLocator().setString(1,changed) is a void method call, and thus it cannot be parameterized
    26Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    27Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    28Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    29Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    30Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    31Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    32Unmatched statement assertEquals(CLOB_SIZE,entity.getClobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    33Unmatched statement assertEquals(CLOB_SIZE,entity.getClobLocator().length()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    34Unmatched statement assertEquals(BLOB_SIZE,entity.getBlobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    35Unmatched statement assertEquals(BLOB_SIZE,entity.getBlobLocator().length()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    36Type byte[] of variable changed does not match with type java.lang.String of variable changed
    37Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    38Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    39Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    40Expression extractData(entity.getBlobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    41Expression extractData(entity.getClobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    42Type byte[] of variable extractData(entity.getBlobLocator()) does not match with type java.lang.String of variable extractData(entity.getClobLocator())
    43Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    44Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    45Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    46Type byte[] of variable original does not match with type java.lang.String of variable original
    47Expression entity.getBlobLocator().setBytes(1,original) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    48Expression entity.getClobLocator().setString(1,original) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    49Expression entity.getBlobLocator().setBytes(1,original) is a void method call, and thus it cannot be parameterized
    50Expression entity.getClobLocator().setString(1,original) is a void method call, and thus it cannot be parameterized
    51Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    52Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    53Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    54Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    55Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    56Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    57Unmatched statement assertEquals(CLOB_SIZE,entity.getClobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    58Unmatched statement assertEquals(BLOB_SIZE,entity.getBlobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    59Type byte[] of variable original does not match with type java.lang.String of variable original
    60Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    61Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    62Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    63Expression extractData(entity.getBlobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    64Expression extractData(entity.getClobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    65Type byte[] of variable extractData(entity.getBlobLocator()) does not match with type java.lang.String of variable extractData(entity.getClobLocator())
    66Type byte[] of variable changed does not match with type java.lang.String of variable changed
    67Expression Hibernate.createBlob(changed) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    68Expression Hibernate.createClob(changed) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    69Type java.sql.Blob of variable Hibernate.createBlob(changed) does not match with type java.sql.Clob of variable Hibernate.createClob(changed)
    70Expression entity.setBlobLocator(Hibernate.createBlob(changed)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    71Expression entity.setClobLocator(Hibernate.createClob(changed)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    72Expression entity.setBlobLocator(Hibernate.createBlob(changed)) is a void method call, and thus it cannot be parameterized
    73Expression entity.setClobLocator(Hibernate.createClob(changed)) is a void method call, and thus it cannot be parameterized
    74Unmatched statement assertEquals(CLOB_SIZE,entity.getClobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    75Unmatched statement assertEquals(BLOB_SIZE,entity.getBlobLocator().length()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    76Type byte[] of variable changed does not match with type java.lang.String of variable changed
    77Expression entity.getBlobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    78Expression entity.getClobLocator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    79Type java.sql.Blob of variable entity.getBlobLocator() does not match with type java.sql.Clob of variable entity.getClobLocator()
    80Expression extractData(entity.getBlobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    81Expression extractData(entity.getClobLocator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    82Type byte[] of variable extractData(entity.getBlobLocator()) does not match with type java.lang.String of variable extractData(entity.getClobLocator())