diff --git a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractCIndexChecker.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractCIndexChecker.java index f2ca77c7c01..cb3d1df00b6 100644 --- a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractCIndexChecker.java +++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractCIndexChecker.java @@ -34,7 +34,7 @@ public abstract class AbstractCIndexChecker extends AbstractChecker implements I return file; } - void processFile(IFile file) throws CoreException, InterruptedException { + void processFile(IFile file) throws CoreException, InterruptedException { // create translation unit and access index ICElement model = CoreModel.getDefault().create(file); if (!(model instanceof ITranslationUnit)) return; // not a C/C++ file @@ -52,7 +52,7 @@ public abstract class AbstractCIndexChecker extends AbstractChecker implements I } } - public boolean processResource(IResource resource) { + public synchronized boolean processResource(IResource resource) { if (resource instanceof IFile) { IFile file = (IFile) resource; try { diff --git a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractIndexAstChecker.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractIndexAstChecker.java index c86b47b0bcd..7a1ce49f73b 100644 --- a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractIndexAstChecker.java +++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractIndexAstChecker.java @@ -61,6 +61,7 @@ public abstract class AbstractIndexAstChecker extends AbstractChecker implements // create index based ast IASTTranslationUnit ast = tu.getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS); + if (ast==null) return;// // traverse the ast using the visitor pattern. this.file = file; processAst(ast); @@ -70,7 +71,7 @@ public abstract class AbstractIndexAstChecker extends AbstractChecker implements } } - public boolean processResource(IResource resource) { + public synchronized boolean processResource(IResource resource) { if (resource instanceof IFile) { IFile file = (IFile) resource; try {