if (AddModifySequenceDialog.this._nameField.getText().equals(""))
{
enableAllButtons(false);
return;
}
enableAllButtons(true);
if (_columnTab._columTable.getRowCount() == 0 || getConstraintName().equals(""))
{
setAllButtonEnabled(false);
return;
}
// if the check gets till here we have all the need information
setAllButtonEnabled(true);
Clone fragments detected by clone detection tool
File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/gui/AddModifySequenceDialog.java
|
|
File path: /sql12/plugins/refactoring/src/net/sourceforge/squirrel_sql/plugins/refactoring/gui/AddUniqueConstraintDialog.java
|
Method name: void keyReleased(KeyEvent)
|
|
Method name: void checkInputCompletion()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (AddModifySequenceDialog.this._nameField.getText().equals(""))↵ | | 1 | if (_columnTab._columTable.getRowCount() == 0 || getConstraintName().equals(""))↵
|
2 | {↵ | | 2 | {↵
|
3 | enableAllButtons(false);↵ | | 3 | setAllButtonEnabled(false);↵
|
4 | return;↵ | | 4 | return;↵
|
5 | }↵ | | 5 | }↵
|
|
6 | enable↵ | | 6 | // if the check gets till here we have all the need information↵
|
7 | AllButtons(true); | | 7 | setAllButtonEnabled(true);
|
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 2 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 15.1 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 1 | if (_columnTab._columTable.getRowCount() == 0 || getConstraintName().equals("")) |
| | | 2 | setAllButtonEnabled(false); |
| | | 3 | |
1 | if (AddModifySequenceDialog.this._nameField.getText().equals("")) | | | |
2 | | | | |
3 | | | | |
4 | enableAllButtons(true); | | 4 | setAllButtonEnabled(true); |
Precondition Violations (5)
Row |
Violation |
1 | Unmatched return; |
2 | Unmatched return; |
3 | Expression enableAllButtons(true) is a void method call, and thus it cannot be parameterized |
4 | Expression setAllButtonEnabled(true) is a void method call, and thus it cannot be parameterized |
5 | The refactoring of the clones is infeasible, because classes and net.sourceforge.squirrel_sql.plugins.refactoring.gui.AddUniqueConstraintDialog do not have a common superclass |