if (originalValue == null) { // no existing blob to re-use bdesc = new BlobDescriptor(null, byteData, true, true, 0); } else { // for convenience, cast the existing object bdesc = (BlobDescriptor)originalValue; // create new object to hold the different value, but use the same internal BLOB pointer // as the original bdesc = new BlobDescriptor(bdesc.getBlob(), byteData, true, true, 0); }
if (originalValue == null) { // no existing clob to re-use cdesc = new ClobDescriptor(null, value, true, true, 0); } else { // for convenience, cast the existing object cdesc = (ClobDescriptor)originalValue; // create new object to hold the different value, but use the same internal CLOB pointer // as the original cdesc = new ClobDescriptor(cdesc.getClob(),value, true, true, 0); }
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeBlob.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeClob.java
Method name: Object validateAndConvert(String, Object, StringBuffer) Method name: Object validateAndConvert(String, Object, StringBuffer)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (originalValue == null) {
1
if (originalValue == null) {
2
			// no existing blob to re-use
2
			// no existing clob to re-use
3
			bdesc = new BlobDescriptor(null, byteData, true, true, 0);
3
			cdesc = new ClobDescriptor(null, value, true, true, 0);
4
		}
4
		}
5
		else {
5
		else {
6
			// for convenience, cast the existing object
6
			// for convenience, cast the existing object
7
			bdesc = (BlobDescriptor)originalValue;
7
			cdesc = (ClobDescriptor)originalValue;
8
			// create new object to hold the different value, but use the same internal BLOB pointer
8
			// create new object to hold the different value, but use the same internal CLOB pointer
9
			// as the original
9
			// as the original
10
			bdesc = new BlobDescriptor(bdesc.getBlob(), byteData, 
10
			cdesc = new ClobDescriptor(cdesc.getClob(),value,
11
true, true, 0);
11
				true, true, 0);
12
		}
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    if (originalValue == null)
    4
    if (originalValue == null)
                                                                                                            
    5
    cdesc = new ClobDescriptor(null, value, true, true, 0);
    Preondition Violations
    Unmatched statement cdesc=new ClobDescriptor(null,value,true,true,0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    cdesc = new ClobDescriptor(null, value, true, true, 0);
    11
    bdesc = new BlobDescriptor(null, byteData, true, true, 0);
    11
    bdesc = new BlobDescriptor(null, byteData, true, true, 0);
    Preondition Violations
    Unmatched statement bdesc=new BlobDescriptor(null,byteData,true,true,0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                    
    else
            
                                                                                  
    6
    cdesc = (ClobDescriptor)originalValue;
    Preondition Violations
    Unmatched statement cdesc=(ClobDescriptor)originalValue; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6
    cdesc = (ClobDescriptor)originalValue;
                                                                                                                                  
    7
    cdesc = new ClobDescriptor(cdesc.getClob(), value, true, true, 0);
    Preondition Violations
    Unmatched statement cdesc=new ClobDescriptor(cdesc.getClob(),value,true,true,0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7
    cdesc = new ClobDescriptor(cdesc.getClob(), value, true, true, 0);
    12
    bdesc = (BlobDescriptor)originalValue;
    12
    bdesc = (BlobDescriptor)originalValue;
    Preondition Violations
    Unmatched statement bdesc=(BlobDescriptor)originalValue; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                    
    13
    bdesc = new BlobDescriptor(bdesc.getBlob(), byteData, true, true, 0);
    13
    bdesc = new BlobDescriptor(bdesc.getBlob(), byteData, true, true, 0);
    Preondition Violations
    Unmatched statement bdesc=new BlobDescriptor(bdesc.getBlob(),byteData,true,true,0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                          
    Precondition Violations (7)
    Row Violation
    1Unmatched statement cdesc=new ClobDescriptor(null,value,true,true,0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement bdesc=new BlobDescriptor(null,byteData,true,true,0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement cdesc=(ClobDescriptor)originalValue; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement cdesc=new ClobDescriptor(cdesc.getClob(),value,true,true,0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement bdesc=(BlobDescriptor)originalValue; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement bdesc=new BlobDescriptor(bdesc.getBlob(),byteData,true,true,0); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero