Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2011-04-12 18:13:46 -0400
committerSergey Prigogin2011-04-12 18:13:46 -0400
commit87ae09ee72282f39509436d1e59529ac0356a7bb (patch)
tree243ac446d59aad12f5c59c6060084d53c9eaabc1 /codan/org.eclipse.cdt.codan.core.test
parentc24ce74075b49689a30a655692de8809a2c574db (diff)
downloadorg.eclipse.cdt-87ae09ee72282f39509436d1e59529ac0356a7bb.tar.gz
org.eclipse.cdt-87ae09ee72282f39509436d1e59529ac0356a7bb.tar.xz
org.eclipse.cdt-87ae09ee72282f39509436d1e59529ac0356a7bb.zip
Bug 337486 - AbstractIndexAstChecker allows AST to outlive index read lock.
Diffstat (limited to 'codan/org.eclipse.cdt.codan.core.test')
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CodanFastCxxAstTestCase.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CodanFastCxxAstTestCase.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CodanFastCxxAstTestCase.java
index 1bf928bd0a..30b2d3e1e4 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CodanFastCxxAstTestCase.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/test/CodanFastCxxAstTestCase.java
@@ -17,9 +17,11 @@ import junit.framework.TestCase;
import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.core.model.IChecker;
+import org.eclipse.cdt.codan.core.model.ICheckerInvocationContext;
import org.eclipse.cdt.codan.core.model.IProblemLocation;
import org.eclipse.cdt.codan.core.model.IProblemReporter;
import org.eclipse.cdt.codan.core.model.IRunnableInEditorChecker;
+import org.eclipse.cdt.codan.internal.core.CheckerInvocationContext;
import org.eclipse.cdt.core.dom.ast.IASTProblem;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.parser.ISourceCodeParser;
@@ -71,7 +73,7 @@ public abstract class CodanFastCxxAstTestCase extends TestCase {
/**
* @return
- *
+ *
*/
public IASTTranslationUnit parse(String code) {
return parse(code, isCpp() ? ParserLanguage.CPP : ParserLanguage.C, true);
@@ -116,7 +118,7 @@ public abstract class CodanFastCxxAstTestCase extends TestCase {
/**
* Override if any of code that test tried to parse has errors, otherwise
* parse method would assert
- *
+ *
* @return
*/
protected boolean hasCodeErrors() {
@@ -153,11 +155,13 @@ public abstract class CodanFastCxxAstTestCase extends TestCase {
codanproblems.add(new ProblemInstance(problemId, loc, args));
}
});
+ ICheckerInvocationContext context = new CheckerInvocationContext(null);
try {
IChecker checker = getChecker();
- ((IRunnableInEditorChecker) checker).processModel(tu);
+ ((IRunnableInEditorChecker) checker).processModel(tu, context);
} finally {
CodanRuntime.getInstance().setProblemReporter(problemReporter);
+ context.dispose();
}
}

Back to the top