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

Simply qualified type reference in catcher get marked as fully qualified when multiple types are specified #3917

Closed
slarse opened this issue May 10, 2021 · 0 comments · Fixed by #3918
Labels

Comments

@slarse
Copy link
Collaborator

slarse commented May 10, 2021

When a try-catch has a catcher with a single type, it properly gets marked as simply qualified (i.e. package is implicit):

try {
    // do something
} catch (Exception e) {
    // handle
}

However, when specifying multiple types in the catcher, like so:

try {
    // do something
} catch (Exception | RuntimeException e) {
    // handle
}

then the types become fully qualified on parsing, i.e. the packages are not marked implicit. This is a big problem for sniper printing, as the sniper ends up printing e.g. java.lang.Exception instead of just Exception.

This is most likely related to #3800, in which I fixed the very same problem but for a single type in the catcher.

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

Successfully merging a pull request may close this issue.

1 participant