File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeFloat.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: 11 | Number of AST nodes: 11 | |||
1 | if ( DataTypeFloat.this._isNullable) {↵ | 1 | if (DerbyClobDataTypeComponent.this._isNullable) {↵ | |
2 | // user enters something when field is null↵ | 2 | // user enters something when field is null↵ | |
3 | if (text.equals("<null>")) {↵ | 3 | if (text.equals("<null>")) {↵ | |
4 | if ((c==KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {↵ | 4 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {↵ | |
5 | // delete when null => original value↵ | 5 | // delete when null => original value↵ | |
6 | DataTypeFloat.this._textComponent.restoreText();↵ | 6 | DerbyClobDataTypeComponent.this._textComponent.restoreText();↵ | |
7 | e.consume();↵ | 7 | e.consume();↵ | |
8 | }↵ | 8 | ↵ | |
9 | else {↵ | 9 | } else {↵ | |
10 | // non-delete when null => clear field and add text↵ | 10 | // non-delete when null => clear field and add text↵ | |
11 | DataTypeFloat.this._textComponent.updateText("");↵ | 11 | DerbyClobDataTypeComponent.this._textComponent.updateText("");↵ | |
12 | // fall through to normal processing of this key stroke↵ | 12 | // fall through to normal processing of this key stroke↵ | |
13 | }↵ | 13 | }↵ | |
14 | }↵ | 14 | ↵ | |
15 | else {↵ | 15 | } else {↵ | |
16 | // check for user deletes last thing in field↵ | 16 | // check for user deletes last thing in field↵ | |
17 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {↵ | 17 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) {↵ | |
18 | if (text.length() <= 1 ) {↵ | 18 | if (text.length() <= 1) {↵ | |
19 | // about to delete last thing in field, so replace with↵ | 19 | // about to delete last thing in field, so replace with↵ | |
20 | null↵ | 20 | // null↵ | |
21 | DataTypeFloat.this._textComponent.updateText("<null>");↵ | 21 | DerbyClobDataTypeComponent.this._textComponent.updateText("<null>");↵ | |
22 | e.consume();↵ | 22 | e.consume();↵ | |
23 | }↵ | 23 | ↵ | |
24 | ↵ | 24 | }↵ | |
25 | }↵ | 25 | }↵ | |
26 | }↵ | 26 | }↵ | |
27 | }↵ | 27 | ↵ | |
28 | else {↵ | |||
29 | ↵ | 28 | } else {↵ | |
30 | // field is not nullable↵ | 29 | // field is not nullable↵ | |
31 | //↵ | 30 | ↵ | |
32 | ↵ | 31 | //↵ | |
33 | handleNotNullableField(text, c, e, _textComponent);↵ | 32 | handleNotNullableField(text, c, e, _textComponent);↵ | |
34 | } | 33 |
| |
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 33 |
Number of mapped statements | 11 |
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) | 7.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
16 | if (DataTypeFloat.this._isNullable) |
| 4 | if (DerbyClobDataTypeComponent.this._isNullable) | |||||||||||
17 | if (text.equals("<null>")) | 5 | if (text.equals("<null>")) | ||||||||||||
18 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) | 6 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) | ||||||||||||
19 | DataTypeFloat.this._textComponent.restoreText(); |
| 7 | DerbyClobDataTypeComponent.this._textComponent.restoreText(); | |||||||||||
20 | e.consume(); | 8 | e.consume(); | ||||||||||||
else | else | ||||||||||||||
21 | DataTypeFloat.this._textComponent.updateText(""); |
| 9 | DerbyClobDataTypeComponent.this._textComponent.updateText(""); | |||||||||||
else | else | ||||||||||||||
22 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) | 10 | if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) | ||||||||||||
23 | if (text.length() <= 1) | 11 | if (text.length() <= 1) | ||||||||||||
24 | DataTypeFloat.this._textComponent.updateText("<null>"); |
| 12 | DerbyClobDataTypeComponent.this._textComponent.updateText("<null>"); | |||||||||||
25 | e.consume(); | 13 | e.consume(); | ||||||||||||
else | else | ||||||||||||||
26 | handleNotNullableField(text, c, e, _textComponent); | 14 | handleNotNullableField(text, c, e, _textComponent); |
Row | Violation |
---|---|
1 | Expression DataTypeFloat cannot be unified with expression DerbyClobDataTypeComponent , because common superclass net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BaseDataTypeComponent does not declare member(s) private boolean _isNullable |
2 | Expression DataTypeFloat 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 DataTypeFloat 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 |
4 | Expression DataTypeFloat 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 |