mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +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.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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009, 2010 Alena Laskavaia
|
||||
* Copyright (c) 2009, 2010 Alena Laskavaia
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -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,24 +23,12 @@ 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() {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see org.eclipse.cdt.codan.core.model.cfg.INodeFactory#createPlainNode ()
|
||||
*/
|
||||
@Override
|
||||
|
@ -51,7 +38,7 @@ public class NodeFactory implements INodeFactory {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see org.eclipse.cdt.codan.core.model.cfg.INodeFactory#createJumpNode ()
|
||||
*/
|
||||
@Override
|
||||
|
@ -61,7 +48,7 @@ public class NodeFactory implements INodeFactory {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @seeorg.eclipse.cdt.codan.provisional.core.model.cfg.INodeFactory#
|
||||
* createDecisionNode()
|
||||
*/
|
||||
|
@ -72,7 +59,7 @@ public class NodeFactory implements INodeFactory {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @seeorg.eclipse.cdt.codan.provisional.core.model.cfg.INodeFactory#
|
||||
* createConnectiorNode()
|
||||
*/
|
||||
|
@ -83,7 +70,7 @@ public class NodeFactory implements INodeFactory {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see org.eclipse.cdt.codan.core.model.cfg.INodeFactory#createStartNode ()
|
||||
*/
|
||||
@Override
|
||||
|
@ -93,7 +80,7 @@ public class NodeFactory implements INodeFactory {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see org.eclipse.cdt.codan.core.model.cfg.INodeFactory#createExitNode ()
|
||||
*/
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue