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:
parent
3e7f1d284b
commit
8968b8f2ca
5 changed files with 12 additions and 24 deletions
|
@ -14,7 +14,6 @@ package org.eclipse.cdt.codan.internal.checkers;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.codan.core.cxx.CxxAstUtils;
|
import org.eclipse.cdt.codan.core.cxx.CxxAstUtils;
|
||||||
import org.eclipse.cdt.codan.core.cxx.model.AbstractAstFunctionChecker;
|
import org.eclipse.cdt.codan.core.cxx.model.AbstractAstFunctionChecker;
|
||||||
|
@ -192,7 +191,6 @@ public class ReturnChecker extends AbstractAstFunctionChecker {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<IBasicBlock> getDeadBlocks(IASTFunctionDefinition func) {
|
public Collection<IBasicBlock> getDeadBlocks(IASTFunctionDefinition func) {
|
||||||
Collection<IBasicBlock> result = new LinkedHashSet<IBasicBlock>();
|
|
||||||
IControlFlowGraph graph = getModelCache().getControlFlowGraph(func);
|
IControlFlowGraph graph = getModelCache().getControlFlowGraph(func);
|
||||||
return ((ControlFlowGraph) graph).getDeadNodes();
|
return ((ControlFlowGraph) graph).getDeadNodes();
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class CodanTestCase extends BaseTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tearDown() throws CoreException {
|
public void tearDown() throws Exception {
|
||||||
if (cproject != null) {
|
if (cproject != null) {
|
||||||
try {
|
try {
|
||||||
cproject.getProject().delete(IResource.FORCE | IResource.ALWAYS_DELETE_PROJECT_CONTENT, new NullProgressMonitor());
|
cproject.getProject().delete(IResource.FORCE | IResource.ALWAYS_DELETE_PROJECT_CONTENT, new NullProgressMonitor());
|
||||||
|
@ -92,6 +92,7 @@ public class CodanTestCase extends BaseTestCase {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -61,6 +61,8 @@ public class TestUtils {
|
||||||
InputStream st = null;
|
InputStream st = null;
|
||||||
if (plugin != null) {
|
if (plugin != null) {
|
||||||
URL resource = plugin.getBundle().getResource(srcRoot + "/" + classFile);
|
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();
|
st = resource.openStream();
|
||||||
} else {
|
} else {
|
||||||
st = clazz.getResourceAsStream("/" + classFile);
|
st = clazz.getResourceAsStream("/" + classFile);
|
||||||
|
|
|
@ -80,7 +80,7 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tearDown() throws CoreException {
|
public void tearDown() throws Exception {
|
||||||
Display.getDefault().syncExec(new Runnable() {
|
Display.getDefault().syncExec(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
|
@ -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.IBranchNode;
|
||||||
import org.eclipse.cdt.codan.core.model.cfg.IConnectorNode;
|
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.IDecisionNode;
|
||||||
import org.eclipse.cdt.codan.core.model.cfg.IExitNode;
|
import org.eclipse.cdt.codan.core.model.cfg.IExitNode;
|
||||||
import org.eclipse.cdt.codan.core.model.cfg.IJumpNode;
|
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
|
* Factory that creates cfg nodes
|
||||||
*/
|
*/
|
||||||
public class NodeFactory implements INodeFactory {
|
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() {
|
public NodeFactory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue