this(entityName, original, source);
this.requestedId = id;
if ( requestedId == null ) {
throw new IllegalArgumentException(
"attempt to create saveOrUpdate event with null identifier"
);
}
this(entityName, original, source);
this.requestedId = id;
if ( requestedId == null ) {
throw new IllegalArgumentException(
"attempt to create merge event with null identifier"
);
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/SaveOrUpdateEvent.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/MergeEvent.java
|
Method name: void SaveOrUpdateEvent(String, Object, Serializable, EventSource)
|
|
Method name: void MergeEvent(String, Object, Serializable, EventSource)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | this(entityName, original, source);↵ | | 1 | this(entityName, original, source);↵
|
2 | this.requestedId = id;↵ | | 2 | this.requestedId = id;↵
|
3 | if ( requestedId == null ) {↵ | | 3 | if ( requestedId == null ) {↵
|
4 | throw new IllegalArgumentException(↵ | | 4 | throw new IllegalArgumentException(↵
|
5 | "attempt to create saveOrUpdate event with null identifier"↵ | | 5 | "attempt to create merge event with null identifier"↵
|
6 | );↵ | | 6 | );↵
|
7 | } | | 7 | }
|
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 in different classes having the same super class |
Number of node comparisons | 6 |
-
{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.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | this(entityName, original, source); | | 1 | this(entityName, original, source); |
2 | this.requestedId = id; | | 2 | this.requestedId = id; |
3 | if (requestedId == null) | | 3 | if (requestedId == null) |
4 | throw new IllegalArgumentException("attempt to create saveOrUpdate event with null identifier"); | | 4 | throw new IllegalArgumentException("attempt to create merge event with null identifier"); |
Precondition Violations (0)
Row |
Violation |