IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef); if (dataTypeObject != null) return dataTypeObject.areEqual(newValue, oldValue); // we should never get here because the areEqual function is only // called when we are trying to update the database, so we know // that we have a DataType object for this column (or we would // have been stopped from editing by the isEditableXXX methods), // but we need a return here to keep the compiler happy. return false;
IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef); if (dataTypeObject != null) return dataTypeObject.getDefaultValue(dbDefaultValue); // there was no data type object, so this data type is unknown // to squirrel and thus cannot be edited. return null;
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/CellComponentFactory.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/CellComponentFactory.java
Method name: boolean areEqual(ColumnDisplayDefinition, Object, Object) Method name: Object getDefaultValue(ColumnDisplayDefinition, String)
Number of AST nodes: 4 Number of AST nodes: 4
1
IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef);
1
IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef);
2
		
3
if (dataTypeObject != null)
2
      if (dataTypeObject != null)
4
			return dataTypeObject.areEqual(newValue, oldValue);
3
         return dataTypeObject.
5
		
6
		// we should never get here because the areEqual function is only
7
		// called when we are trying to up
4
getDefaultValue(dbDefaultValue);
8
date the database, so we know
5
      // there was no data t
9
		// that we have a DataType object for this column (or we would
10
		// have been stopped from editing by the isEditableXXX methods),
11
		// bu
6
ype object, so this data type is unknown
12
t we need a return here to keep the compiler happy.
7
      // to squirrel and thus cannot be 
13
		
8
edited.
14
return false;
9
      return 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.1
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef);
    1
    IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef);
    2
    if (dataTypeObject != null)
    2
    if (dataTypeObject != null)
                                                                                                                      
    3
    return dataTypeObject.getDefaultValue(dbDefaultValue);
    Preondition Violations
    Unmatched statement return dataTypeObject.getDefaultValue(dbDefaultValue); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement return dataTypeObject.getDefaultValue(dbDefaultValue); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    Unmatched return dataTypeObject.getDefaultValue(dbDefaultValue);
    3
    return dataTypeObject.getDefaultValue(dbDefaultValue);
    3
    return dataTypeObject.areEqual(newValue, oldValue);
    3
    return dataTypeObject.areEqual(newValue, oldValue);
    Preondition Violations
    Unmatched statement return dataTypeObject.areEqual(newValue,oldValue); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return dataTypeObject.areEqual(newValue,oldValue);
                                                                                                              
                                  
    4
    return null;
    Preondition Violations
    Unmatched return null;
    4
    return null;
    4
    return false;
    4
    return false;
    Preondition Violations
    Unmatched return false;
                                    
    Precondition Violations (7)
    Row Violation
    1Unmatched statement return dataTypeObject.getDefaultValue(dbDefaultValue); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement return dataTypeObject.getDefaultValue(dbDefaultValue); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    3Unmatched return dataTypeObject.getDefaultValue(dbDefaultValue);
    4Unmatched statement return dataTypeObject.areEqual(newValue,oldValue); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched return dataTypeObject.areEqual(newValue,oldValue);
    6Unmatched return null;
    7Unmatched return false;