Package: Activator

Activator

nameinstructionbranchcomplexitylinemethod
Activator()
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getDefault()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
log(IStatus)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
log(Throwable)
M: 31 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%
logError(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
logError(String, Throwable)
M: 24 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
logWarning(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
logWarning(String, Throwable)
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
start(BundleContext)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
stop(BundleContext)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * #%~
3: * org.overture.ide.vdmrt.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.vdmrt.debug;
23:
24: import org.eclipse.core.runtime.IStatus;
25: import org.eclipse.core.runtime.ListenerList;
26: import org.eclipse.core.runtime.Plugin;
27: import org.eclipse.core.runtime.Status;
28: import org.eclipse.debug.core.DebugException;
29: import org.osgi.framework.BundleContext;
30:
31:
32: public class Activator extends Plugin
33: {
34:         // The plug-in ID
35:         public static final String PLUGIN_ID = IVdmRtDebugConstants.PLUGIN_ID;//"org.overture.core";
36:
37:         public static final boolean DEBUG = true;
38:         public static final int INTERNAL_ERROR = 120;
39:         
40:         
41:         // The shared instance
42:         private static Activator plugin;
43:         
44:         /**
45:          * The constructor
46:          */
47:         public Activator() {
48:         }
49:
50:         /*
51:          * (non-Javadoc)
52:          * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
53:          */
54:         @Override
55:         public void start(BundleContext context) throws Exception {
56:                 super.start(context);
57:                 plugin = this;
58:         }
59:
60:         /*
61:          * (non-Javadoc)
62:          * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
63:          */
64:         @Override
65:         public void stop(BundleContext context) throws Exception {
66:                 plugin = null;
67:                 super.stop(context);
68:         }
69:
70:         /**
71:          * Returns the shared instance
72:          *
73:          * @return the shared instance
74:          */
75:         public static Activator getDefault() {
76:                 return plugin;
77:         }
78:
79:         public static void log(Throwable t) {
80:                 Throwable top = t;
81:•                if (t instanceof DebugException) {
82:                         Throwable throwable = ((DebugException) t).getStatus()
83:                                         .getException();
84:•                        if (throwable != null) {
85:                                 top = throwable;
86:                         }
87:                 }
88:                 log(new Status(IStatus.ERROR, PLUGIN_ID, INTERNAL_ERROR,
89:                                 "internalErrorLoggedFromVdmPpDebugPlugin" + top.getMessage(), top));
90:         }
91:
92:         public static void log(IStatus status) {
93:                 getDefault().getLog().log(status);
94:         }
95:         
96:         public static void logWarning(String message) {
97:                 logWarning(message, null);
98:         }
99:
100:         public static void logWarning(String message, Throwable t) {
101:                 log(new Status(IStatus.WARNING, PLUGIN_ID, INTERNAL_ERROR, message, t));
102:         }
103:
104:         public static void logError(String message) {
105:                 logError(message, null);
106:         }
107:
108:         public static void logError(String message, Throwable t) {
109:                 Throwable top = t;
110:•                if (t instanceof DebugException) {
111:                         Throwable throwable = ((DebugException) t).getStatus()
112:                                         .getException();
113:•                        if (throwable != null) {
114:                                 top = throwable;
115:                         }
116:                 }
117:                 log(new Status(IStatus.ERROR, PLUGIN_ID, INTERNAL_ERROR, message, top));
118:         }
119:         
120:         @SuppressWarnings("unused")
121:         private final ListenerList shutdownListeners = new ListenerList();
122:
123:
124: }