Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/gcov
diff options
context:
space:
mode:
authorAlexander Kurtakov2014-04-30 06:13:42 +0000
committerAlexander Kurtakov2014-04-30 07:33:09 +0000
commitca725d47dc4316bf434534ba43f0428322fcc028 (patch)
tree54ef02502f640ed4b7cf84d992e26cb443b92069 /gcov
parent633404bb1c87db9fcd02af7939b1a5417b95b10f (diff)
downloadorg.eclipse.linuxtools-ca725d47dc4316bf434534ba43f0428322fcc028.tar.gz
org.eclipse.linuxtools-ca725d47dc4316bf434534ba43f0428322fcc028.tar.xz
org.eclipse.linuxtools-ca725d47dc4316bf434534ba43f0428322fcc028.zip
Cleanups.
* Member to variable. * String.isEmpty usage. * Unnecessary local before return. * Naming conventions * Integer instantiation * Dead store to local variable Change-Id: I96b495245a2505fcbd608965319b3565edf513ff Signed-off-by: Alexander Kurtakov <akurtako@redhat.com> Reviewed-on: https://git.eclipse.org/r/25766 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.java13
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/CovManager.java8
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcnoRecordsParser.java4
3 files changed, 10 insertions, 15 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 f9af6ba0e6..ca0f52feb4 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
@@ -63,8 +63,6 @@ public class OpenGCDialog extends Dialog {
private Text binText;
private String binValue;
- private Button openThisFileOnlyButton;
- private Button openCoverageSummaryButton;
private boolean openCoverageSummary = true;
/* error label */
@@ -73,9 +71,6 @@ public class OpenGCDialog extends Dialog {
/* validation boolean */
private boolean binaryValid;
- /* internal listener */
- private final BinaryModifyListener binModifyListener = new BinaryModifyListener();
-
private final String defaultValue;
private final IPath gcFile;
@@ -139,7 +134,7 @@ public class OpenGCDialog extends Dialog {
data = new GridData(GridData.FILL_HORIZONTAL);
data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
binText.setLayoutData(data);
- binText.addModifyListener(binModifyListener);
+ binText.addModifyListener(new BinaryModifyListener());
Composite cbBin = new Composite(c, SWT.NONE);
data = new GridData(GridData.HORIZONTAL_ALIGN_END);
@@ -168,9 +163,9 @@ public class OpenGCDialog extends Dialog {
GridData covModeData = new GridData(GridData.FILL_BOTH);
covMode.setLayoutData(covModeData);
covMode.setLayout(new GridLayout());
- openThisFileOnlyButton = new Button(covMode, SWT.RADIO);
+ Button openThisFileOnlyButton = new Button(covMode, SWT.RADIO);
openThisFileOnlyButton.setLayoutData(new GridData());
- openCoverageSummaryButton = new Button(covMode, SWT.RADIO);
+ final Button openCoverageSummaryButton = new Button(covMode, SWT.RADIO);
openCoverageSummaryButton.setLayoutData(new GridData());
String cFile = gcFile.removeFileExtension().lastSegment() + ".c"; //$NON-NLS-1$
@@ -224,7 +219,7 @@ public class OpenGCDialog extends Dialog {
} else {
binaryValid = false;
getButton(IDialogConstants.OK_ID).setEnabled(false);
- if (!binValue.equals("")) { //$NON-NLS-1$
+ if (!binValue.isEmpty()) {
errorLabel.setText(NLS.bind(Messages.OpenGCDialog_bin_dne_error_label, binText.getText()));
} else {
errorLabel.setText(Messages.OpenGCDialog_no_bin_error_label);
diff --git a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/CovManager.java b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/CovManager.java
index 4a59f8cc2c..42894f6802 100644
--- a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/CovManager.java
+++ b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/CovManager.java
@@ -120,7 +120,7 @@ public class CovManager implements Serializable {
for (String gcdaPath : covFilesPaths) {
String gcnoPath = gcdaPath.replace(".gcda", ".gcno"); //$NON-NLS-1$ //$NON-NLS-2$
// parse GCNO file
- traceFile = OpenTraceFileStream(gcnoPath, ".gcno", sourcePath); //$NON-NLS-1$
+ traceFile = openTraceFileStream(gcnoPath, ".gcno", sourcePath); //$NON-NLS-1$
if (traceFile == null) {
return;
}
@@ -138,7 +138,7 @@ public class CovManager implements Serializable {
}
// parse GCDA file
- traceFile = OpenTraceFileStream(gcdaPath, ".gcda", sourcePath); //$NON-NLS-1$
+ traceFile = openTraceFileStream(gcdaPath, ".gcda", sourcePath); //$NON-NLS-1$
if (traceFile == null)
return;
if (noRcrd.getFnctns().isEmpty()) {
@@ -250,7 +250,7 @@ public class CovManager implements Serializable {
}
// transform String path to stream
- private DataInput OpenTraceFileStream(String filePath, String extension, Map<File, File> sourcePath)
+ private DataInput openTraceFileStream(String filePath, String extension, Map<File, File> sourcePath)
throws FileNotFoundException {
File f = new File(filePath).getAbsoluteFile();
String filename = f.getName();
@@ -278,7 +278,7 @@ public class CovManager implements Serializable {
if (dir != null) {
f = new File(dir, postfix);
if (f.isFile() && f.canRead()) {
- return OpenTraceFileStream(f.getAbsolutePath(), extension, sourcePath);
+ return openTraceFileStream(f.getAbsolutePath(), extension, sourcePath);
}
}
diff --git a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcnoRecordsParser.java b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcnoRecordsParser.java
index 3c1a894db5..9c3ba7d122 100644
--- a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcnoRecordsParser.java
+++ b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcnoRecordsParser.java
@@ -40,9 +40,9 @@ public class GcnoRecordsParser {
private final ArrayList<SourceFile> currentAllSrcs;
private final HashMap<String, SourceFile> sourceMap;
- public GcnoRecordsParser(HashMap<String, SourceFile> sourceMap, ArrayList<SourceFile> AllSrcs) {
+ public GcnoRecordsParser(HashMap<String, SourceFile> sourceMap, ArrayList<SourceFile> allSrcs) {
this.sourceMap = sourceMap;
- this.currentAllSrcs = AllSrcs;
+ this.currentAllSrcs = allSrcs;
}
private SourceFile findOrAdd(String fileName) {

Back to the top