synchronized (chars)
{
try
{
chars.wait();
}
catch (InterruptedException e)
{
}
}
if (rs != null) {
try { rs.close(); } catch (SQLException e) {}
}
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/parser/kernel/ParserThread.java
|
|
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/ContentsTab.java
|
Method name: void waitChars()
|
|
Method name: IDataSet createDataSet()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | synchronized (chars)↵ | | |
|
2 | {↵ | | |
|
3 | try↵ | | |
|
4 | {↵ | | |
|
5 | chars.wait();↵ | | |
|
6 | }↵ | | |
|
7 | catch (InterruptedException e)↵ | | |
|
8 | {↵ | | |
|
9 | }↵ | | |
|
10 | ↵ | | 1 | if (rs != null) {↵
|
| | | 2 | try { rs.close(); } catch (SQLException e) {}↵
|
11 | } | | 3 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 5 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | try | | 46 | try |
4 | | | | |
| | | 47 | |
Precondition Violations (3)
Row |
Violation |
1 | Unmatched statement chars.wait(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
2 | Unmatched statement rs.close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.session.parser.kernel.ParserThread.IncrementalBuffer and net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table.ContentsTab do not have a common superclass |