Package: EvaluatedVdmExpression

EvaluatedVdmExpression

nameinstructionbranchcomplexitylinemethod
EvaluatedVdmExpression(IVdmEvaluationResult)
M: 12 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
dispose()
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getDebugTarget()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getErrorMessages()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getErrorMessages(IVdmEvaluationResult)
M: 29 C: 0
0%
M: 6 C: 0
0%
M: 4 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%
getExpressionText()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getLaunch()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getModelIdentifier()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getValue()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
hasErrors()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * #%~
3: * org.overture.ide.debug
4: * %%
5: * Copyright (C) 2008 - 2014 Overture
6: * %%
7: * This program is free software: you can redistribute it and/or modify
8: * it under the terms of the GNU General Public License as
9: * published by the Free Software Foundation, either version 3 of the
10: * License, or (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public
18: * License along with this program. If not, see
19: * <http://www.gnu.org/licenses/gpl-3.0.html>.
20: * #~%
21: */
22: package org.overture.ide.debug.core.model.eval;
23:
24: import org.eclipse.core.runtime.PlatformObject;
25: import org.eclipse.debug.core.DebugException;
26: import org.eclipse.debug.core.ILaunch;
27: import org.eclipse.debug.core.model.IDebugTarget;
28: import org.eclipse.debug.core.model.IErrorReportingExpression;
29: import org.eclipse.debug.core.model.IValue;
30:
31: public class EvaluatedVdmExpression extends PlatformObject implements
32:                 IErrorReportingExpression
33: {
34:         public static String[] getErrorMessages(IVdmEvaluationResult result)
35:         {
36:•                if (result == null)
37:                 {
38:                         return new String[0];
39:                 }
40:                 String messages[] = result.getErrorMessages();
41:•                if (messages.length > 0)
42:                 {
43:                         return messages;
44:                 }
45:                 DebugException exception = result.getException();
46:•                if (exception != null)
47:                 {
48:                         return new String[] { exception.getMessage() };
49:                 }
50:                 return new String[0];
51:         }
52:
53:         private final IVdmEvaluationResult result;
54:
55:         public EvaluatedVdmExpression(IVdmEvaluationResult result)
56:         {
57:•                if (result == null)
58:                 {
59:                         throw new IllegalArgumentException();
60:                 }
61:
62:                 this.result = result;
63:         }
64:
65:         public String[] getErrorMessages()
66:         {
67:                 return getErrorMessages(result);
68:         }
69:
70:         public boolean hasErrors()
71:         {
72:                 return result.hasErrors();
73:         }
74:
75:         public IDebugTarget getDebugTarget()
76:         {
77:                 return result.getThread().getDebugTarget();
78:         }
79:
80:         public String getExpressionText()
81:         {
82:                 return result.getSnippet();
83:         }
84:
85:         public IValue getValue()
86:         {
87:                 return result.getValue();
88:         }
89:
90:         public ILaunch getLaunch()
91:         {
92:                 return getDebugTarget().getLaunch();
93:         }
94:
95:         public String getModelIdentifier()
96:         {
97:                 return getDebugTarget().getModelIdentifier();
98:         }
99:
100:         public void dispose()
101:         {
102:
103:         }
104: }