spring-projects / spring-boot

Spring Boot
https://spring.io/projects/spring-boot
Apache License 2.0
74.4k stars 40.51k forks source link

Use pattern matching for instanceof where appropriate #28181

Closed wilkinsona closed 2 years ago

wilkinsona commented 2 years ago
if (obj instanceof String) {
    String s = (String) obj;
    // use s
}

becomes

if (obj instanceof String s) {
    // use s
}
avillalain commented 2 years ago

@wilkinsona Is this issue something that new comers can start working on?

wilkinsona commented 2 years ago

Not at the moment. Thanks for the offer, though. We haven't started work on 3.0 yet and there are a number of things that'll have to be tackled before we can look at this one.

wilkinsona commented 2 years ago

Closing in favor of #31475.