final ISession session = getSession(); final IDatabaseObjectInfo doi = getDatabaseObjectInfo(); ISQLConnection conn = session.getSQLConnection(); if (s_log.isDebugEnabled()) { s_log.debug("Running View Source SQL: "+SQL); s_log.debug("View Name="+doi.getSimpleName()); s_log.debug("Schema Name="+doi.getSchemaName()); } PreparedStatement pstmt = conn.prepareStatement(SQL); pstmt.setString(1, doi.getSimpleName()); // view name pstmt.setString(2, doi.getSchemaName()); // schema name 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 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;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/derby/src/net/sourceforge/squirrel_sql/plugins/derby/tab/ViewSourceTab.java File path: /sql12/plugins/mysql/src/net/sourceforge/squirrel_sql/plugins/mysql/tab/MysqlViewSourceTab.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 View Source SQL: "+SQL);
5
            s_log.debug("Running SQL for View source tab: "+SQL);
6
            s_log.debug("View Name="+doi.getSimpleName()
6
            s_log.debug("Binding catalog name "+doi.getCatalogName()+
7
);
7
                        " as first bind value");
8
            s_log.debug("Schema Name="+doi.getSchemaName());
8
            s_log.debug("Binding table name "+doi.getSimpleName()+
9
                        " as second bind value");                        
9
        }
10
            
10
        
11
        }
11
		PreparedStatement pstmt = conn.prepareStatement(SQL);
12
		PreparedStatement pstmt = conn.prepareStatement(SQL);
12
		
13
        
13
pstmt.setString(1, doi.getSimpleName()); // view name
14
        pstmt.setString(1, doi.getCatalogName());
14
        
15
pstmt.setString(2, doi.getSchemaName()); // schema name
15
		pstmt.setString(2, doi.getSimpleName());
16
		return pstmt;
16
		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)75.2
    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 View Source SQL: " + SQL);
    5
    s_log.debug("Running View Source SQL: " + SQL);
    5
    s_log.debug("Running SQL for View source tab: " + SQL);
    Differences
    Expression1Expression2Difference
    "Running View Source SQL: ""Running SQL for View source tab: "LITERAL_VALUE_MISMATCH
    5
    s_log.debug("Running SQL for View source tab: " + SQL);
    6
    s_log.debug("View Name=" + doi.getSimpleName());
    6
    s_log.debug("View Name=" + doi.getSimpleName());
    7
    s_log.debug("Binding table name " + doi.getSimpleName() + " as second bind value");
    Differences
    Expression1Expression2Difference
    "View Name=""Binding table name "LITERAL_VALUE_MISMATCH
    "View Name=" + doi.getSimpleName()"Binding table name " + doi.getSimpleName() + " as second bind value"INFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    Preondition Violations
    Expression "View Name=" + doi.getSimpleName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression "Binding table name " + doi.getSimpleName() + " as second bind value" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    s_log.debug("Binding table name " + doi.getSimpleName() + " as second bind value");
    7
    s_log.debug("Schema Name=" + doi.getSchemaName());
    7
    s_log.debug("Schema Name=" + doi.getSchemaName());
    6
    s_log.debug("Binding catalog name " + doi.getCatalogName() + " as first bind value");
    Differences
    Expression1Expression2Difference
    "Schema Name=""Binding catalog name "LITERAL_VALUE_MISMATCH
    getSchemaNamegetCatalogNameMETHOD_INVOCATION_NAME_MISMATCH
    "Schema Name=" + doi.getSchemaName()"Binding catalog name " + doi.getCatalogName() + " as first bind value"INFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    Preondition Violations
    Expression doi.getSchemaName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression doi.getCatalogName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression "Schema Name=" + doi.getSchemaName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression "Binding catalog name " + doi.getCatalogName() + " as first bind value" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    s_log.debug("Binding catalog name " + doi.getCatalogName() + " as first bind value");
    8
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    8
    PreparedStatement pstmt = conn.prepareStatement(SQL);
    9
    pstmt.setString(1, doi.getSimpleName());
    9
    pstmt.setString(1, doi.getSimpleName());
    10
    pstmt.setString(2, doi.getSimpleName());
    Differences
    Expression1Expression2Difference
    12LITERAL_VALUE_MISMATCH
    10
    pstmt.setString(2, doi.getSimpleName());
    10
    pstmt.setString(2, doi.getSchemaName());
    10
    pstmt.setString(2, doi.getSchemaName());
    9
    pstmt.setString(1, doi.getCatalogName());
    Differences
    Expression1Expression2Difference
    21LITERAL_VALUE_MISMATCH
    getSchemaNamegetCatalogNameMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression doi.getSchemaName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression doi.getCatalogName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    pstmt.setString(1, doi.getCatalogName());
    11
    return pstmt;
    11
    return pstmt;
    Precondition Violations (8)
    Row Violation
    1Expression "View Name=" + doi.getSimpleName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression "Binding table name " + doi.getSimpleName() + " as second bind value" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression doi.getSchemaName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression doi.getCatalogName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression "Schema Name=" + doi.getSchemaName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression "Binding catalog name " + doi.getCatalogName() + " as first bind value" cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression doi.getSchemaName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression doi.getCatalogName() cannot be parameterized, because it has dependencies to/from statements that will be extracted