SimpleNode node = getNode(); if ( node != null ) return node.getLineNumber(); else return -1;
SimpleNode node = getNode(); if ( node != null ) return node.getText(); else return "<invoked from Java code>";
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: int getInvocationLine() Method name: String getInvocationText()
Number of AST nodes: 4 Number of AST nodes: 4
1
SimpleNode node = getNode();
1
SimpleNode node = getNode();
2
		if ( node != null )
2
		if ( node != null )
3
			return node.getLineNumber();
3
			return node.getText();
4
		else
4
		else
5
			return -1;
5
			return "<invoked from Java code>";
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.2
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    SimpleNode node = getNode();
    1
    SimpleNode node = getNode();
    2
    if (node != null)
    2
    if (node != null)
                                                      
    3
    return node.getText();
    Preondition Violations
    Unmatched statement return node.getText(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return node.getText();
    3
    return node.getText();
    3
    return node.getLineNumber();
    3
    return node.getLineNumber();
    Preondition Violations
    Unmatched statement return node.getLineNumber(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return node.getLineNumber();
                                                                  
    else
            
                                                                              
    4
    return "<invoked from Java code>";
    Preondition Violations
    Unmatched return "<invoked from Java code>";
    4
    return "<invoked from Java code>";
    4
    return -1;
    4
    return -1;
    Preondition Violations
    Unmatched return -1;
                              
    Precondition Violations (6)
    Row Violation
    1Unmatched statement return node.getText(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched return node.getText();
    3Unmatched statement return node.getLineNumber(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return node.getLineNumber();
    5Unmatched return "<invoked from Java code>";
    6Unmatched return -1;