Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/gcov
diff options
context:
space:
mode:
authorXavier Raynaud2012-05-10 08:33:35 +0000
committerXavier Raynaud2012-05-10 08:33:35 +0000
commitbaeba23ca151465c4d9fc229e2fab98cb61e0c23 (patch)
treeb1117429b728af7035b68bfbcd45e7fd04fe5d09 /gcov
parent6b2f9ff97c58b923fe60b04e6a4920cccffb179d (diff)
downloadorg.eclipse.linuxtools-baeba23ca151465c4d9fc229e2fab98cb61e0c23.tar.gz
org.eclipse.linuxtools-baeba23ca151465c4d9fc229e2fab98cb61e0c23.tar.xz
org.eclipse.linuxtools-baeba23ca151465c4d9fc229e2fab98cb61e0c23.zip
fix #378521 (gcov with NullPointerException when opening coverage results for a whole binary)
Diffstat (limited to 'gcov')
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/CovManager.java3
1 files changed, 2 insertions, 1 deletions
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 16739cc61c..799df8c4d2 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
@@ -250,6 +250,7 @@ public class CovManager implements Serializable {
// transform String path to stream
private DataInput OpenTraceFileStream(String filePath, String extension, Map<File, File> sourcePath) throws FileNotFoundException{
File f = new File(filePath).getAbsoluteFile();
+ String filename = f.getName();
if (f.isFile() && f.canRead()) {
FileInputStream fis = new FileInputStream(f);
InputStream inputStream = new BufferedInputStream(fis);
@@ -277,7 +278,7 @@ public class CovManager implements Serializable {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
FileDialog fg = new FileDialog(shell, SWT.OPEN);
fg.setFilterExtensions(new String[] {"*" + extension, "*.*", "*"});
- fg.setFileName(f.getName());
+ fg.setFileName(filename);
String s = fg.open();
if (s == null) return null;
else {

Back to the top