if (Character.isUpperCase(tableName.charAt(0))) { tableName = tableName.toLowerCase(); } else { tableName = tableName.toUpperCase(); } tis = schemaInfo.getITableInfos(null, schema, tableName); if (tis.length == 0) { if (Character.isUpperCase(tableName.charAt(0))) { tableName = tableName.toLowerCase(); } else { tableName = tableName.toUpperCase(); } tis = schemaInfo.getITableInfos(null, schema, tableName); }
if (Character.isUpperCase(tableName.charAt(0))) { tableName = tableName.toLowerCase(); } else { tableName = tableName.toUpperCase(); } tis = getTables(session, null, schema, tableName); if (tis.length == 0) { if (Character.isUpperCase(tableName.charAt(0))) { tableName = tableName.toLowerCase(); } else { tableName = tableName.toUpperCase(); } tis = getTables(session, null, schema, tableName); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/dbdiff/src/net/sourceforge/squirrel_sql/plugins/dbdiff/util/DBUtil.java File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/util/DBUtil.java
Method name: ITableInfo getTableInfo(ISession, String, String) Method name: ITableInfo getTableInfo(ISession, String, String)
Number of AST nodes: 9 Number of AST nodes: 9
1
if (Character.isUpperCase(tableName.charAt(0)))
1
if (Character.isUpperCase(tableName.charAt(0)))
2
			{
2
			{
3
				tableName = tableName.toLowerCase();
3
				tableName = tableName.toLowerCase();
4
			}
4
			}
5
			else
5
 else
6
			{
6
			{
7
				tableName = tableName.toUpperCase();
7
				tableName = tableName.toUpperCase();
8
			}
8
			}
9
			tis = schemaInfo.getITableInfos(null, schema, tableName);
9
			tis = getTables(session, null, schema, tableName);
10
			if (tis.length == 0)
10
			if (tis.length == 0)
11
			{
11
			{
12
				if (Character.isUpperCase(tableName.charAt(0)))
12
				if (Character.isUpperCase(tableName.charAt(0)))
13
				{
13
				{
14
					tableName = tableName.toLowerCase();
14
					tableName = tableName.toLowerCase();
15
				}
15
				}
16
				else
16
 else
17
				{
17
				{
18
					tableName = tableName.toUpperCase();
18
					tableName = tableName.toUpperCase();
19
				}
19
				}
20
				tis = schemaInfo.getITableInfos(null, schema, tableName);
20
				tis = getTables(session, null, schema, tableName);
21
			}
21
			}
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.8
Clones locationClones are in different classes
Number of node comparisons24
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)37.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    if (Character.isUpperCase(tableName.charAt(0)))
    11
    if (Character.isUpperCase(tableName.charAt(0)))
    13
    tableName = tableName.toLowerCase();
    12
    tableName = tableName.toLowerCase();
    else
    else
    14
    tableName = tableName.toUpperCase();
    13
    tableName = tableName.toUpperCase();
    15
    tis = schemaInfo.getITableInfos(null, schema, tableName);
    15
    tis = schemaInfo.getITableInfos(null, schema, tableName);
    14
    tis = getTables(session, null, schema, tableName);
    Differences
    Expression1Expression2Difference
    schemaInfo.getITableInfos(null,schema,tableName)getTables(session,null,schema,tableName)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression schemaInfo.getITableInfos(null,schema,tableName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getTables(session,null,schema,tableName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    tis = getTables(session, null, schema, tableName);
    16
    if (tis.length == 0)
    15
    if (tis.length == 0)
    17
    if (Character.isUpperCase(tableName.charAt(0)))
    16
    if (Character.isUpperCase(tableName.charAt(0)))
    18
    tableName = tableName.toLowerCase();
    17
    tableName = tableName.toLowerCase();
    else
    else
    19
    tableName = tableName.toUpperCase();
    18
    tableName = tableName.toUpperCase();
    20
    tis = schemaInfo.getITableInfos(null, schema, tableName);
    20
    tis = schemaInfo.getITableInfos(null, schema, tableName);
    19
    tis = getTables(session, null, schema, tableName);
    Differences
    Expression1Expression2Difference
    schemaInfo.getITableInfos(null,schema,tableName)getTables(session,null,schema,tableName)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression schemaInfo.getITableInfos(null,schema,tableName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getTables(session,null,schema,tableName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19
    tis = getTables(session, null, schema, tableName);
    Precondition Violations (5)
    Row Violation
    1Expression schemaInfo.getITableInfos(null,schema,tableName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getTables(session,null,schema,tableName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression schemaInfo.getITableInfos(null,schema,tableName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression getTables(session,null,schema,tableName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Clone fragment #1 returns variables tis, tableName , while Clone fragment #2 returns variables tis, tableName