Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confused overload #21

Open
cal101 opened this issue Mar 20, 2016 · 0 comments
Open

Confused overload #21

cal101 opened this issue Mar 20, 2016 · 0 comments

Comments

@cal101
Copy link
Collaborator

cal101 commented Mar 20, 2016

==> src/main/java/de/walkmod/typedlist/TypedList.java <==
package de.walkmod.typedlist;

import java.util.List;

import de.walkmod.typedlist.util.CollectionUtil;


public class TypedList {
    public void setList(List<String> list) {
    }

    public void m() {
        List<String> l = null;
        setList(CollectionUtil.makeList(l));
    }
}

==> src/main/java/de/walkmod/typedlist/util/CollectionUtil.java <==
package de.walkmod.typedlist.util;

import java.util.Collection;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;

import javax.annotation.Nullable;

public class CollectionUtil {
    public static <T> List<T> makeList(Enumeration<T> e) {
        return null;
    }
    public static <T> List<T> makeList(Iterator<T> it) {
        return null;
    }
    public static <T> List<T> makeList(@Nullable T[] objs) {
        return null;
    }
    public static <T> List<T> makeList(@Nullable Collection<T> list) {
        return null;
    }
}

results in

    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.Exception: Ops! The method call setList(CollectionUtil.makeList(l)) is not resolved. The scope is [empty] , and the args are : [ java.util.List<java.util.List>]
    ... 35 more
Caused by: java.lang.Exception: Ops! The method call setList(CollectionUtil.makeList(l)) is not resolved. The scope is [empty] , and the args are : [ java.util.List<java.util.List>]
    at org.walkmod.javalang.compiler.reflection.SymbolDataOfMethodReferenceBuilder.build(SymbolDataOfMethodReferenceBuilder.java:75)
    at org.walkmod.javalang.compiler.types.TypeVisitorAdapter.visit(TypeVisitorAdapter.java:516)
    ... 34 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant