Skip to content

Commit

Permalink
Avoid ResolvableType creation for interface/superclass check
Browse files Browse the repository at this point in the history
See gh-30713

(cherry picked from commit 1dfe737)
  • Loading branch information
jhoeller committed Jun 21, 2023
1 parent 5375f62 commit d3df45d
Showing 1 changed file with 6 additions and 3 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 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.
Expand Down Expand Up @@ -568,7 +568,7 @@ private boolean determineUnresolvableGenerics() {
try {
for (Type genericInterface : resolved.getGenericInterfaces()) {
if (genericInterface instanceof Class) {
if (forClass((Class<?>) genericInterface).hasGenerics()) {
if (((Class<?>) genericInterface).getTypeParameters().length > 0) {
return true;
}
}
Expand All @@ -577,7 +577,10 @@ private boolean determineUnresolvableGenerics() {
catch (TypeNotPresentException ex) {
// Ignore non-present types in generic signature
}
return getSuperType().hasUnresolvableGenerics();
Class<?> superclass = resolved.getSuperclass();
if (superclass != null && superclass != Object.class) {
return getSuperType().hasUnresolvableGenerics();
}
}
return false;
}
Expand Down

0 comments on commit d3df45d

Please sign in to comment.