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

fix:in no classpath, something error in toString of CtExecutableRefer… #5764

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

sretake
Copy link
Contributor

@sretake sretake commented Apr 15, 2024

@Test()
void foo(){
    Launcher launcher = new Launcher();
    launcher.getEnvironment().setComplianceLevel(11);
    launcher.getEnvironment().setAutoImports(true);
    launcher.addInputResource(new VirtualFile("import java.util.List;\n" +
        "import org.apache.maven.api.model.Profile;\n" +
        "class A{\n" +
        "    public void run(List<Integer> list){\n" +
        "        list.stream().map(org.apache.maven.api.model.Profile::new);\n" +
        "    }\n" +
        "}\n"));
    CtModel ctModel = launcher.buildModel();
    List<CtExecutableReference> elements = ctModel.getElements(new TypeFilter<>(CtExecutableReference.class));
    for (CtExecutableReference element : elements) {
        try{
            element.toString();
        }catch(Exception e){
            e.printStackTrace();
        }
    }
}

@monperrus
Copy link
Collaborator

thanks @sretake, could you add the test in the PR?

@monperrus monperrus merged commit 0ea5228 into INRIA:master Aug 15, 2024
12 checks passed
@monperrus
Copy link
Collaborator

moving forward with this simple change, thanks @sretake

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

Successfully merging this pull request may close these issues.

3 participants