if (c == null) { // the other obj is null, so see if this non-null obj contains // a null value, which is equivilent. // Assume that if we have read some of the data and we still have // _data == null, then the value in the DB is actually null. if (_blobRead == true && _data == null) return true; else return false; } if (c.getBlobRead() == false) { // the other obj has not read the data yet. if (_blobRead == true) return false; // we have read data, so that is not the same state else return true; // odd-ball case: assume if neither has read data that they are equal } // the other object has real data if (_blobRead == false) return false; // this one does not, so they are not equal // both have actual data, so compare the strings // Note that if one has read all of the data and the other has read only part // of the data that we will say that they are NOT equal. return Arrays.equals(c.getData(), _data);
if (c == null) { // the other obj is null, so see if this non-null obj contains // a null value, which is equivilent. // Assume that if we have read some of the data and we still have // _data == null, then the value in the DB is actually null. if (_clobRead == true && _data == null) return true; else return false; } if (c.getClobRead() == false) { // the other obj has not read the data yet. if (_clobRead == true) return false; // we have read data, so that is not the same state else return true; // odd-ball case: assume if neither has read data that they are equal } // the other object has real data if (_clobRead == false) return false; // this one does not, so they are not equal // both have actual data, so compare the strings // Note that if one has read all of the data and the other has read only part // of the data that we will say that they are NOT equal. return c.getData().equals(_data);
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/BlobDescriptor.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/ClobDescriptor.java
Method name: boolean equals(BlobDescriptor) Method name: boolean equals(ClobDescriptor)
Number of AST nodes: 11 Number of AST nodes: 11
1
if (c == null) {
1
if (c == null) {
2
			// the other obj is null, so see if this non-null obj contains
2
			// the other obj is null, so see if this non-null obj contains
3
			// a null value, which is equivilent.
3
			// a null value, which is equivilent.
4
			// Assume that if we have read some of the data and we still have
4
			// Assume that if we have read some of the data and we still have
5
			// _data == null, then the value in the DB is actually null.
5
			// _data == null, then the value in the DB is actually null.
6
			if (_blobRead == true && _data == null)
6
			if (_clobRead == true && _data == null)
7
				return true;
7
				return true;
8
			else
8
			else
9
				return false;
9
				return false;
10
		}
10
		}
11
		
12
		if (c.getBlobRead() == false) {
11
		if (c.getClobRead() == false) {
13
			// the other obj has not read the data yet.
12
			// the other obj has not read the data yet.
14
			if (_blobRead == true)
13
			if (_clobRead == true)
15
				return false;	// we have read data, so that is not the same state
14
				return false;	// we have read data, so that is not the same state
16
			else return true;	//  odd-ball case: assume if neither has read data that they are equal
15
			else return true;	//  odd-ball case: assume if neither has read data that they are equal
17
		}
16
		}
18
		
19
		// the other object has real data
17
		// the other object has real data
20
		if (_blobRead == false)
18
		if (_clobRead == false)
21
			return false;	// this one does not, so they are not equal
19
			return false;	// this one does not, so they are not equal
22
		
23
		// both have actual data, so compare the strings
20
		// both have actual data, so compare the strings
24
		// Note that if one has read all of the data and the other has read only part
21
		// Note that if one has read all of the data and the other has read only part
25
		// of the data that we will say that they are NOT equal.
22
		// of the data that we will say that they are NOT equal.
26
		return Arrays.equals(c.getData(), _data);
23
		return c.getData().equals(_data);
Summary
Number of common nesting structure subtrees2
Number of refactorable cases2
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.7
Clones locationClones are in different classes
Number of node comparisons22
  1. {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)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (_blobRead == true && _data == null)
    2
    if (_blobRead == true && _data == null)
    6
    if (_clobRead == true)
    Differences
    Expression1Expression2Difference
    &&==OPERATOR_MISMATCH
    _blobRead == true_clobReadINFIX_LEFT_OPERAND_MISMATCH
    _data == nulltrueINFIX_RIGHT_OPERAND_MISMATCH
    6
    if (_clobRead == true)
    3
    return true;
    3
    return true;
    7
    return false;
    Differences
    Expression1Expression2Difference
    truefalseLITERAL_VALUE_MISMATCH
    7
    return false;
    else
    else
    4
    return false;
    4
    return false;
    8
    return true;
    Differences
    Expression1Expression2Difference
    falsetrueLITERAL_VALUE_MISMATCH
    8
    return true;
    Precondition Violations (0)
    Row Violation
  2. {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)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    if (_blobRead == true)
    6
    if (_blobRead == true)
    2
    if (_clobRead == true && _data == null)
    Differences
    Expression1Expression2Difference
    ==&&OPERATOR_MISMATCH
    _blobRead_clobRead == trueINFIX_LEFT_OPERAND_MISMATCH
    true_data == nullINFIX_RIGHT_OPERAND_MISMATCH
    2
    if (_clobRead == true && _data == null)
    7
    return false;
    7
    return false;
    3
    return true;
    Differences
    Expression1Expression2Difference
    falsetrueLITERAL_VALUE_MISMATCH
    3
    return true;
    else
    else
    8
    return true;
    8
    return true;
    4
    return false;
    Differences
    Expression1Expression2Difference
    truefalseLITERAL_VALUE_MISMATCH
    4
    return false;
    Precondition Violations (0)
    Row Violation