if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ErrorInfo other = (ErrorInfo) obj; if (key == null) { if (other.key != null) { return false; } } else if (!key.equals(other.key)) { return false; } return true;
if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } FileWrapperImpl other = (FileWrapperImpl) obj; if (_wrappedFile == null) { if (other._wrappedFile != null) { return false; } } else if (!_wrappedFile.equals(other._wrappedFile)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/parser/kernel/ErrorInfo.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/FileWrapperImpl.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 13 Number of AST nodes: 13
1
if (this == obj) { return true; }
1
if (this == obj) { return true; }
2
		if (obj == null) { return false; }
2
		if (obj == null) { return false; }
3
		if (getClass() != obj.getClass()) { return false; }
3
		if (getClass() != obj.getClass()) { return false; }
4
		ErrorInfo other = (ErrorInfo) obj;
4
		FileWrapperImpl other = (FileWrapperImpl) obj;
5
		if (key == null)
5
		if (_wrappedFile == null)
6
		{
6
		{
7
			if (other.key != null) { return false; }
7
			if (other._wrappedFile != null) { return false; }
8
		}
8
		}
9
		else if (!key.equals(other.key)) { return false; }
9
		else if (!_wrappedFile.equals(other._wrappedFile)) { return false; }
10
		return true;
10
		return true;
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)2.1
Clones locationClones are in different classes
Number of node comparisons34
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)4.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this == obj)
    1
    if (this == obj)
    2
    return true;
    2
    return true;
    3
    if (obj == null)
    3
    if (obj == null)
    4
    return false;
    4
    return false;
    5
    if (getClass() != obj.getClass())
    5
    if (getClass() != obj.getClass())
    5
    if (getClass() != obj.getClass())
    Differences
    Expression1Expression2Difference
    java.lang.Classjava.lang.ClassVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Class<> of variable getClass() does not match with type java.lang.Class<> of variable getClass()
    • Make classes java.lang.Class and java.lang.Class extend a common superclass
    5
    if (getClass() != obj.getClass())
    6
    return false;
    6
    return false;
                                                                                                
    7
    FileWrapperImpl other = (FileWrapperImpl)obj;
    7
    ErrorInfo other = (ErrorInfo)obj;
                                                                        
    8
    if (key == null)
    8
    if (key == null)
    8
    if (_wrappedFile == null)
    Differences
    Expression1Expression2Difference
    key_wrappedFileVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.io.FileVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable key does not match with type java.io.File of variable _wrappedFile
    • Make classes java.lang.String and java.io.File extend a common superclass
    8
    if (_wrappedFile == null)
    9
    if (other.key != null)
    9
    if (other.key != null)
    9
    if (other._wrappedFile != null)
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.session.parser.kernel.ErrorInfonet.sourceforge.squirrel_sql.fw.util.FileWrapperImplVARIABLE_TYPE_MISMATCH
    key_wrappedFileVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.io.FileVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable other.key does not match with type java.io.File of variable other._wrappedFile
    • Make classes net.sourceforge.squirrel_sql.client.session.parser.kernel.ErrorInfo and net.sourceforge.squirrel_sql.fw.util.FileWrapperImpl extend a common superclass
    Expression other.key cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression other._wrappedFile cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable other.key does not match with type java.io.File of variable other._wrappedFile
    • Make classes java.lang.String and java.io.File extend a common superclass
    9
    if (other._wrappedFile != null)
    10
    return false;
    10
    return false;
    11
    else if (!key.equals(other.key))
    11
    else if (!key.equals(other.key))
    11
    else if (!_wrappedFile.equals(other._wrappedFile))
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.session.parser.kernel.ErrorInfonet.sourceforge.squirrel_sql.fw.util.FileWrapperImplVARIABLE_TYPE_MISMATCH
    key_wrappedFileVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.io.FileVARIABLE_TYPE_MISMATCH
    key_wrappedFileVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.io.FileVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable other.key does not match with type java.io.File of variable other._wrappedFile
    • Make classes net.sourceforge.squirrel_sql.client.session.parser.kernel.ErrorInfo and net.sourceforge.squirrel_sql.fw.util.FileWrapperImpl extend a common superclass
    Expression other.key cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression other._wrappedFile cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable other.key does not match with type java.io.File of variable other._wrappedFile
    • Make classes java.lang.String and java.io.File extend a common superclass
    Type java.lang.String of variable key does not match with type java.io.File of variable _wrappedFile
    • Make classes java.lang.String and java.io.File extend a common superclass
    11
    else if (!_wrappedFile.equals(other._wrappedFile))
    12
    return false;
    12
    return false;
    13
    return true;
    13
    return true;
    Precondition Violations (11)
    Row Violation
    1Type java.lang.Class<> of variable getClass() does not match with type java.lang.Class<> of variable getClass()
    2Type java.lang.String of variable key does not match with type java.io.File of variable _wrappedFile
    3Type java.lang.String of variable other.key does not match with type java.io.File of variable other._wrappedFile
    4Expression other.key cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression other._wrappedFile cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type java.lang.String of variable other.key does not match with type java.io.File of variable other._wrappedFile
    7Type java.lang.String of variable other.key does not match with type java.io.File of variable other._wrappedFile
    8Expression other.key cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression other._wrappedFile cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type java.lang.String of variable other.key does not match with type java.io.File of variable other._wrappedFile
    11Type java.lang.String of variable key does not match with type java.io.File of variable _wrappedFile