File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeString.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: 9 | Number of AST nodes: 9 | |||
1 | if (text.equals("<null>")) {↵ | 1 | if (text.equals("<null>")) {↵ | |
2 | if ((c==KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {↵ | 2 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {↵ | |
3 | // delete when null => original value↵ | 3 | // delete when null => original value↵ | |
4 | DataTypeString.this._textComponent.restoreText();↵ | |||
5 | e.consume();↵ | |||
6 | }↵ | |||
7 | else {↵ | |||
8 | ↵ | 4 | DerbyClobDataTypeComponent.this._textComponent.restoreText();↵ | |
5 | e.consume();↵ | |||
6 | } else {↵ | |||
9 | // non-delete when null => clear field and add text↵ | 7 | // non-delete when null => clear field and add text↵ | |
10 | DataTypeString.this._textComponent.updateText("");↵ | 8 | DerbyClobDataTypeComponent.this._textComponent.updateText("");↵ | |
11 | // fall through to normal processing of this key stroke↵ | 9 | // fall through to normal processing of this key stroke↵ | |
12 | }↵ | |||
13 | }↵ | |||
14 | else {↵ | |||
15 | // for strings, a "blank" field is allowed, so only↵ | |||
16 | // switch to null when there is nothing left in the field↵ | |||
17 | // and user does delete↵ | |||
18 | ↵ | 10 | }↵ | |
11 | } else {↵ | |||
12 | // check for user deletes last thing in field↵ | |||
19 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {↵ | 13 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {↵ | |
20 | if (text.length() == 0 ) {↵ | |||
21 | // about to delete last thing in field, so replace with null↵ | |||
22 | DataTypeString.this._textComponent.updateText("<null>");↵ | |||
23 | e.consume();↵ | |||
24 | }↵ | |||
25 | }↵ | |||
26 | ↵ | 14 | if (text.length() <= 1) {↵ | |
15 | // about to delete last thing in field, so replace with↵ | |||
16 | // null↵ | |||
17 | DerbyClobDataTypeComponent.this._textComponent.updateText("<null>");↵ | |||
18 | e.consume();↵ | |||
19 | }↵ | |||
20 | }↵ | |||
27 | } | 21 | } | |
See real code fragment | See real code fragment |
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) | 1.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 30 |
Number of mapped statements | 9 |
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) | 5.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | if (text.equals("<null>")) | 5 | if (text.equals("<null>")) | ||||||||||||||||
9 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) | 6 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) | ||||||||||||||||
10 | DataTypeString.this._textComponent.restoreText(); |
| 7 | DerbyClobDataTypeComponent.this._textComponent.restoreText(); | |||||||||||||||
11 | e.consume(); | 8 | e.consume(); | ||||||||||||||||
else | else | ||||||||||||||||||
12 | DataTypeString.this._textComponent.updateText(""); |
| 9 | DerbyClobDataTypeComponent.this._textComponent.updateText(""); | |||||||||||||||
else | else | ||||||||||||||||||
13 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) | 10 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) | ||||||||||||||||
14 | if (text.length() == 0) |
| 11 | if (text.length() <= 1) | |||||||||||||||
15 | DataTypeString.this._textComponent.updateText("<null>"); |
| 12 | DerbyClobDataTypeComponent.this._textComponent.updateText("<null>"); | |||||||||||||||
16 | e.consume(); | 13 | e.consume(); |
Row | Violation |
---|---|
1 | Expression DataTypeString 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 |
2 | Expression DataTypeString 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 |
3 | Expression text.length() == 0 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression text.length() <= 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression DataTypeString 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 |