if(object == null)
throw new NullPointerException("constructed empty LHS");
type = PROPERTY;
this.object = object;
this.propName = propName;
if ( object == null)
throw new NullPointerException("constructed empty LHS");
type = FIELD;
this.object = object;
this.field = field;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/bsh/LHS.java
|
|
File path: /jEdit-4.2/src/bsh/LHS.java
|
Method name: void LHS(Object, String)
|
|
Method name: void LHS(Object, Field)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if(object == null)↵ | | 1 | if ( object == null)↵
|
2 | throw new NullPointerException("constructed empty LHS");↵ | | 2 | throw new NullPointerException("constructed empty LHS");↵
|
|
3 | type = PROPERTY;↵ | | 3 | type = FIELD;↵
|
4 | this.object = object;↵ | | 4 | this.object = object;↵
|
5 | this.propName = propName; | | 5 | this.field = field;
|
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.1 |
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 | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (object == null) | | 1 | if (object == null) |
2 | throw new NullPointerException("constructed empty LHS"); | | 2 | throw new NullPointerException("constructed empty LHS"); |
3 | type = PROPERTY; | | 3 | type = FIELD; |
4 | this.object = object; | | 4 | this.object = object; |
| | | 5 | this.field = field; |
5 | this.propName = propName; | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement this.field=field; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement this.propName=propName; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |