final String key = "supportsCatalogsInDataManipulation";
Boolean value = (Boolean)_cache.get(key);
if (value != null)
{
return value.booleanValue();
}
try
{
value = Boolean.valueOf(privateGetJDBCMetaData().supportsCatalogsInDataManipulation());
}
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 supportsCatalogsInDataManipulation()
|
|
Method name: boolean supportsSchemasInTableDefinitions()
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | final String key = "supportsCatalogsInDataManipulation";↵ | | 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().supportsCatalogsInDataManipulation());↵ | | 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 | if (isSQLServer)↵ | | 16 | if (isSQLServer)↵
|
16 | {↵ | | 17 | {↵
|
17 | value = Boolean.TRUE;↵ | | 18 | value = Boolean.TRUE;↵
|
18 | _cache.put(key, value);↵ | | 19 | _cache.put(key, value);↵
|
19 | }↵ | | 20 | }↵
|
20 | throw ex;↵ | | 21 | throw ex;↵
|
21 | }↵ | | 22 | }↵
|
|
22 | _cache.put(key, value);↵ | | 23 | _cache.put(key, value);↵
|
|
23 | return value.booleanValue(); | | 24 | return value.booleanValue();
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 26 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 17.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | final String key = "supportsCatalogsInDataManipulation"; | | 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().supportsCatalogsInDataManipulation()); | | 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 |
1 | Expression privateGetJDBCMetaData().supportsCatalogsInDataManipulation() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Expression privateGetJDBCMetaData().supportsSchemasInTableDefinitions() is a method call throwing exception(s) that should be caught by a try block that will be extracted |