final ISession session = getSession(); final IDatabaseObjectInfo doi = getDatabaseObjectInfo(); ISQLConnection conn = session.getSQLConnection(); if (s_log.isDebugEnabled()) { s_log.debug("Running SQL for View source tab: "+SQL); s_log.debug("Binding catalog name "+doi.getCatalogName()+ " as first bind value"); s_log.debug("Binding table name "+doi.getSimpleName()+ " as second bind value"); } PreparedStatement pstmt = conn.prepareStatement(SQL); pstmt.setString(1, doi.getCatalogName()); pstmt.setString(2, doi.getSimpleName()); return pstmt;
final ISession session = getSession(); final IDatabaseObjectInfo doi = getDatabaseObjectInfo(); ISQLConnection conn = session.getSQLConnection(); if (s_log.isDebugEnabled()) { s_log.debug("Running SQL for View source tab: "+SQL); s_log.debug("Binding for param 1: "+doi.getCatalogName()); s_log.debug("Binding for param 2: "+doi.getSimpleName()); } PreparedStatement pstmt = conn.prepareStatement(SQL); pstmt.setString(1, doi.getCatalogName()); pstmt.setString(2, doi.getSimpleName()); return pstmt;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/mysql/src/net/sourceforge/squirrel_sql/plugins/mysql/tab/MysqlTriggerSourceTab.java File path: /sql12/plugins/sybase/src/net/sourceforge/squirrel_sql/plugins/SybaseASE/tab/ViewSourceTab.java
Method name: PreparedStatement createStatement() Method name: PreparedStatement createStatement()
Number of AST nodes: 11 Number of AST nodes: 11
1
final ISession session = getSession();
1
final ISession session = getSession();
2
		final IDatabaseObjectInfo doi = getDatabaseObjectInfo();
2
		final IDatabaseObjectInfo doi = getDatabaseObjectInfo();
3
		ISQLConnection conn = session.getSQLConnection();
3
		ISQLConnection conn = session.getSQLConnection();
4
        if (s_log.isDebugEnabled()) {
4
        if (s_log.isDebugEnabled()) {
5
            s_log.debug("Running SQL for View source tab: "+SQL);
5
            s_log.debug("Running SQL for View source tab: "+SQL);
6
            s_log.debug("Binding catalog name "+doi.getCatalogName()+
6
            s_log.debug("Binding for param 1: "+doi.getCatalogName()
7
                        " as first bind value");
7
);
8
            s_log.debug("Binding table name "+doi.getSimpleName()+
8
            s_log.debug("Binding for param 2: "+doi.getSimpleName()
9
                        " as second bind value");                        
9
);
10
        }
10
        }
11
		PreparedStatement pstmt = conn.prepareStatement(SQL);
11
		PreparedStatement pstmt = conn.prepareStatement(SQL);
12
        
12
        
13
        pstmt.setString(1, doi.getCatalogName());
13
        pstmt.setString(1, doi.getCatalogName());
14
		pstmt.setString(2, doi.getSimpleName());
14
		pstmt.setString(2, doi.getSimpleName());
15
		return pstmt;
15
		return pstmt;
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons65
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)74.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    final ISession session = getSession();
    1
    final ISession session = getSession();
    2
    final IDatabaseObjectInfo doi = getDatabaseObjectInfo();
    2
    final IDatabaseObjectInfo doi = getDatabaseObjectInfo();
    3
    ISQLConnection conn = session.getSQLConnection();
    3
    ISQLConnection conn = session.getSQLConnection();
    4
    if (s_log.isDebugEnabled())
    4
    if (s_log.isDebugEnabled())
    5
    s_log.debug("Running SQL for View source tab: " + SQL);
    5
    s_log.debug("Running SQL for View source tab: " + SQL);
    6
    s_log.debug("Binding catalog name " + doi.getCatalogName() + " as first bind value");
    6
    s_log.debug("Binding catalog name " + doi.getCatalogName() + " as first bind value");
    6
    s_log.debug("Binding for param 1: " + doi.getCatalogName());
    Differences
    Expression1Expression2Difference
    "Binding catalog name ""Binding for param 1: "LITERAL_VALUE_MISMATCH
    "Binding catalog name " + doi.getCatalogName() + " as first bind value""Binding for param 1: " + doi.getCatalogName()INFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    Preondition Violations
    Expression "Binding catalog name " + doi.getCatalogName() + " as first bind value" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression "Binding for param 1: " + doi.getCatalogName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    s_log.debug("Binding for param 1: " + doi.getCatalogName());
    7
    s_log.debug("Binding table name " + doi.getSimpleName() + " as second bind value");
    7
    s_log.debug("Binding table name " + doi.getSimpleName() + " as second bind value");
    7
    s_log.debug("Binding for param 2: " + doi.getSimpleName());
    Differences
    Expression1Expression2Difference
    "Binding table name ""Binding for param 2: "LITERAL_VALUE_MISMATCH
    "Binding table name " + doi.getSimpleName() + " as second bind value""Binding for param 2: " + doi.getSimpleName()INFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    Preondition Violations
    Expression "Binding table name " + doi.getSimpleName() + " as second bind value" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression "Binding for param 2: " + doi.getSimpleName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    s_log.debug("Binding for param 2: " + doi.getSimpleName());
    8
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    8
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    9
    pstmt.setString(1, doi.getCatalogName());
    9
    pstmt.setString(1, doi.getCatalogName());
    10
    pstmt.setString(2, doi.getSimpleName());
    10
    pstmt.setString(2, doi.getSimpleName());
    11
    return pstmt;
    11
    return pstmt;
    Precondition Violations (4)
    Row Violation
    1Expression "Binding catalog name " + doi.getCatalogName() + " as first bind value" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression "Binding for param 1: " + doi.getCatalogName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression "Binding table name " + doi.getSimpleName() + " as second bind value" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression "Binding for param 2: " + doi.getSimpleName() cannot be parameterized, because it has dependencies to/from statements that will be extracted