ForeignKeyInfo[] result = ti.getExportedKeys(); if (result == null) { result = md.getExportedKeysInfo(ti); // Avoid the hit next time ti.setExportedKeys(result); } return result;
ForeignKeyInfo[] result = ti.getImportedKeys(); if (result == null) { result = md.getImportedKeysInfo(ti); // Avoid the hit next time ti.setImportedKeys(result); } return result;
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/sql/SQLUtilities.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/sql/SQLUtilities.java
Method name: ForeignKeyInfo[] getExportedKeys(ITableInfo, SQLDatabaseMetaData) Method name: ForeignKeyInfo[] getImportedKeys(ITableInfo, SQLDatabaseMetaData)
Number of AST nodes: 5 Number of AST nodes: 5
1
ForeignKeyInfo[] result = ti.getExportedKeys();
1
ForeignKeyInfo[] result = ti.getImportedKeys();
2
		if (result == null)
2
		if (result == null)
3
		{
3
		{
4
			result = md.getExportedKeysInfo(ti);
4
			result = md.getImportedKeysInfo(ti);
5
			// Avoid the hit next time
5
			// Avoid the hit next time
6
			ti.setExportedKeys(result);
6
			ti.setImportedKeys(result);
7
		}
7
		}
8
		return result;
8
		return result;
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 declared in the same class
Number of node comparisons13
  1. {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)32.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    ForeignKeyInfo[] result = ti.getExportedKeys();
    1
    ForeignKeyInfo[] result = ti.getExportedKeys();
    1
    ForeignKeyInfo[] result = ti.getImportedKeys();
    Differences
    Expression1Expression2Difference
    getExportedKeysgetImportedKeysMETHOD_INVOCATION_NAME_MISMATCH
    1
    ForeignKeyInfo[] result = ti.getImportedKeys();
    2
    if (result == null)
    2
    if (result == null)
    3
    result = md.getExportedKeysInfo(ti);
    3
    result = md.getExportedKeysInfo(ti);
    3
    result = md.getImportedKeysInfo(ti);
    Differences
    Expression1Expression2Difference
    getExportedKeysInfogetImportedKeysInfoMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression md.getExportedKeysInfo(ti) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression md.getImportedKeysInfo(ti) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3
    result = md.getImportedKeysInfo(ti);
    4
    ti.setExportedKeys(result);
    4
    ti.setExportedKeys(result);
    4
    ti.setImportedKeys(result);
    Differences
    Expression1Expression2Difference
    setExportedKeyssetImportedKeysMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression ti.setExportedKeys(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ti.setImportedKeys(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ti.setExportedKeys(result) is a void method call, and thus it cannot be parameterized
    Expression ti.setImportedKeys(result) is a void method call, and thus it cannot be parameterized
    4
    ti.setImportedKeys(result);
    5
    return result;
    5
    return result;
    Precondition Violations (6)
    Row Violation
    1Expression md.getExportedKeysInfo(ti) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression md.getImportedKeysInfo(ti) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3Expression ti.setExportedKeys(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression ti.setImportedKeys(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression ti.setExportedKeys(result) is a void method call, and thus it cannot be parameterized
    6Expression ti.setImportedKeys(result) is a void method call, and thus it cannot be parameterized