if (obj1 == obj2)
return true;
// if both objs are null, then they matched in the previous test,
// so at this point we know that at least one of them (or both) is not null.
// However, one of them may still be null, and we cannot call equals() on
// the null object, so make sure that the one we call it on is not null.
// The equals() method handles the other one being null, if it is.
if (obj1 != null)
return ((ClobDescriptor)obj1).equals((ClobDescriptor)obj2);
else
return ((ClobDescriptor)obj2).equals((ClobDescriptor)obj1);
if (obj1 == obj2)
return true;
// if both objs are null, then they matched in the previous test,
// so at this point we know that at least one of them (or both) is not null.
// However, one of them may still be null, and we cannot call equals() on
// the null object, so make sure that the one we call it on is not null.
// The equals() method handles the other one being null, if it is.
if (obj1 != null)
return ((BlobDescriptor)obj1).equals((BlobDescriptor)obj2);
else
return ((BlobDescriptor)obj2).equals((BlobDescriptor)obj1);
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeClob.java
|
|
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeBlob.java
|
Method name: boolean areEqual(Object, Object)
|
|
Method name: boolean areEqual(Object, Object)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (obj1 == obj2)↵ | | 1 | if (obj1 == obj2)↵
|
2 | return true;↵ | | 2 | return true;↵
|
|
3 | // if both objs are null, then they matched in the previous test,↵ | | 3 | // if both objs are null, then they matched in the previous test,↵
|
4 | // so at this point we know that at least one of them (or both) is not null.↵ | | 4 | // so at this point we know that at least one of them (or both) is not null.↵
|
5 | // However, one of them may still be null, and we cannot call equals() on↵ | | 5 | // However, one of them may still be null, and we cannot call equals() on↵
|
6 | // the null object, so make sure that the one we call it on is not null.↵ | | 6 | // the null object, so make sure that the one we call it on is not null.↵
|
7 | // The equals() method handles the other one being null, if it is.↵ | | 7 | // The equals() method handles the other one being null, if it is.↵
|
8 | if (obj1 != null)↵ | | 8 | if (obj1 != null)↵
|
9 | return ((ClobDescriptor)obj1).equals((ClobDescriptor)obj2);↵ | | 9 | return ((BlobDescriptor)obj1).equals((BlobDescriptor)obj2);↵
|
10 | else↵ | | 10 | else↵
|
11 | return ((ClobDescriptor)obj2).equals((ClobDescriptor)obj1); | | 11 | return ((BlobDescriptor)obj2).equals((BlobDescriptor)obj1);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 15 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (obj1 == obj2) | | 1 | if (obj1 == obj2) |
2 | | | 2 | |
3 | if (obj1 != null) | | 3 | if (obj1 != null) |
4 | return ((ClobDescriptor)obj1).equals((ClobDescriptor)obj2); | | 4 | return ((BlobDescriptor)obj1).equals((BlobDescriptor)obj2); |
| | | | |
5 | return ((ClobDescriptor)obj2).equals((ClobDescriptor)obj1); | | 5 | return ((BlobDescriptor)obj2).equals((BlobDescriptor)obj1); |
Precondition Violations (8)
Row |
Violation |
1 | Type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.ClobDescriptor does not match with type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BlobDescriptor |
2 | Expression (ClobDescriptor)obj1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression (BlobDescriptor)obj1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.ClobDescriptor does not match with type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BlobDescriptor |
5 | Expression (ClobDescriptor)obj1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression (BlobDescriptor)obj1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.ClobDescriptor does not match with type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BlobDescriptor |
8 | Type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.ClobDescriptor does not match with type net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.BlobDescriptor |