File path: /emf-2.4.1/src/org/eclipse/emf/mapping/impl/MappingImpl.java | File path: /emf-2.4.1/src/org/eclipse/emf/edit/tree/impl/TreeNodeImpl.java | |||
Method name: void setNestedIn(Mapping)
|
Method name: void setParent(TreeNode)
|
|||
Number of AST nodes: 13 | Number of AST nodes: 13 | |||
1 | if (newNestedIn != eInternalContainer() || (eContainerFeatureID != MappingPackage.MAPPING__NESTED_IN && newNestedIn != null))↵ | 1 | if (newParent != eInternalContainer() || (eContainerFeatureID != TreePackage.TREE_NODE__PARENT && newParent != null))↵ | |
2 | {↵ | 2 | {↵ | |
3 | if (EcoreUtil.isAncestor(this, newNestedIn))↵ | 3 | if (EcoreUtil.isAncestor(this, newParent))↵ | |
4 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString());↵ | 4 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString());↵ | |
5 | NotificationChain msgs = null;↵ | 5 | NotificationChain msgs = null;↵ | |
6 | if (eInternalContainer() != null)↵ | 6 | if (eInternalContainer() != null)↵ | |
7 | msgs = eBasicRemoveFromContainer(msgs);↵ | 7 | msgs = eBasicRemoveFromContainer(msgs);↵ | |
8 | if (newNestedIn != null)↵ | 8 | if (newParent != null)↵ | |
9 | msgs = ((InternalEObject)newNestedIn).eInverseAdd(this, MappingPackage.MAPPING__NESTED, Mapping.class, msgs);↵ | 9 | msgs = ((InternalEObject)newParent).eInverseAdd(this, TreePackage.TREE_NODE__CHILDREN, TreeNode.class, msgs);↵ | |
10 | msgs = basicSetNestedIn(newNestedIn, msgs);↵ | 10 | msgs = basicSetParent(newParent, msgs);↵ | |
11 | if (msgs != null) msgs.dispatch();↵ | 11 | if (msgs != null) msgs.dispatch();↵ | |
12 | }↵ | 12 | }↵ | |
13 | else if (eNotificationRequired())↵ | 13 | else if (eNotificationRequired())↵ | |
14 | eNotify(new ENotificationImpl(this, Notification.SET, MappingPackage.MAPPING__NESTED_IN, newNestedIn, newNestedIn)); | 14 | eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.TREE_NODE__PARENT, newParent, newParent)); | |
See real code fragment | See real code fragment |
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.9 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 59 |
Number of mapped statements | 12 |
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) | 2.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (newNestedIn != eInternalContainer() || (eContainerFeatureID != MappingPackage.MAPPING__NESTED_IN && newNestedIn != null)) |
| 1 | if (newParent != eInternalContainer() || (eContainerFeatureID != TreePackage.TREE_NODE__PARENT && newParent != null)) | ||||||||||||||||||||||||||||
2 | if (EcoreUtil.isAncestor(this, newNestedIn)) |
| 2 | if (EcoreUtil.isAncestor(this, newParent)) | ||||||||||||||||||||||||||||
3 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); | 3 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); | |||||||||||||||||||||||||||||
4 | NotificationChain msgs = null; | 4 | NotificationChain msgs = null; | |||||||||||||||||||||||||||||
5 | if (eInternalContainer() != null) | 5 | if (eInternalContainer() != null) | |||||||||||||||||||||||||||||
6 | msgs = eBasicRemoveFromContainer(msgs); | 6 | msgs = eBasicRemoveFromContainer(msgs); | |||||||||||||||||||||||||||||
7 | if (newNestedIn != null) |
| 7 | if (newParent != null) | ||||||||||||||||||||||||||||
8 | msgs = ((InternalEObject)newNestedIn).eInverseAdd(this, MappingPackage.MAPPING__NESTED, Mapping.class, msgs); |
| 8 | msgs = ((InternalEObject)newParent).eInverseAdd(this, TreePackage.TREE_NODE__CHILDREN, TreeNode.class, msgs); | ||||||||||||||||||||||||||||
|
| 9 | msgs = basicSetParent(newParent, msgs); | |||||||||||||||||||||||||||||
9 | msgs = basicSetNestedIn(newNestedIn, msgs); |
| | |||||||||||||||||||||||||||||
10 | if (msgs != null) | 10 | if (msgs != null) | |||||||||||||||||||||||||||||
11 | msgs.dispatch(); | 11 | msgs.dispatch(); | |||||||||||||||||||||||||||||
12 | else if (eNotificationRequired()) | 12 | else if (eNotificationRequired()) | |||||||||||||||||||||||||||||
13 | eNotify(new ENotificationImpl(this, Notification.SET, MappingPackage.MAPPING__NESTED_IN, newNestedIn, newNestedIn)); |
| 13 | eNotify(new ENotificationImpl(this, Notification.SET, TreePackage.TREE_NODE__PARENT, newParent, newParent)); |
Row | Violation |
---|---|
1 | Type org.eclipse.emf.mapping.Mapping of variable newNestedIn does not match with type org.eclipse.emf.edit.tree.TreeNode of variable newParent |
2 | Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage |
3 | Type org.eclipse.emf.mapping.Mapping of variable newNestedIn does not match with type org.eclipse.emf.edit.tree.TreeNode of variable newParent |
4 | Type org.eclipse.emf.mapping.Mapping of variable newNestedIn does not match with type org.eclipse.emf.edit.tree.TreeNode of variable newParent |
5 | Type org.eclipse.emf.mapping.Mapping of variable newNestedIn does not match with type org.eclipse.emf.edit.tree.TreeNode of variable newParent |
6 | Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage |
7 | Type org.eclipse.emf.mapping.Mapping of variable newNestedIn does not match with type org.eclipse.emf.edit.tree.TreeNode of variable newParent |
8 | Unmatched statement msgs=basicSetParent(newParent,msgs); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement msgs=basicSetNestedIn(newNestedIn,msgs); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
10 | Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.edit.tree.TreePackage of variable TreePackage |
11 | Type org.eclipse.emf.mapping.Mapping of variable newNestedIn does not match with type org.eclipse.emf.edit.tree.TreeNode of variable newParent |