Skip to content

Commit 8fb229e

Browse files
committed
Minor refactoring, license year
1 parent 87af6df commit 8fb229e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/main/java/org/apache/ibatis/reflection/TypeParameterResolver.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 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.
@@ -206,10 +206,8 @@ private static Type scanSuperTypes(TypeVariable<?> typeVar, Type srcType, Class<
206206
if (declaringClass == parentAsClass) {
207207
for (int i = 0; i < parentTypeVars.length; i++) {
208208
if (typeVar.equals(parentTypeVars[i])) {
209-
if (parentAsType.getActualTypeArguments()[i] instanceof TypeVariable<?>) {
210-
return Object.class;
211-
}
212-
return parentAsType.getActualTypeArguments()[i];
209+
Type actualType = parentAsType.getActualTypeArguments()[i];
210+
return actualType instanceof TypeVariable<?> ? Object.class : actualType;
213211
}
214212
}
215213
}

src/test/java/org/apache/ibatis/reflection/TypeParameterResolverTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 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.

0 commit comments

Comments
 (0)