_curRow[0] = null; _curRow[1] = null; if (_rowKeys.hasNext()) { _curRow[0] = _rowKeys.next(); } if (_curRow[0] != null) { _curRow[1] = _src.get(_curRow[0]); } return _curRow[0] != null;
_curRow[0] = null; if (_rowKeys.hasNext()) { _curRow[0] = _rowKeys.next(); } if (_curRow[0] != null) { _curRow[1] = _src.get(_curRow[0]); } return _curRow[0] != null;
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/MapDataSet.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/HashtableDataSet.java
Method name: boolean next(IMessageHandler) Method name: boolean next(IMessageHandler)
Number of AST nodes: 7 Number of AST nodes: 6
1
_curRow[0] = null;
1
_curRow[0] = null;
2
      _curRow[1] = null;
3
      if (_rowKeys.hasNext())
2
      if (_rowKeys.hasNext())
4
      {
3
      {
5
         _curRow[0] = _rowKeys.next();
4
         _curRow[0] = _rowKeys.next();
6
      }
5
      }
7
      if (_curRow[0] != null)
6
      if (_curRow[0] != null)
8
      {
7
      {
9
         _curRow[1] = _src.get(_curRow[0]);
8
         _curRow[1] = _src.get(_curRow[0]);
10
      }
9
      }
11
      return _curRow[0] != null;
10
      return _curRow[0] != null;
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.5
Clones locationClones are in different classes
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                          
    1
    _curRow[0] = null;
    Preondition Violations
    Unmatched statement _curRow[0]=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    1
    _curRow[0] = null;
    1
    _curRow[0] = null;
    1
    _curRow[0] = null;
    Preondition Violations
    Unmatched statement _curRow[0]=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                          
    2
    _curRow[1] = null;
    2
    _curRow[1] = null;
    Preondition Violations
    Unmatched statement _curRow[1]=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                          
    3
    if (_rowKeys.hasNext())
    3
    if (_rowKeys.hasNext())
    2
    if (_rowKeys.hasNext())
    Differences
    Expression1Expression2Difference
    java.util.Iterator<>java.util.IteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Iterator<> of variable _rowKeys does not match with type java.util.Iterator<java.lang.String> of variable _rowKeys
    • Make classes java.util.Iterator<> and java.util.Iterator extend a common superclass
    2
    if (_rowKeys.hasNext())
                                                                
    3
    _curRow[0] = _rowKeys.next();
    Preondition Violations
    Unmatched statement _curRow[0]=_rowKeys.next(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    _curRow[0] = _rowKeys.next();
    4
    _curRow[0] = _rowKeys.next();
    4
    _curRow[0] = _rowKeys.next();
    Preondition Violations
    Unmatched statement _curRow[0]=_rowKeys.next(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                
    5
    if (_curRow[0] != null)
    5
    if (_curRow[0] != null)
    4
    if (_curRow[0] != null)
    Differences
    Expression1Expression2Difference
    java.lang.Object[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Object[] of variable _curRow does not match with type java.lang.String[] of variable _curRow
    • Make classes java.lang.Object[] and java.lang.String[] extend a common superclass
    4
    if (_curRow[0] != null)
                                                                          
    5
    _curRow[1] = _src.get(_curRow[0]);
    Preondition Violations
    Unmatched statement _curRow[1]=_src.get(_curRow[0]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    _curRow[1] = _src.get(_curRow[0]);
    6
    _curRow[1] = _src.get(_curRow[0]);
    6
    _curRow[1] = _src.get(_curRow[0]);
    Preondition Violations
    Unmatched statement _curRow[1]=_src.get(_curRow[0]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                          
    7
    return _curRow[0] != null;
    7
    return _curRow[0] != null;
    6
    return _curRow[0] != null;
    Differences
    Expression1Expression2Difference
    java.lang.Object[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Object[] of variable _curRow does not match with type java.lang.String[] of variable _curRow
    • Make classes java.lang.Object[] and java.lang.String[] extend a common superclass
    6
    return _curRow[0] != null;
    Precondition Violations (10)
    Row Violation
    1Unmatched statement _curRow[0]=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement _curRow[0]=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement _curRow[1]=null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Type java.util.Iterator<> of variable _rowKeys does not match with type java.util.Iterator<java.lang.String> of variable _rowKeys
    5Unmatched statement _curRow[0]=_rowKeys.next(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement _curRow[0]=_rowKeys.next(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Type java.lang.Object[] of variable _curRow does not match with type java.lang.String[] of variable _curRow
    8Unmatched statement _curRow[1]=_src.get(_curRow[0]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9Unmatched statement _curRow[1]=_src.get(_curRow[0]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10Type java.lang.Object[] of variable _curRow does not match with type java.lang.String[] of variable _curRow