if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {
if (text.length() <= 1 ) {
// about to delete last thing in field, so replace with null
DataTypeInteger.this._textComponent.updateText("<null>");
e.consume();
}
}
if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {
if (text.length() <= 1) {
// about to delete last thing in field, so replace with
// null
DerbyClobDataTypeComponent.this._textComponent.updateText("<null>");
e.consume();
}
}
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeInteger.java
|
|
File path: /sql12/plugins/derby/src/net/sourceforge/squirrel_sql/plugins/derby/types/DerbyClobDataTypeComponent.java
|
Method name: void keyTyped(KeyEvent)
|
|
Method name: void keyTyped(KeyEvent)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {↵ | | 1 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {↵
|
2 | if (text.length() <= 1 ) {↵ | | 2 | if (text.length() <= 1) {↵
|
3 | // about to delete last thing in field, so replace with null↵ | | 3 | // about to delete last thing in field, so replace with↵
|
4 | DataTypeInteger.this._textComponent.updateText("<null>");↵ | | |
|
5 | e.consume();↵ | | |
|
6 | }↵ | | |
|
7 | ↵ | | |
|
| | | 4 | // null↵
|
| | | 5 | DerbyClobDataTypeComponent.this._textComponent.updateText("<null>");↵
|
| | | 6 | e.consume();↵
|
| | | 7 | }↵
|
8 | } | | 8 | }
|
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.7 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 12 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 2.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
28 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) | | 10 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) |
29 | | | 11 | |
30 | DataTypeInteger.this._textComponent.updateText("<null>"); | | 12 | DerbyClobDataTypeComponent.this._textComponent.updateText("<null>"); |
31 | | | 13 | |
Precondition Violations (1)
Row |
Violation |
1 | Expression DataTypeInteger cannot be unified with expression DerbyClobDataTypeComponent , because common superclass net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BaseDataTypeComponent does not declare member(s) private net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IRestorableTextComponent _textComponent |