final String key = "supportsCatalogsInTableDefinitions"; Boolean value = (Boolean)_cache.get(key); if (value != null) { return value.booleanValue(); } try { value = Boolean.valueOf(privateGetJDBCMetaData().supportsCatalogsInTableDefinitions()); } catch (SQLException ex) { boolean isSQLServer = DialectFactory.isSyBase(this) || DialectFactory.isMSSQLServer(this); if (isSQLServer) { value = Boolean.TRUE; _cache.put(key, value); } throw ex; } _cache.put(key, value); return value.booleanValue();
final String key = "supportsSchemasInTableDefinitions"; Boolean value = (Boolean)_cache.get(key); if (value != null) { return value.booleanValue(); } try { value = Boolean.valueOf(privateGetJDBCMetaData().supportsSchemasInTableDefinitions()); } catch (SQLException ex) { boolean isSQLServer = DialectFactory.isSyBase(this) || DialectFactory.isMSSQLServer(this); if (isSQLServer) { value = Boolean.TRUE; _cache.put(key, value); } throw ex; } _cache.put(key, value); return value.booleanValue();
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: boolean supportsCatalogsInTableDefinitions() Method name: boolean supportsSchemasInTableDefinitions()
Number of AST nodes: 8 Number of AST nodes: 8
1
final String key = "supportsCatalogsInTableDefinitions";
1
final String key = "supportsSchemasInTableDefinitions";
2
		Boolean value = (Boolean)_cache.get(key);
2
		Boolean value = (Boolean)_cache.get(key);
3
		if (value != null)
3
		if (value != null)
4
		{
4
		{
5
			return value.booleanValue();
5
			return value.booleanValue();
6
		}
6
		}
7
		try
7
		try
8
		{
8
		{
9
			value = Boolean.valueOf(privateGetJDBCMetaData().supportsCatalogsInTableDefinitions());
9
			value = Boolean.valueOf(privateGetJDBCMetaData().supportsSchemasInTableDefinitions());
10
		}
10
		}
11
		catch (SQLException ex)
11
		catch (SQLException ex)
12
		{
12
		{
13
            boolean isSQLServer = 
13
            boolean isSQLServer = 
14
                DialectFactory.isSyBase(this) || DialectFactory.isMSSQLServer(this);
14
                DialectFactory.isSyBase(this) || DialectFactory.isMSSQLServer(this);
15
            
15
            
16
			if (isSQLServer)
16
			if (isSQLServer)
17
			{
17
			{
18
				value = Boolean.TRUE;
18
				value = Boolean.TRUE;
19
                _cache.put(key, value);
19
                _cache.put(key, value);
20
			}
20
			}
21
			throw ex;
21
			throw ex;
22
		}
22
		}
23
		_cache.put(key, value);
23
		_cache.put(key, value);
24
		return value.booleanValue();
24
		return value.booleanValue();
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.7
Clones locationClones are declared in the same class
Number of node comparisons26
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)16.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    final String key = "supportsCatalogsInTableDefinitions";
    1
    final String key = "supportsCatalogsInTableDefinitions";
    1
    final String key = "supportsSchemasInTableDefinitions";
    Differences
    Expression1Expression2Difference
    "supportsCatalogsInTableDefinitions""supportsSchemasInTableDefinitions"LITERAL_VALUE_MISMATCH
    1
    final String key = "supportsSchemasInTableDefinitions";
    2
    Boolean value = (Boolean)_cache.get(key);
    2
    Boolean value = (Boolean)_cache.get(key);
    3
    if (value != null)
    3
    if (value != null)
    4
    return value.booleanValue();
    4
    return value.booleanValue();
    5
    try
    5
    try
    6
    value = Boolean.valueOf(privateGetJDBCMetaData().supportsCatalogsInTableDefinitions());
    6
    value = Boolean.valueOf(privateGetJDBCMetaData().supportsCatalogsInTableDefinitions());
    6
    value = Boolean.valueOf(privateGetJDBCMetaData().supportsSchemasInTableDefinitions());
    Differences
    Expression1Expression2Difference
    supportsCatalogsInTableDefinitionssupportsSchemasInTableDefinitionsMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression privateGetJDBCMetaData().supportsCatalogsInTableDefinitions() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression privateGetJDBCMetaData().supportsSchemasInTableDefinitions() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    6
    value = Boolean.valueOf(privateGetJDBCMetaData().supportsSchemasInTableDefinitions());
    7
    _cache.put(key, value);
    7
    _cache.put(key, value);
    8
    return value.booleanValue();
    8
    return value.booleanValue();
    Precondition Violations (2)
    Row Violation
    1Expression privateGetJDBCMetaData().supportsCatalogsInTableDefinitions() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression privateGetJDBCMetaData().supportsSchemasInTableDefinitions() is a method call throwing exception(s) that should be caught by a try block that will be extracted