Skip to content

Commit d3df45d

Browse files
committed
Avoid ResolvableType creation for interface/superclass check
See gh-30713 (cherry picked from commit 1dfe737)
1 parent 5375f62 commit d3df45d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

spring-core/src/main/java/org/springframework/core/ResolvableType.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -568,7 +568,7 @@ private boolean determineUnresolvableGenerics() {
568568
try {
569569
for (Type genericInterface : resolved.getGenericInterfaces()) {
570570
if (genericInterface instanceof Class) {
571-
if (forClass((Class<?>) genericInterface).hasGenerics()) {
571+
if (((Class<?>) genericInterface).getTypeParameters().length > 0) {
572572
return true;
573573
}
574574
}
@@ -577,7 +577,10 @@ private boolean determineUnresolvableGenerics() {
577577
catch (TypeNotPresentException ex) {
578578
// Ignore non-present types in generic signature
579579
}
580-
return getSuperType().hasUnresolvableGenerics();
580+
Class<?> superclass = resolved.getSuperclass();
581+
if (superclass != null && superclass != Object.class) {
582+
return getSuperType().hasUnresolvableGenerics();
583+
}
581584
}
582585
return false;
583586
}

0 commit comments

Comments
 (0)