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

bug: Qualified type references in catch clauses resolved incorrectly (noclasspath) #3372

Closed
slarse opened this issue May 16, 2020 · 0 comments · Fixed by #3373
Closed

bug: Qualified type references in catch clauses resolved incorrectly (noclasspath) #3372

slarse opened this issue May 16, 2020 · 0 comments · Fixed by #3373

Comments

@slarse
Copy link
Collaborator

slarse commented May 16, 2020

I have a problem in noclasspath mode where a qualified type reference in catch clauses are resolved incorrectly. Take the following code snippet.

public class CatchQualifiedReference {
    public static void main(String[] args) {
        try {
        } catch (some.neat.pkg.CustomException e) {
        }
    }
}

In noclasspath mode, some.neat.pkg.CustomException becomes a type references with the qualified name some. Which is pretty wild. The problem appears to be that TypeBinding.readableName() actually returns just some here:

char[] readableName = binding.readableName();

So this could be a problem with the JDT library rather than with Spoon. I'm not certain. I'll put up a PR with a test case, but I haven't had the time to look into a solution.

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 a pull request may close this issue.

1 participant