Skip to content

Enhance InstanceOfPatternMatch to cover method invocations as well #275

Open
@timo-abele

Description

@timo-abele

What problem are you trying to solve?

I've come across

if (authentication.getPrincipal() instanceof UserDetails) {
    UserDetails springSecurityUser = (UserDetails) authentication.getPrincipal();
    return springSecurityUser.getUsername();
}

which is currently not covered

Describe the solution you'd like

if (authentication.getPrincipal() instanceof UserDetails springSecurityUser) {
    return springSecurityUser.getUsername();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions