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.3
Clones locationClones are declared in the same class
Number of node comparisons15
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 3
    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 return packageName;
    2
    return packageName;
    2
    return callerInfoNode;
    2
    return callerInfoNode;
    Preondition Violations
    Unmatched return callerInfoNode;
                                                      
    3
    if (parent != null)
    3
    if (parent != null)
                                                                
    4
    return parent.getPackage();
    Preondition Violations
    Unmatched statement return parent.getPackage(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return parent.getPackage();
    4
    return parent.getPackage();
    4
    return parent.getNode();
    4
    return parent.getNode();
    Preondition Violations
    Unmatched statement return parent.getNode(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return parent.getNode();
                                                          
    else
            
    5
    return null;
    5
    return null;
    Preondition Violations
    Unmatched return null;
                                  
                                  
    5
    return null;
    Preondition Violations
    Unmatched return null;
    5
    return null;
    Precondition Violations (9)
    Row Violation
    1Type bsh.SimpleNode of variable callerInfoNode does not match with type java.lang.String of variable packageName
    2Unmatched return packageName;
    3Unmatched return callerInfoNode;
    4Unmatched statement return parent.getPackage(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched return parent.getPackage();
    6Unmatched statement return parent.getNode(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Unmatched return parent.getNode();
    8Unmatched return null;
    9Unmatched return null;