Community
Participate
Working Groups
Using 8.0.0.201103130630 java.lang.NullPointerException at org.eclipse.cdt.codan.core.cxx.model.CxxModelsCache.getAst(CxxModelsCache.java:80) at org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker$SwitchVisitor.<init>(CaseBreakChecker.java:125) at org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker$SwitchFindingVisitor.visit(CaseBreakChecker.java:93) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSwitchStatement.accept(CPPASTSwitchStatement.java:97) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement.accept(CPPASTCompoundStatement.java:79) at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDefinition.accept(CPPASTFunctionDefinition.java:187) at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:271) at org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker.processAst(CaseBreakChecker.java:268)
I am having another kind of exception in the checker. Let me know if you want me to isolate which code causes that. I'd rather to avoid that as the code base is large so it would take quite an effort. java.lang.IllegalArgumentException: Not cached at org.eclipse.cdt.codan.core.cxx.model.CxxModelsCache.getCommentedNodeMap(CxxModelsCache.java:99) at org.eclipse.cdt.codan.core.cxx.CxxAstUtils.getLeadingComment(CxxAstUtils.java:404) at org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker$SwitchVisitor.getLeadingComment(CaseBreakChecker.java:218) at org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker$SwitchVisitor.visit(CaseBreakChecker.java:195) at org.eclipse.cdt.internal.core.dom.parser.c.CASTCaseStatement.accept(CASTCaseStatement.java:65) at org.eclipse.cdt.internal.core.dom.parser.c.CASTCompoundStatement.accept(CASTCompoundStatement.java:77) at org.eclipse.cdt.internal.core.dom.parser.c.CASTSwitchStatement.accept(CASTSwitchStatement.java:90) at org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker$SwitchFindingVisitor.visit(CaseBreakChecker.java:94) at org.eclipse.cdt.internal.core.dom.parser.c.CASTSwitchStatement.accept(CASTSwitchStatement.java:83) at org.eclipse.cdt.internal.core.dom.parser.c.CASTCompoundStatement.accept(CASTCompoundStatement.java:77) at org.eclipse.cdt.internal.core.dom.parser.c.CASTFunctionDefinition.accept(CASTFunctionDefinition.java:128) at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:271) at org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker.processAst(CaseBreakChecker.java:268) at org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker.processModel(AbstractIndexAstChecker.java:124) at org.eclipse.cdt.codan.internal.core.CodanBuilder.processResource(CodanBuilder.java:141) at org.eclipse.cdt.codan.internal.core.CodanBuilder.runInEditor(CodanBuilder.java:206) at org.eclipse.cdt.codan.core.cxx.internal.model.CxxCodanReconciler.reconciledAst(CxxCodanReconciler.java:38) at org.eclipse.cdt.codan.internal.ui.cxx.CodanCReconciler.reconciled(CodanCReconciler.java:92) at org.eclipse.cdt.internal.ui.editor.CEditor.reconciled(CEditor.java:3065) at org.eclipse.cdt.internal.ui.text.CReconcilingStrategy.reconcile(CReconcilingStrategy.java:105) at org.eclipse.cdt.internal.ui.text.CReconcilingStrategy.reconcile(CReconcilingStrategy.java:71) at org.eclipse.cdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:84) at org.eclipse.cdt.internal.ui.text.CCompositeReconcilingStrategy.reconcile(CCompositeReconcilingStrategy.java:90) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77) at org.eclipse.cdt.internal.ui.text.CReconciler.process(CReconciler.java:408) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
Is this still happening?
I got about 2 dozen of Codan exceptions in yesterdays log, all slightly different. Here is a fresh sample: java.lang.NullPointerException at org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker$SwitchVisitor.getLeadingComment(CaseBreakChecker.java:211) at org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker$SwitchVisitor.visit(CaseBreakChecker.java:188) at org.eclipse.cdt.internal.core.dom.parser.c.CASTCaseStatement.accept(CASTCaseStatement.java:65) at org.eclipse.cdt.internal.core.dom.parser.c.CASTCompoundStatement.accept(CASTCompoundStatement.java:77) at org.eclipse.cdt.internal.core.dom.parser.c.CASTSwitchStatement.accept(CASTSwitchStatement.java:90) at org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker$SwitchFindingVisitor.visit(CaseBreakChecker.java:92) at org.eclipse.cdt.internal.core.dom.parser.c.CASTSwitchStatement.accept(CASTSwitchStatement.java:83) at org.eclipse.cdt.internal.core.dom.parser.c.CASTCompoundStatement.accept(CASTCompoundStatement.java:77) at org.eclipse.cdt.internal.core.dom.parser.c.CASTFunctionDefinition.accept(CASTFunctionDefinition.java:128) at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:276) at org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker.processAst(CaseBreakChecker.java:262) at org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker.processModel(AbstractIndexAstChecker.java:142) at org.eclipse.cdt.codan.internal.core.CodanBuilder.processResource(CodanBuilder.java:142) at org.eclipse.cdt.codan.internal.core.CodanBuilder.runInEditor(CodanBuilder.java:207) at org.eclipse.cdt.codan.core.cxx.internal.model.CxxCodanReconciler.reconciledAst(CxxCodanReconciler.java:38) at org.eclipse.cdt.codan.internal.ui.cxx.CodanCReconciler.reconciled(CodanCReconciler.java:81) at org.eclipse.cdt.internal.ui.editor.CEditor.reconciled(CEditor.java:3065) at org.eclipse.cdt.internal.ui.text.CReconcilingStrategy.reconcile(CReconcilingStrategy.java:105) at org.eclipse.cdt.internal.ui.text.CReconcilingStrategy.reconcile(CReconcilingStrategy.java:71) at org.eclipse.cdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:84) at org.eclipse.cdt.internal.ui.text.CCompositeReconcilingStrategy.reconcile(CCompositeReconcilingStrategy.java:90) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77) at org.eclipse.cdt.internal.ui.text.CReconciler.process(CReconciler.java:408) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
Created attachment 192828 [details] Here is the log.
This one is not so easy to pinpoint. I was watching myself and noted that the exceptions appeared after using Search and Replace operation (I used File Search). An attempt to run code analysis on the affected files or on the whole project did not produce the exceptions (produced regular codan warnings about missing break though).
Sergey did a refactoring which could have take care of it. Re-open if you see it again (after update to latest head code of cause)
There were new entries in my log every day before Sergey did the refactoring. I haven't seen them since.