ISQLDatabaseMetaData md = TestUtil.getEasyMockSQLMetaData(fromDb, null); TableColumnInfo column = TestUtil.getClobColumnInfo(md, true); // This is for brute force detection of BLOB/CLOB lengths if necessary ResultSet rs = getColLengthResult(); testColType(md, toDb, column, rs);
ISQLDatabaseMetaData md = TestUtil.getEasyMockSQLMetaData(fromDb, null); TableColumnInfo column = TestUtil.getBinaryColumnInfo(md, true); // This is for brute force detection of columns whose column size is 0 ResultSet rs = getColLengthResult(); testColType(md, toDb, column, rs);
Clone fragments detected by clone detection tool
File path: /sql12/test/src/net/sourceforge/squirrel_sql/plugins/dbcopy/ColTypeMapperTest.java File path: /sql12/test/src/net/sourceforge/squirrel_sql/plugins/dbcopy/ColTypeMapperTest.java
Method name: void testClobColType(String, String) Method name: void testBinaryColType(String, String)
Number of AST nodes: 4 Number of AST nodes: 4
1
ISQLDatabaseMetaData md = TestUtil.getEasyMockSQLMetaData(fromDb, null);
1
ISQLDatabaseMetaData md = TestUtil.getEasyMockSQLMetaData(fromDb, null);
2
        TableColumnInfo column = TestUtil.getClobColumnInfo(md, true);
2
        TableColumnInfo column = TestUtil.getBinaryColumnInfo(md, true);
3
        // This is for brute force detection of BLOB/CLOB lengths if necessary
3
        // This is for brute force detection of columns whose column size is 0
4
        ResultSet rs = getColLengthResult();
4
        ResultSet rs = getColLengthResult();
5
        testColType(md, toDb, column, rs);
5
        testColType(md, toDb, column, rs);
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 comparisons16
  1. {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
    ISQLDatabaseMetaData md = TestUtil.getEasyMockSQLMetaData(fromDb, null);
    1
    ISQLDatabaseMetaData md = TestUtil.getEasyMockSQLMetaData(fromDb, null);
    2
    TableColumnInfo column = TestUtil.getClobColumnInfo(md, true);
    2
    TableColumnInfo column = TestUtil.getClobColumnInfo(md, true);
    2
    TableColumnInfo column = TestUtil.getBinaryColumnInfo(md, true);
    Differences
    Expression1Expression2Difference
    getClobColumnInfogetBinaryColumnInfoMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression TestUtil.getClobColumnInfo(md,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression TestUtil.getBinaryColumnInfo(md,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    TableColumnInfo column = TestUtil.getBinaryColumnInfo(md, true);
    3
    ResultSet rs = getColLengthResult();
    3
    ResultSet rs = getColLengthResult();
    4
    testColType(md, toDb, column, rs);
    4
    testColType(md, toDb, column, rs);
    Precondition Violations (2)
    Row Violation
    1Expression TestUtil.getClobColumnInfo(md,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression TestUtil.getBinaryColumnInfo(md,true) cannot be parameterized, because it has dependencies to/from statements that will be extracted