EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcmbench.tabs.parameters]

COVERAGE SUMMARY FOR SOURCE FILE [ParameterUtil.java]

nameclass, %method, %block, %line, %
ParameterUtil.java0%   (0/1)0%   (0/2)0%   (0/130)0%   (0/38)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ParameterUtil0%   (0/1)0%   (0/2)0%   (0/130)0%   (0/38)
ParameterUtil (): void 0%   (0/1)0%   (0/3)0%   (0/1)
copyReference (EReference, EObject, EObject): void 0%   (0/1)0%   (0/127)0%   (0/37)

1package de.uka.ipd.sdq.pcmbench.tabs.parameters;
2 
3import java.util.Iterator;
4import java.util.List;
5 
6import org.eclipse.emf.ecore.EObject;
7import org.eclipse.emf.ecore.util.InternalEList;
8import org.eclipse.emf.ecore.util.EcoreUtil.Copier;
9 
10import org.eclipse.emf.ecore.EReference;
11 
12public class ParameterUtil extends Copier {
13 
14        /**
15         * 
16         */
17        private static final long serialVersionUID = 3504940555318719080L;
18 
19        /*
20         * (non-Javadoc)
21         * 
22         * @see org.eclipse.emf.ecore.util.EcoreUtil.Copier#copyReference(org.eclipse.emf.ecore.EReference,
23         *      org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
24         */
25        @SuppressWarnings("unchecked")
26        @Override
27        protected void copyReference(EReference eReference, EObject eObject,
28                        EObject copyEObject) {
29                if (eObject.eIsSet(eReference)) {
30                        if (eReference.isMany()) {
31                                List source = (List) eObject.eGet(eReference);
32                                InternalEList<Object> target = (InternalEList<Object>) copyEObject
33                                                .eGet(getTarget(eReference));
34                                if (source.isEmpty()) {
35                                        target.clear();
36                                } else {
37                                        boolean isBidirectional = eReference.getEOpposite() != null;
38                                        int index = 0;
39                                        for (Iterator k = source.iterator(); k.hasNext();) {
40                                                Object referencedEObject = k.next();
41                                                Object copyReferencedEObject = get(referencedEObject);
42                                                if (copyReferencedEObject == null) {
43                                                        if (!isBidirectional) {
44                                                                target.addUnique(index, referencedEObject);
45                                                                ++index;
46                                                        }
47                                                } else {
48                                                        if (isBidirectional) {
49                                                                int position = target
50                                                                                .indexOf(copyReferencedEObject);
51                                                                if (position == -1) {
52                                                                        target.addUnique(index,
53                                                                                        copyReferencedEObject);
54                                                                } else if (index != position) {
55                                                                        target.move(index, copyReferencedEObject);
56                                                                }
57                                                        } else {
58                                                                target.addUnique(index, copyReferencedEObject);
59                                                        }
60                                                        ++index;
61                                                }
62                                        }
63                                }
64                        } else {
65                                Object referencedEObject = eObject.eGet(eReference);
66                                if (referencedEObject == null) {
67                                        copyEObject.eSet(getTarget(eReference), null);
68                                } else {
69                                        Object copyReferencedEObject = get(referencedEObject);
70                                        if (copyReferencedEObject == null) {
71                                                if (eReference.getEOpposite() == null && !eReference.getName().equals("expression")) {
72                                                        copyEObject.eSet(getTarget(eReference),
73                                                                        referencedEObject);
74                                                }
75                                        } else {
76                                                copyEObject.eSet(getTarget(eReference),
77                                                                copyReferencedEObject);
78                                        }
79                                }
80                        }
81                }
82        }
83 
84}

[all classes][de.uka.ipd.sdq.pcmbench.tabs.parameters]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov