multilang-depends/depends

NullPointerException when analyzing a project

juli1 opened this issue · 1 comments

juli1 commented

I get a NullPointerException when trying to analyze mariadb.

How to reproduce:

git clone https://github.com/MariaDB/server.git
./depends.sh --auto-include -f=dot cpp /path/to/mariadb foo.bar

Stacktrace:

Exception encountered. If it is a design error, please report issue to us.
java.lang.NullPointerException
	at depends.extractor.HandlerContext.foundVarDefinition(HandlerContext.java:275)
	at depends.extractor.cpp.cdt.CppVisitor.visit(CppVisitor.java:279)
	at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration.accept(CPPASTSimpleDeclaration.java:94)
	at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:275)
	at depends.extractor.cpp.cdt.CdtCppFileParser.parse(CdtCppFileParser.java:71)
	at depends.extractor.cpp.cdt.CppVisitor.visit(CppVisitor.java:100)
	at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:267)
	at depends.extractor.cpp.cdt.CdtCppFileParser.parse(CdtCppFileParser.java:71)
	at depends.extractor.cpp.cdt.CppVisitor.visit(CppVisitor.java:100)
	at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:267)
	at depends.extractor.cpp.cdt.CdtCppFileParser.parse(CdtCppFileParser.java:71)
	at depends.extractor.cpp.cdt.CppVisitor.visit(CppVisitor.java:100)
	at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:267)
	at depends.extractor.cpp.cdt.CdtCppFileParser.parse(CdtCppFileParser.java:71)
	at depends.extractor.cpp.cdt.CppVisitor.visit(CppVisitor.java:100)
	at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:267)
	at depends.extractor.cpp.cdt.CdtCppFileParser.parse(CdtCppFileParser.java:71)
	at depends.extractor.cpp.cdt.CdtCppFileParser.parse(CdtCppFileParser.java:52)
	at depends.extractor.AbstractLangProcessor$1.visit(AbstractLangProcessor.java:142)
	at depends.util.FileTraversal.invokeVisitor(FileTraversal.java:87)
	at depends.util.FileTraversal.travers(FileTraversal.java:75)
	at depends.util.FileTraversal.travers(FileTraversal.java:69)
	at depends.util.FileTraversal.travers(FileTraversal.java:69)
	at depends.util.FileTraversal.travers(FileTraversal.java:60)
	at depends.extractor.AbstractLangProcessor.parseAllFiles(AbstractLangProcessor.java:150)
	at depends.extractor.AbstractLangProcessor.buildDependencies(AbstractLangProcessor.java:100)
	at depends.Main.executeCommand(Main.java:154)
	at depends.Main.main(Main.java:67)

gangz commented

Thanks for feedback. After validation on the latest version, the issue have been resolved.