Browse Source

Apply "instanceof pattern matching" Eclipse clean-up in spring-context-indexer

pull/27562/head
Sam Brannen 4 years ago
parent
commit
0eb73c130c
  1. 5
      spring-context-indexer/src/main/java/org/springframework/context/index/processor/TypeHelper.java

5
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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -60,8 +60,7 @@ class TypeHelper {
if (type == null) { if (type == null) {
return null; return null;
} }
if (type instanceof DeclaredType) { if (type instanceof DeclaredType declaredType) {
DeclaredType declaredType = (DeclaredType) type;
Element enclosingElement = declaredType.asElement().getEnclosingElement(); Element enclosingElement = declaredType.asElement().getEnclosingElement();
if (enclosingElement instanceof TypeElement) { if (enclosingElement instanceof TypeElement) {
return getQualifiedName(enclosingElement) + "$" + declaredType.asElement().getSimpleName().toString(); return getQualifiedName(enclosingElement) + "$" + declaredType.asElement().getSimpleName().toString();

Loading…
Cancel
Save