From caddafbc9f9d25197a1c428a2951f17c18162ee4 Mon Sep 17 00:00:00 2001 From: "kh5325.kim" Date: Thu, 24 Oct 2013 11:16:57 +0900 Subject: Fixed some Prevent issues Change-Id: I6c71292a3a9d5175cb482f6c832a5b1dd168116e Signed-off-by: kh5325.kim --- .../org/tizen/codecoverage/helper/GcovHelper.java | 23 +++------------------- 1 file 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 gcdaPaths = new LinkedList(); cvrgeMnger = new CovManager(binaryPath); IPath binaryFile = new Path(binaryPath); boolean isLLVM = false; try { - gcdaPaths = cvrgeMnger.getGCDALocations(); + List 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 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) { -- cgit v1.2.3