if (!DialectFactory.isOracle(session.getMetaData())) { // Only Oracle supports materialized views directly. return false; } if (matViewLookup == null) { initMatViewLookup(session, ti.getSchemaName()); } return matViewLookup.contains(ti.getSimpleName());
if (!DialectFactory.isOracle(session.getMetaData())) { // Only Oracle supports materialized views directly. return false; } if (matViewLookup == null) { initMatViewLookup(session, ti.getSchemaName()); } return matViewLookup.contains(ti.getSimpleName());
Clone fragments detected by clone detection tool
File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/commands/DropTablesCommand.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/action/DeleteTablesCommand.java
Method name: boolean isMaterializedView(ITableInfo, ISession) Method name: boolean isMaterializedView(ITableInfo, ISession)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (!DialectFactory.isOracle(session.getMetaData()))
1
if (!DialectFactory.isOracle(session.getMetaData()))
2
		{
2
		{
3
			// Only Oracle supports materialized views directly.
3
			// Only Oracle supports materialized views directly.
4
			return false;
4
			return false;
5
		}
5
		}
6
		if (matViewLookup == null)
6
		if (matViewLookup == null)
7
		{
7
		{
8
			initMatViewLookup(session, ti.getSchemaName());
8
			initMatViewLookup(session, ti.getSchemaName());
9
		}
9
		}
10
		return matViewLookup.contains(ti.getSimpleName());
10
		return matViewLookup.contains(ti.getSimpleName());
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.3
Clones locationClones are in different classes
Number of node comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    if (!DialectFactory.isOracle(session.getMetaData()))
    1
    if (!DialectFactory.isOracle(session.getMetaData()))
    2
    return false;
    2
    return false;
    3
    if (matViewLookup == null)
    3
    if (matViewLookup == null)
    4
    initMatViewLookup(session, ti.getSchemaName());
    4
    initMatViewLookup(session, ti.getSchemaName());
    5
    return matViewLookup.contains(ti.getSimpleName());
    5
    return matViewLookup.contains(ti.getSimpleName());
    Precondition Violations (1)
    Row Violation
    1The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.plugins.refactoring.commands.DropTablesCommand and net.sourceforge.squirrel_sql.client.session.action.DeleteTablesCommand do not have a common superclass