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();
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 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 | | | 4 | |
| | | | |
6 | | | 5 | |
Precondition Violations (0)
Row |
Violation |