Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/gcov
diff options
context:
space:
mode:
authorAlexander Kurtakov2014-04-29 07:03:26 +0000
committerAlexander Kurtakov2014-04-29 18:03:19 +0000
commit4f338c8d058add881bde9463f3d3b4bfcb979f9d (patch)
treeff12cb5738fbd7f1aca8e22b199ed833dff7b390 /gcov
parentb6129d7f949767d84bf3d3c35a16f61d20d11312 (diff)
downloadorg.eclipse.linuxtools-4f338c8d058add881bde9463f3d3b4bfcb979f9d.tar.gz
org.eclipse.linuxtools-4f338c8d058add881bde9463f3d3b4bfcb979f9d.tar.xz
org.eclipse.linuxtools-4f338c8d058add881bde9463f3d3b4bfcb979f9d.zip
More cleanups.
* Empty statements * This final field could be made static * Member could be replaced by local variable * 'static' modifier out of order with the JLS suggestions. * strings handling * unused parameters * unnecessary local before return Change-Id: I7e6b45466178696345a057f75278c6c5c8a670ad Signed-off-by: Alexander Kurtakov <akurtako@redhat.com> Reviewed-on: https://git.eclipse.org/r/25708 Tested-by: Hudson CI
Diffstat (limited to 'gcov')
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/dialog/OpenGCDialog.java8
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/CovView.java21
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/annotatedsource/OpenSourceFileAction.java5
3 files changed, 7 insertions, 27 deletions
diff --git a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/dialog/OpenGCDialog.java b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/dialog/OpenGCDialog.java
index 4e4546df68..f9af6ba0e6 100644
--- a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/dialog/OpenGCDialog.java
+++ b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/dialog/OpenGCDialog.java
@@ -67,10 +67,6 @@ public class OpenGCDialog extends Dialog {
private Button openCoverageSummaryButton;
private boolean openCoverageSummary = true;
- /* buttons */
- private Button binBrowseWorkspaceButton;
- private Button binBrowseFileSystemButton;
-
/* error label */
private Label errorLabel;
@@ -149,7 +145,7 @@ public class OpenGCDialog extends Dialog {
data = new GridData(GridData.HORIZONTAL_ALIGN_END);
cbBin.setLayoutData(data);
cbBin.setLayout(new GridLayout(2, true));
- binBrowseWorkspaceButton = new Button(cbBin, SWT.PUSH);
+ Button binBrowseWorkspaceButton = new Button(cbBin, SWT.PUSH);
binBrowseWorkspaceButton.setText(Messages.OpenGCDialog_bin_browser_button_text);
binBrowseWorkspaceButton.addSelectionListener(new SelectionAdapter() {
@Override
@@ -157,7 +153,7 @@ public class OpenGCDialog extends Dialog {
handleBrowseWorkspace(Messages.OpenGCDialog_bin_browser_handler_text, binText);
}
});
- binBrowseFileSystemButton = new Button(cbBin, SWT.PUSH);
+ Button binBrowseFileSystemButton = new Button(cbBin, SWT.PUSH);
binBrowseFileSystemButton.setText(Messages.OpenGCDialog_bin_browser_fs_button_text);
binBrowseFileSystemButton.addSelectionListener(new SelectionAdapter() {
@Override
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 a30a865044..2ba348686b 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
@@ -71,22 +71,11 @@ public class CovView extends AbstractSTDataView {
private Action fileAction;
private Action functionAction;
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractview.AbstractSTDataView#createAbstractSTViewer
- * (org.eclipse.swt.widgets.Composite)
- */
@Override
protected AbstractSTViewer createAbstractSTViewer(Composite parent) {
return new CovViewer(parent);
}
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.linuxtools.dataviewers.abstractview.AbstractSTDataViewer#contributeToToolbar(org.eclipse.jface.action
- * .IToolBarManager)
- */
@Override
protected void contributeToToolbar(IToolBarManager manager) {
manager.add(new Separator());
@@ -98,10 +87,6 @@ public class CovView extends AbstractSTDataView {
manager.add(new ChartAction(getViewSite().getShell(), getSTViewer()));
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.dataviewers.abstractview.AbstractSTDataViewer#createActions()
- */
@Override
protected void createActions() {
super.createActions();
@@ -164,8 +149,9 @@ public class CovView extends AbstractSTDataView {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IFile binary = root.getFileForLocation(new Path(binaryPath));
IProject project = null;
- if (binary != null)
+ if (binary != null) {
project = binary.getProject();
+ }
// parse and process coverage data
CovManager cvrgeMnger = new CovManager(binaryPath, project);
@@ -207,8 +193,7 @@ public class CovView extends AbstractSTDataView {
}
}
String timestamp = DateFormat.getInstance().format(date);
- CovView cvrgeView = displayCovResults(cvrgeMnger, timestamp);
- return cvrgeView;
+ return displayCovResults(cvrgeMnger, timestamp);
} catch (InterruptedException|IOException|CoreException e) {
reportError(e);
}
diff --git a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/annotatedsource/OpenSourceFileAction.java b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/annotatedsource/OpenSourceFileAction.java
index e9253d1256..aa421fb48e 100644
--- a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/annotatedsource/OpenSourceFileAction.java
+++ b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/view/annotatedsource/OpenSourceFileAction.java
@@ -51,9 +51,8 @@ public final class OpenSourceFileAction {
IURIEditorInput editorInput = (IURIEditorInput) input;
URI uri = editorInput.getURI();
try {
- IFileStore fs = EFS.getStore(uri);
- return fs;
- } catch (CoreException _) {
+ return EFS.getStore(uri);
+ } catch (CoreException e) {
return null;
}
}

Back to the top