From: Rizkallah T. <riz...@bs...> - 2016-01-07 13:26:43
|
Hi all, I am using Wala to construct a call graph of the open source project Jena and I am getting a null pointer exception. The exception is being thrown because calling resolveBinding() returns null in the createClassDeclaration method of the JDTJava2CAstTranslator. More precisely at line 472: for (Object f : fieldDecl.fragments()) { VariableDeclarationFragment fieldFrag = (VariableDeclarationFragment) f; IVariableBinding fieldBinding = fieldFrag.resolveBinding(); ... I debugged Wala and the piece of code that is causing it to throw this exception is the following declaration of the field "log": import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class QueryEngineHTTP implements QueryExecution { private static Logger log = LoggerFactory.getLogger(QueryEngineHTTP.class); ... I could not figure out why this field declaration in particular is causing Wala not to find the binding and hence to throw a null pointer exception. Any ideas? Thanks! Full Stack Trace of Exception: Exception in thread "main" java.lang.NullPointerException at com.ibm.wala.cast.java.translator.jdt.JDTJava2CAstTranslator.createClassDeclaration(JDTJava2CAstTranslator.java:476) at com.ibm.wala.cast.java.translator.jdt.JDTJava2CAstTranslator.visitTypeDecl(JDTJava2CAstTranslator.java:408) at com.ibm.wala.cast.java.translator.jdt.JDTJava2CAstTranslator.visit(JDTJava2CAstTranslator.java:2837) at com.ibm.wala.cast.java.translator.jdt.JDTJava2CAstTranslator.translateToCAst(JDTJava2CAstTranslator.java:261) at com.ibm.wala.cast.java.translator.jdt.ejc.EJCSourceModuleTranslator$EjcAstToIR.acceptAST(EJCSourceModuleTranslator.java:108) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1016) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:628) at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:982) at com.ibm.wala.cast.java.translator.jdt.ejc.EJCSourceModuleTranslator.loadAllSources(EJCSourceModuleTranslator.java:197) at com.ibm.wala.cast.java.loader.JavaSourceLoaderImpl.loadAllSources(JavaSourceLoaderImpl.java:505) at com.ibm.wala.classLoader.ClassLoaderImpl.init(ClassLoaderImpl.java:529) at com.ibm.wala.cast.java.loader.JavaSourceLoaderImpl.init(JavaSourceLoaderImpl.java:516) at com.ibm.wala.cast.java.translator.jdt.JDTClassLoaderFactory.makeNewClassLoader(JDTClassLoaderFactory.java:69) at com.ibm.wala.classLoader.ClassLoaderFactoryImpl.getLoader(ClassLoaderFactoryImpl.java:69) at com.ibm.wala.ipa.cha.ClassHierarchy.<init>(ClassHierarchy.java:231) at com.ibm.wala.ipa.cha.ClassHierarchy.<init>(ClassHierarchy.java:177) at com.ibm.wala.ipa.cha.ClassHierarchy.make(ClassHierarchy.java:1230) at com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine.buildClassHierarchy(JavaSourceAnalysisEngine.java:135) at com.ibm.wala.client.AbstractAnalysisEngine.defaultCallGraphBuilder(AbstractAnalysisEngine.java:304) at com.ibm.wala.client.AbstractAnalysisEngine.buildDefaultCallGraph(AbstractAnalysisEngine.java:313) at main.PrefetchingSourceCodeAnalyzer.main(PrefetchingSourceCodeAnalyzer.java:49) -- Sincarely, Rizkallah Touma WARNING / LEGAL TEXT: This message is intended only for the use of the individual or entity to which it is addressed and may contain information which is privileged, confidential, proprietary, or exempt from disclosure under applicable law. If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, you are strictly prohibited from disclosing, distributing, copying, or in any way using this message. If you have received this communication in error, please notify the sender and destroy and delete any copies you may have received. http://www.bsc.es/disclaimer |