1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

codan - code cleanup

Change-Id: I25f1047b9b07388adeeab38ba7679ac3109280fb
This commit is contained in:
Alena Laskavaia 2015-02-22 22:06:50 -05:00
parent 3e7f1d284b
commit 8968b8f2ca
5 changed files with 12 additions and 24 deletions

View file

@ -14,7 +14,6 @@ package org.eclipse.cdt.codan.internal.checkers;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashSet;
import org.eclipse.cdt.codan.core.cxx.CxxAstUtils;
import org.eclipse.cdt.codan.core.cxx.model.AbstractAstFunctionChecker;
@ -192,7 +191,6 @@ public class ReturnChecker extends AbstractAstFunctionChecker {
}
public Collection<IBasicBlock> getDeadBlocks(IASTFunctionDefinition func) {
Collection<IBasicBlock> result = new LinkedHashSet<IBasicBlock>();
IControlFlowGraph graph = getModelCache().getControlFlowGraph(func);
return ((ControlFlowGraph) graph).getDeadNodes();
}

View file

@ -84,7 +84,7 @@ public class CodanTestCase extends BaseTestCase {
}
@Override
public void tearDown() throws CoreException {
public void tearDown() throws Exception {
if (cproject != null) {
try {
cproject.getProject().delete(IResource.FORCE | IResource.ALWAYS_DELETE_PROJECT_CONTENT, new NullProgressMonitor());
@ -92,6 +92,7 @@ public class CodanTestCase extends BaseTestCase {
throw e;
}
}
super.tearDown();
}
/**

View file

@ -61,6 +61,8 @@ public class TestUtils {
InputStream st = null;
if (plugin != null) {
URL resource = plugin.getBundle().getResource(srcRoot + "/" + classFile);
if (resource == null)
throw new IOException("Cannot find file " + srcRoot + "/" + classFile + " in bundle " + plugin.getBundle().getBundleId());
st = resource.openStream();
} else {
st = clazz.getResourceAsStream("/" + classFile);

View file

@ -80,7 +80,7 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
}
@Override
public void tearDown() throws CoreException {
public void tearDown() throws Exception {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {

View file

@ -12,7 +12,6 @@ package org.eclipse.cdt.codan.internal.core.cfg;
import org.eclipse.cdt.codan.core.model.cfg.IBranchNode;
import org.eclipse.cdt.codan.core.model.cfg.IConnectorNode;
import org.eclipse.cdt.codan.core.model.cfg.IControlFlowGraph;
import org.eclipse.cdt.codan.core.model.cfg.IDecisionNode;
import org.eclipse.cdt.codan.core.model.cfg.IExitNode;
import org.eclipse.cdt.codan.core.model.cfg.IJumpNode;
@ -24,18 +23,6 @@ import org.eclipse.cdt.codan.core.model.cfg.IStartNode;
* Factory that creates cfg nodes
*/
public class NodeFactory implements INodeFactory {
IControlFlowGraph graph;
/*
* (non-Javadoc)
*
* @seeorg.eclipse.cdt.codan.provisional.core.model.cfg.INodeFactory#
* getControlFlowGraph()
*/
public IControlFlowGraph getControlFlowGraph() {
return graph;
}
public NodeFactory() {
}