8000 wildcard resolved first instead of current package · Issue #223 · forge/roaster · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
wildcard resolved first instead of current package #223
Open
@asafbennatan

Description

@asafbennatan

when looking for super type of a type we try to resolve the canonical name of that type.
the issue is that we are trying to resolve wildcard imports before checking in the current package first.
example of the issue:

package org.jboss.forge.grammar.java;

import java.net.http.*;
import java.util.*;

public class MockWildcardClass {

    public List<String> getList(){
        return new ArrayList<>();
    }
    public HttpRequest getHttpRequest(){
        return new HttpRequest();
    }
}

and in the same package:

package org.jboss.forge.grammar.java;


public class HttpRequest {

   private String fakeField;


    public String getFakeField() {
        return fakeField;
    }

    public <T extends HttpRequest> T setFakeField(String fakeField) {
        this.fakeField = fakeField;
        return (T) this;
    }
}

roaster resolves HttpRequest as java.net.http.HttpRequest even though it should be org.jboss.forge.grammar.java.HttpRequest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0