if (null == _tempSqlHistoryItemWrappers) { // I have seen the reference to the outer class being null // when this method is called. // I have seen it only with the runtime jars // and on Linux. // I could not reproduce in my IDE. return 0; } else { return _tempSqlHistoryItemWrappers.size(); }
if(null == _bundles) { return 0; } else { return _bundles.length; }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/SQLHistoryController.java File path: /sql12/plugins/i18n/src/net/sourceforge/squirrel_sql/plugins/i18n/BundlesTableModel.java
Method name: int getRowCount() Method name: int getRowCount()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (null == _tempSqlHistoryItemWrappers)
1
if(null == _
2
         {
3
            // I have seen the reference to the outer class being null
4
            // when this method is called.
5
            // I have seen it only with the runtime jars
6
            // and on Linux.
7
            // I could not reproduce in my IDE.
8
   
2
bundles)
3
      {
9
         return 0;
4
         return 0;
10
         }
5
      
11
   
6
}
12
      else
7
      else
13
         {
8
      
14
  
9
{
15
          return _tempSqlHistoryItemWrappers.size();
10
         return _
16
   
11
bundles.length;
17
      }
12
      }
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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (null == _tempSqlHistoryItemWrappers)
    1
    if (null == _tempSqlHistoryItemWrappers)
    1
    if (null == _bundles)
    Differences
    Expression1Expression2Difference
    _tempSqlHistoryItemWrappers_bundlesVARIABLE_NAME_MISMATCH
    java.util.ArrayListnet.sourceforge.squirrel_sql.plugins.i18n.I18nBundle[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.ArrayList<net.sourceforge.squirrel_sql.client.session.mainpanel.SQLHistoryItemWrapper> of variable _tempSqlHistoryItemWrappers does not match with type net.sourceforge.squirrel_sql.plugins.i18n.I18nBundle[] of variable _bundles
    • Make classes java.util.ArrayList and net.sourceforge.squirrel_sql.plugins.i18n.I18nBundle[] extend a common superclass
    1
    if (null == _bundles)
    2
    return 0;
    2
    return 0;
    else
    else
    3
    return _tempSqlHistoryItemWrappers.size();
    3
    return _tempSqlHistoryItemWrappers.size();
    3
    return _bundles.length;
    Differences
    Expression1Expression2Difference
    _tempSqlHistoryItemWrappers.size()_bundles.lengthTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression _tempSqlHistoryItemWrappers.size() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _bundles.length cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    return _bundles.length;
    Precondition Violations (3)
    Row Violation
    1Type java.util.ArrayList<net.sourceforge.squirrel_sql.client.session.mainpanel.SQLHistoryItemWrapper> of variable _tempSqlHistoryItemWrappers does not match with type net.sourceforge.squirrel_sql.plugins.i18n.I18nBundle[] of variable _bundles
    2Expression _tempSqlHistoryItemWrappers.size() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression _bundles.length cannot be parameterized, because it has dependencies to/from statements that will be extracted