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;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 7 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (callerInfoNode != null) | | 1 | if (packageName != null) |
| | | 2 | |
2 | | | | |
Precondition Violations (6)
Row |
Violation |
1 | Type bsh.SimpleNode of variable callerInfoNode does not match with type java.lang.String of variable packageName |
2 | Unmatched statement return packageName; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched return packageName; |
4 | Unmatched statement return callerInfoNode; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched return callerInfoNode; |
6 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |