Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2015-03-03 03:27:29 +0000
committerGerrit Code Review @ Eclipse.org2015-03-04 19:27:39 +0000
commita1b9cc4fbd3a181e0ea4df33bdf2592bd6d321ed (patch)
treeb848c208b6d8dcbc7a5d10f459be2c075c936ff9 /codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan
parent7a245a252038e51f568e236a137fa6b6262eb735 (diff)
downloadorg.eclipse.cdt-a1b9cc4fbd3a181e0ea4df33bdf2592bd6d321ed.tar.gz
org.eclipse.cdt-a1b9cc4fbd3a181e0ea4df33bdf2592bd6d321ed.tar.xz
org.eclipse.cdt-a1b9cc4fbd3a181e0ea4df33bdf2592bd6d321ed.zip
codan - tracing options for printing checker stats
Diffstat (limited to 'codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan')
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/RunCodeAnalysis.java40
1 files changed, 23 insertions, 17 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/RunCodeAnalysis.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/RunCodeAnalysis.java
index d132b45b349..a8b24c63b50 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/RunCodeAnalysis.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/actions/RunCodeAnalysis.java
@@ -14,6 +14,7 @@ import java.util.Iterator;
import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.core.model.CheckerLaunchMode;
+import org.eclipse.cdt.codan.internal.core.CheckersTimeStats;
import org.eclipse.cdt.codan.internal.ui.CodanUIMessages;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
@@ -43,26 +44,31 @@ public class RunCodeAnalysis implements IObjectActionDelegate {
Job job = new Job(CodanUIMessages.Job_TitleRunningAnalysis) {
@Override
protected IStatus run(final IProgressMonitor monitor) {
- int count = ss.size();
- monitor.beginTask(getName(), count * 100);
- if (monitor.isCanceled())
- return Status.CANCEL_STATUS;
- for (Iterator iterator = ss.iterator(); iterator.hasNext();) {
- Object o = iterator.next();
- if (o instanceof IAdaptable) {
- o = ((IAdaptable) o).getAdapter(IResource.class);
- }
- if (o instanceof IResource) {
- IResource res = (IResource) o;
- SubProgressMonitor subMon = new SubProgressMonitor(monitor, 100);
- CodanRuntime.getInstance().getBuilder().processResource(res, subMon, CheckerLaunchMode.RUN_ON_DEMAND);
- if (subMon.isCanceled())
- return Status.CANCEL_STATUS;
- }
+ try {
+ int count = ss.size();
+ monitor.beginTask(getName(), count * 100);
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
+ for (Iterator iterator = ss.iterator(); iterator.hasNext();) {
+ Object o = iterator.next();
+ if (o instanceof IAdaptable) {
+ o = ((IAdaptable) o).getAdapter(IResource.class);
+ }
+ if (o instanceof IResource) {
+ IResource res = (IResource) o;
+ SubProgressMonitor subMon = new SubProgressMonitor(monitor, 100);
+ CodanRuntime.getInstance().getBuilder().processResource(res, subMon, CheckerLaunchMode.RUN_ON_DEMAND);
+ if (subMon.isCanceled())
+ return Status.CANCEL_STATUS;
+ }
+ if (monitor.isCanceled())
+ return Status.CANCEL_STATUS;
+ }
+ return Status.OK_STATUS;
+ } finally {
+ CheckersTimeStats.getInstance().traceStats();
+ CheckersTimeStats.getInstance().reset();
}
- return Status.OK_STATUS;
}
};
job.setUser(true);

Back to the top