rpau / javalang-compiler

Java compiler elements (symbol and type tables) to perform code semantic analysis
GNU Lesser General Public License v3.0
10 stars 4 forks source link

NPE for typed result #23

Open cal101 opened 8 years ago

cal101 commented 8 years ago
package de.walkmod.typedresult;

import java.util.List;

public class TypedResult {
    public static <T> T xanyObject() {
        return null;
    }

    List<String> getAll(String s, List<String> filter) {
        return null;
    }

    public void m() {
        getAll((String) xanyObject(), TypedResult.<List<String>>xanyObject());
    }
}
Error processing the analysis of .../src/main/java/de/walkmod/typedresult/TypedResult.java] - [527:-1]
        at org.walkmod.javalang.compiler.types.TypeVisitorAdapter.visit(TypeVisitorAdapter.java:527)
        at org.walkmod.javalang.compiler.types.TypeVisitorAdapter.visit(TypeVisitorAdapter.java:115)
        at org.walkmod.javalang.ast.expr.MethodCallExpr.accept(MethodCallExpr.java:138)
        at org.walkmod.javalang.compiler.symbols.SymbolVisitorAdapter.visit(SymbolVisitorAdapter.java:723)
        at org.walkmod.javalang.compiler.symbols.SymbolVisitorAdapter.visit(SymbolVisitorAdapter.java:92)
        at org.walkmod.javalang.ast.stmt.ExpressionStmt.accept(ExpressionStmt.java:79)
        at org.walkmod.javalang.visitors.VoidVisitorAdapter.visit(VoidVisitorAdapter.java:203)
        at org.walkmod.javalang.compiler.symbols.SymbolVisitorAdapter.visit(SymbolVisitorAdapter.java:522)
        at org.walkmod.javalang.compiler.symbols.SymbolVisitorAdapter.visit(SymbolVisitorAdapter.java:92)
        at org.walkmod.javalang.ast.stmt.BlockStmt.accept(BlockStmt.java:89)
        at org.walkmod.javalang.visitors.VoidVisitorAdapter.visit(VoidVisitorAdapter.java:564)
        at org.walkmod.javalang.compiler.symbols.SymbolVisitorAdapter.visit(SymbolVisitorAdapter.java:550)
        at org.walkmod.javalang.compiler.symbols.SymbolVisitorAdapter.visit(SymbolVisitorAdapter.java:92)
        at org.walkmod.javalang.ast.body.MethodDeclaration.accept(MethodDeclaration.java:207)
        at org.walkmod.javalang.compiler.symbols.SymbolVisitorAdapter.visit(SymbolVisitorAdapter.java:445)
        at org.walkmod.javalang.compiler.symbols.SymbolVisitorAdapter.visit(SymbolVisitorAdapter.java:92)
        at org.walkmod.javalang.ast.body.ClassOrInterfaceDeclaration.accept(ClassOrInterfaceDeclaration.java:136)
        at org.walkmod.javalang.compiler.symbols.SymbolVisitorAdapter.visit(SymbolVisitorAdapter.java:174)
        at org.walkmod.javalang.walkers.DefaultJavaWalker.visit(DefaultJavaWalker.java:198)
        at org.walkmod.javalang.walkers.DefaultJavaWalker.accept(DefaultJavaWalker.java:86)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.walkmod.walkers.AbstractWalker.walk(AbstractWalker.java:261)
        at org.walkmod.walkers.AbstractWalker.execute(AbstractWalker.java:276)
        at org.walkmod.javalang.walkers.DefaultJavaWalker.execute(DefaultJavaWalker.java:160)
        at org.walkmod.impl.DefaultChainWalkerInvocation.invoke(DefaultChainWalkerInvocation.java:41)
        at org.walkmod.impl.DefaultChainInvocation.invoke(DefaultChainInvocation.java:38)
        at org.walkmod.impl.DefaultChainAdapter.execute(DefaultChainAdapter.java:165)
        at org.walkmod.WalkModFacade.executeAllChains(WalkModFacade.java:911)
        at org.walkmod.WalkModFacade.apply(WalkModFacade.java:376)
        at org.walkmod.commands.ApplyCommand.execute(ApplyCommand.java:40)
        at org.walkmod.WalkModDispatcher.execute(WalkModDispatcher.java:171)
        at org.walkmod.WalkModDispatcher.main(WalkModDispatcher.java:196)
Caused by: org.walkmod.javalang.exceptions.NoSuchExpressionTypeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
        ... 35 more