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 DataTypeLong.this._textComponent.updateText("<null>"); e.consume(); } }
if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE)) { if (text.length() == 0 ) { // about to delete last thing in field, so replace with null DataTypeString.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/DataTypeLong.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeString.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() == 0 ) {
3
								// about to delete last thing in field, so replace with null
3
							// about to delete last thing in field, so replace with null
4
								DataTypeLong.this._textComponent.updateText("<null>");
4
							DataTypeString.this._textComponent.updateText("<null>");
5
								e.consume();
5
							e.consume();
6
							}
6
						}
7
						}
7
					}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.7
Clones locationClones are in different classes having the same super class
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    28
    if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE))
    13
    if ((c == KeyEvent.VK_BACK_SPACE) || (c == KeyEvent.VK_DELETE))
    29
    if (text.length() <= 1)
    29
    if (text.length() <= 1)
    14
    if (text.length() == 0)
    Differences
    Expression1Expression2Difference
    10LITERAL_VALUE_MISMATCH
    <===OPERATOR_MISMATCH
    14
    if (text.length() == 0)
    30
    DataTypeLong.this._textComponent.updateText("<null>");
    30
    DataTypeLong.this._textComponent.updateText("<null>");
    15
    DataTypeString.this._textComponent.updateText("<null>");
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeLongnet.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeStringSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression DataTypeLong cannot be unified with expression DataTypeString , 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
    15
    DataTypeString.this._textComponent.updateText("<null>");
    31
    e.consume();
    16
    e.consume();
    Precondition Violations (1)
    Row Violation
    1Expression DataTypeLong cannot be unified with expression DataTypeString , 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