diff options
author | kh5325.kim <kh5325.kim@samsung.com> | 2013-10-24 11:16:57 +0900 |
---|---|---|
committer | kh5325.kim <kh5325.kim@samsung.com> | 2013-10-24 11:16:57 +0900 |
commit | caddafbc9f9d25197a1c428a2951f17c18162ee4 (patch) | |
tree | 82f1ea2824b4120cff668f429b4a541dec383514 | |
parent | ad076199963e721a47d27274a7ddc92ad2b22e8a (diff) | |
download | codecoverage-eplugin-caddafbc9f9d25197a1c428a2951f17c18162ee4.tar.gz codecoverage-eplugin-caddafbc9f9d25197a1c428a2951f17c18162ee4.tar.bz2 codecoverage-eplugin-caddafbc9f9d25197a1c428a2951f17c18162ee4.zip |
Fixed some Prevent issues
Change-Id: I6c71292a3a9d5175cb482f6c832a5b1dd168116e
Signed-off-by: kh5325.kim <kh5325.kim@samsung.com>
-rw-r--r-- | org.tizen.codecoverage/src/org/tizen/codecoverage/helper/GcovHelper.java | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/org.tizen.codecoverage/src/org/tizen/codecoverage/helper/GcovHelper.java b/org.tizen.codecoverage/src/org/tizen/codecoverage/helper/GcovHelper.java index fb10c4e..201af83 100644 --- a/org.tizen.codecoverage/src/org/tizen/codecoverage/helper/GcovHelper.java +++ b/org.tizen.codecoverage/src/org/tizen/codecoverage/helper/GcovHelper.java @@ -20,13 +20,11 @@ package org.tizen.codecoverage.helper; -import java.util.LinkedList; import java.util.List; import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; @@ -46,7 +44,6 @@ public class GcovHelper { final static String DATA_DIR = "/data/"; static public void run(IProject project) { - // null check project if (project == null || !project.exists()) { Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell(); MessageDialog.openInformation(s, Messages.ERROR_TITLE, Messages.ERROR_NOT_FOUND_PROJECT); @@ -55,9 +52,6 @@ public class GcovHelper { IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); if (currentDevice == null) { - // final String message = "Target device is not running"; - // Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell(); - // MessageDialog.openError(s, "Gcov Error", message); return; } @@ -78,12 +72,6 @@ public class GcovHelper { CovView.displayCovResults(binary); } - private static String getBinary(IResource binary, String target) { - if (binary.getLocation().toOSString().contains( target ) && binary.getLocation().lastSegment().contains(binary.getProject().getName())) { - return binary.getLocation().toOSString(); - } - return null; - } // FIXME searching a selected binary is not complete // This part is affected IDE launch part // TODO Fix this method @@ -107,22 +95,18 @@ public class GcovHelper { public static void downloadGcdaFile(String binaryPath) throws Exception { CovManager cvrgeMnger = null; - List<String> gcdaPaths = new LinkedList<String>(); cvrgeMnger = new CovManager(binaryPath); IPath binaryFile = new Path(binaryPath); boolean isLLVM = false; try { - gcdaPaths = cvrgeMnger.getGCDALocations(); + List<String> gcdaPaths = cvrgeMnger.getGCDALocations(); + IProject project = getProject(binaryFile); + downloadGcda(gcdaPaths, binaryFile, project, isLLVM); } catch (Exception e) { Shell s = PlatformUI.getWorkbench().getDisplay().getActiveShell(); MessageDialog.openError(s, Messages.ERROR_TITLE, Messages.ERROR_NOT_FOUND_BINARY); - return; } - - IProject project = getProject(binaryFile); - - downloadGcda(gcdaPaths, binaryFile, project, isLLVM); } public static void downloadGcda( List<String> gcdaPathsInGcno, IPath binaryPath, IProject project, boolean isLLVM ) throws Exception{ @@ -164,7 +148,6 @@ public class GcovHelper { } finally { IOUtil.tryClose(syncService); } - } private static String getGcdaPath(IProject project, IDevice device) { |