final String key = "getDriverName"; String value = (String)_cache.get(key); if (value == null) { value = privateGetJDBCMetaData().getDriverName(); _cache.put(key, value); } return value;
final String key = "getDatabaseProductVersion"; String value = (String)_cache.get(key); if (value == null) { value = privateGetJDBCMetaData().getDatabaseProductVersion(); _cache.put(key, value); } return value;
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/sql/SQLDatabaseMetaData.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/sql/SQLDatabaseMetaData.java
Method name: String getDriverName() Method name: String getDatabaseProductVersion()
Number of AST nodes: 6 Number of AST nodes: 6
1
final String key = "getDriverName";
1
final String key = "getDatabaseProductVersion";
2
		String value = (String)_cache.get(key);
2
		String value = (String)_cache.get(key);
3
		if (value == null)
3
		if (value == null)
4
		{
4
		{
5
			value = privateGetJDBCMetaData().getDriverName();
5
			value = privateGetJDBCMetaData().getDatabaseProductVersion();
6
			_cache.put(key, value);
6
			_cache.put(key, value);
7
		}
7
		}
8
		return value;
8
		return value;
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 comparisons18
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    final String key = "getDriverName";
    1
    final String key = "getDriverName";
    1
    final String key = "getDatabaseProductVersion";
    Differences
    Expression1Expression2Difference
    "getDriverName""getDatabaseProductVersion"LITERAL_VALUE_MISMATCH
    1
    final String key = "getDatabaseProductVersion";
    2
    String value = (String)_cache.get(key);
    2
    String value = (String)_cache.get(key);
    3
    if (value == null)
    3
    if (value == null)
    4
    value = privateGetJDBCMetaData().getDriverName();
    4
    value = privateGetJDBCMetaData().getDriverName();
    4
    value = privateGetJDBCMetaData().getDatabaseProductVersion();
    Differences
    Expression1Expression2Difference
    getDriverNamegetDatabaseProductVersionMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression privateGetJDBCMetaData().getDriverName() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression privateGetJDBCMetaData().getDatabaseProductVersion() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    4
    value = privateGetJDBCMetaData().getDatabaseProductVersion();
    5
    _cache.put(key, value);
    5
    _cache.put(key, value);
    6
    return value;
    6
    return value;
    Precondition Violations (2)
    Row Violation
    1Expression privateGetJDBCMetaData().getDriverName() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression privateGetJDBCMetaData().getDatabaseProductVersion() is a method call throwing exception(s) that should be caught by a try block that will be extracted