Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/gcov
diff options
context:
space:
mode:
authorXavier Raynaud2012-03-15 08:03:55 +0000
committerXavier Raynaud2012-03-15 08:03:55 +0000
commit5eeb64cfe05214997f28bd90a075503a2f1270d4 (patch)
tree55443bc19c15cfa894fe4e225b0d5bef400b4e6a /gcov
parentf74026cb39d05fdfc534c5eb4c4c093e4d41d56f (diff)
downloadorg.eclipse.linuxtools-5eeb64cfe05214997f28bd90a075503a2f1270d4.tar.gz
org.eclipse.linuxtools-5eeb64cfe05214997f28bd90a075503a2f1270d4.tar.xz
org.eclipse.linuxtools-5eeb64cfe05214997f28bd90a075503a2f1270d4.zip
fix duplicated code warning
Diffstat (limited to 'gcov')
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/CovView.java24
1 files changed, 8 insertions, 16 deletions
diff --git a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/CovView.java b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/CovView.java
index 2a830eea80..22263320d8 100644
--- a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/CovView.java
+++ b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/CovView.java
@@ -159,19 +159,7 @@ public class CovView extends AbstractSTDataView {
binary, sf, 0);
}
} catch (Exception _) {
- final String message = "An error has occured when parsing "
- + "the coverage data files :\n" + _.getMessage();
- Status status = new Status(Status.ERROR, Activator.PLUGIN_ID,
- IStatus.ERROR, message, _);
-
- Activator.getDefault().getLog().log(status);
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- public void run() {
- Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell();
- MessageDialog.openError(s, "Gcov Parsing Error", message);
- }
- });
- return;
+ reportError(_);
}
}
@@ -193,7 +181,13 @@ public class CovView extends AbstractSTDataView {
CovView cvrgeView = displayCovResults(cvrgeMnger);
return cvrgeView;
} catch (Exception _) {
- final String message = "An error has occured when parsing "
+ reportError(_);
+ }
+ return null;
+ }
+
+ private static void reportError(Exception _) {
+ final String message = "An error has occured when parsing "
+ "the coverage data files :\n" + _.getMessage();
Status status = new Status(Status.ERROR, Activator.PLUGIN_ID,
IStatus.ERROR, message, _);
@@ -205,8 +199,6 @@ public class CovView extends AbstractSTDataView {
MessageDialog.openError(s, "Gcov Parsing Error", message);
}
});
- }
- return null;
}
/**

Back to the top