Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2011-03-12 09:25:12 -0500
committerAlena Laskavaia2011-03-12 09:25:12 -0500
commit2d5b88f62e82d12bee41b11e6633bda427a67531 (patch)
treef7b5eb010cc6038ab40e15afdadf5d109cf9a241
parent2b1b5e18d45a65dc5242fe3eab0277ec770537c8 (diff)
downloadorg.eclipse.cdt-2d5b88f62e82d12bee41b11e6633bda427a67531.tar.gz
org.eclipse.cdt-2d5b88f62e82d12bee41b11e6633bda427a67531.tar.xz
org.eclipse.cdt-2d5b88f62e82d12bee41b11e6633bda427a67531.zip
hack to initialize ast cache for reading comments
-rw-r--r--codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CaseBreakChecker.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CaseBreakChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CaseBreakChecker.java
index d9912c44ec..76ed301ad5 100644
--- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CaseBreakChecker.java
+++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CaseBreakChecker.java
@@ -10,8 +10,10 @@
*******************************************************************************/
package org.eclipse.cdt.codan.internal.checkers;
+import org.eclipse.cdt.codan.checkers.CodanCheckersActivator;
import org.eclipse.cdt.codan.core.cxx.CxxAstUtils;
import org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker;
+import org.eclipse.cdt.codan.core.cxx.model.CxxModelsCache;
import org.eclipse.cdt.codan.core.model.ICheckerWithPreferences;
import org.eclipse.cdt.codan.core.model.IProblemWorkingCopy;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
@@ -118,6 +120,12 @@ public class CaseBreakChecker extends AbstractIndexAstChecker implements IChecke
_prev_normal_stmnt_offset = 0;
_prev_case_stmnt_offset = 0;
_prev_case_stmnt = null;
+ //initilize cache
+ try {
+ CxxModelsCache.getInstance().getAst(getFile());
+ } catch (Exception e) {
+ CodanCheckersActivator.log(e);
+ }
}
/**

Back to the top