Object obj = BeanShell.runCachedBlock( replaceMethod,null,replaceNS); if(obj == null) return ""; else return obj.toString();
Object obj = BeanShell.runCachedBlock( replaceMethod, null,replaceNS); if(obj == null) return ""; else return obj.toString();
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/search/SearchAndReplace.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/search/SearchAndReplace.java
Method name: String regexpBeanShellReplace(SearchMatcher.Match) Method name: String literalBeanShellReplace(String)
Number of AST nodes: 4 Number of AST nodes: 4
1
Object obj = BeanShell.runCachedBlock(
1
Object obj = BeanShell.runCachedBlock(
2
			replaceMethod,
2
			replaceMethod,
3
null,replaceNS);
3
			null,replaceNS);
4
		if(obj == null)
4
		if(obj == null)
5
			return "";
5
			return "";
6
		else
6
		else
7
			return obj.toString();
7
			return obj.toString();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
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. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    3
    Object obj = BeanShell.runCachedBlock(replaceMethod, null, replaceNS);
    2
    Object obj = BeanShell.runCachedBlock(replaceMethod, null, replaceNS);
    4
    if (obj == null)
    3
    if (obj == null)
    5
    return "";
    4
    return "";
    else
    else
    6
    return obj.toString();
    5
    return obj.toString();
    Precondition Violations (0)
    Row Violation