From 0eb73c130c4006b631edb6df6adebe1330fc07a7 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 14 Oct 2021 17:33:42 +0200 Subject: [PATCH] Apply "instanceof pattern matching" Eclipse clean-up in spring-context-indexer --- .../springframework/context/index/processor/TypeHelper.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-context-indexer/src/main/java/org/springframework/context/index/processor/TypeHelper.java b/spring-context-indexer/src/main/java/org/springframework/context/index/processor/TypeHelper.java index 470c0398a23..f24fd21df42 100644 --- a/spring-context-indexer/src/main/java/org/springframework/context/index/processor/TypeHelper.java +++ b/spring-context-indexer/src/main/java/org/springframework/context/index/processor/TypeHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,8 +60,7 @@ class TypeHelper { if (type == null) { return null; } - if (type instanceof DeclaredType) { - DeclaredType declaredType = (DeclaredType) type; + if (type instanceof DeclaredType declaredType) { Element enclosingElement = declaredType.asElement().getEnclosingElement(); if (enclosingElement instanceof TypeElement) { return getQualifiedName(enclosingElement) + "$" + declaredType.asElement().getSimpleName().toString();