if ( callerInfoNode != null ) return callerInfoNode; if ( parent != null ) return parent.getNode(); else return null;
if ( packageName != null ) return packageName; if ( parent != null ) return parent.getPackage(); return null;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/NameSpace.java File path: /jEdit-4.2/src/bsh/NameSpace.java
Method name: SimpleNode getNode() Method name: String getPackage()
Number of AST nodes: 5 Number of AST nodes: 5
1
if ( callerInfoNode != null )
1
if ( packageName != null )
2
			return callerInfoNode;
2
			return packageName;
3
		if ( parent != null )
3
		if ( parent != null )
4
			return parent.getNode();
4
			return parent.getPackage();
5
		else
5
		
6
	
7
		return null;
6
		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.4
Clones locationClones are declared in the same class
Number of node comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (callerInfoNode != null)
    1
    if (callerInfoNode != null)
    1
    if (packageName != null)
    Differences
    Expression1Expression2Difference
    callerInfoNodepackageNameVARIABLE_NAME_MISMATCH
    bsh.SimpleNodejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type bsh.SimpleNode of variable callerInfoNode does not match with type java.lang.String of variable packageName
    • Make classes bsh.SimpleNode and java.lang.String extend a common superclass
    1
    if (packageName != null)
                                                
    2
    return packageName;
    Preondition Violations
    Unmatched statement return packageName; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return packageName;
    2
    return packageName;
    2
    return callerInfoNode;
    2
    return callerInfoNode;
    Preondition Violations
    Unmatched statement return callerInfoNode; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return callerInfoNode;
                                                      
    Precondition Violations (6)
    Row Violation
    1Type bsh.SimpleNode of variable callerInfoNode does not match with type java.lang.String of variable packageName
    2Unmatched statement return packageName; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched return packageName;
    4Unmatched statement return callerInfoNode; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched return callerInfoNode;
    6The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero