if (selected == null || selected.length == 0) {
disable(executeButton);
disable(editSQLButton);
disable(showSQLButton);
return;
}
disable(executeButton);
disable(editSQLButton);
disable(showSQLButton);
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/ColumnListDialog.java
|
|
File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/gui/AbstractRefactoringDialog.java
|
Method name: void valueChanged(ListSelectionEvent)
|
|
Method name: void enableAllButtons(boolean)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 3
|
|
1 | if (selected == null || selected.length == 0) {↵ | | |
|
2 | disable(executeButton);↵ | | 1 | disable(executeButton);↵
|
3 | disable(editSQLButton);↵ | | 2 | disable(editSQLButton);↵
|
4 | disable(showSQLButton);↵ | | 3 | disable(showSQLButton);
|
5 | return;↵ | | | |
6 | } | | | |
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 12 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | disable(executeButton); | | 5 | disable(executeButton); |
5 | disable(editSQLButton); | | 6 | disable(editSQLButton); |
6 | disable(showSQLButton); | | 7 | disable(showSQLButton); |
7 | return; | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched return; |
2 | The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.gui.db.ColumnListDialog.ColumnListSelectionListener and net.sourceforge.squirrel_sql.plugins.refactoring.gui.AbstractRefactoringDialog do not have a common superclass |