Skip to content

Package: EcoreDiagnosticCache

EcoreDiagnosticCache

nameinstructionbranchcomplexitylinemethod
EcoreDiagnosticCache(Notifier)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
updateCache(EObject, DiagnosticCache)
M: 17 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
updateCacheWithoutRefresh(EObject, DiagnosticCache)
M: 9 C: 8
47%
M: 3 C: 1
25%
M: 2 C: 1
33%
M: 3 C: 3
50%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2018 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Johannes Faltermeier - initial API and implementation
13: * Christian W. Damus - bug 533522
14: ******************************************************************************/
15: package org.eclipse.emfforms.internal.editor.ecore;
16:
17: import org.eclipse.emf.common.notify.Notifier;
18: import org.eclipse.emf.ecore.EObject;
19: import org.eclipse.emfforms.spi.swt.treemasterdetail.diagnostic.DiagnosticCache;
20:
21: /**
22: * {@link DiagnosticCache} for ecore.
23: */
24: public class EcoreDiagnosticCache extends DiagnosticCache {
25:
26:         /**
27:          * @param input the input
28:          */
29:         public EcoreDiagnosticCache(Notifier input) {
30:                 super(input);
31:
32:         }
33:
34:         @Override
35:         protected void updateCache(EObject element, DiagnosticCache cache) {
36:                 super.updateCache(element, cache);
37:
38:                 // In the initial walk over the contents, we will already have processed
39:                 // the containment chain
40:•                if (!isInitializing()) {
41:                         final EObject parent = element.eContainer();
42:•                        if (parent != null) {
43:                                 updateCache(parent, cache);
44:                         }
45:                 }
46:         }
47:
48:         @Override
49:         protected void updateCacheWithoutRefresh(EObject element, DiagnosticCache cache) {
50:                 super.updateCacheWithoutRefresh(element, cache);
51:
52:                 // In the initial walk over the contents, we will already have processed
53:                 // the containment chain
54:•                if (!isInitializing()) {
55:                         final EObject parent = element.eContainer();
56:•                        if (parent != null) {
57:                                 updateCacheWithoutRefresh(parent, cache);
58:                         }
59:                 }
60:         }
61:
62: }